Earnest money deposits vary by location. And the standards evolve over time.
In neighboring Santa Clara County (California), it has been 3% as long as I have been involved (20 years)
Here in Santa Cruz County, the standard used to be 1% upon acceptance of the offer and increase the deposit when the first contingency is removed to 3%.
I write "used to be", because at some time between 2007 (when I did my last contract with the 1% increased to 3% deposit) and 2012, agents in Santa Cruz adopted the Santa Clara style of full 3% upon contract acceptance.
I suspect that your agent calculated 3% = $3000 and change, and he rounded it up to $4000, to show financial strength.
That can make a difference.
I recall writing an offer in 2012 on a fixer upper that was listed for $540k (worth $800k after $100k repairs). My offer of $550k came with $16500 (3%) earnest money, with a photocopy of a check, and I expected to be countered, and was willing to go to $620k.
I never received a counter.
I found out that the winning offer had attached a cashier's (!) check of $100k (!) made out to the title company. He got the house for asking price of $540k.
The seller had received 20 offers and never bothered to talk to anyone else.. they were too impressed with the big EMD.
So they accepted his $540k offer and later gave up another $20k because of termite damage!!
My $550k offer had been 100% non-contingent..
What a joke this deal was!
No dual agency!