Everyone on here so far is correct. I guess I would unfortunately consider myself an expert in this area, since I have lost several deposits. I would try to keep your earnest money as low as possible when you make offers.
How much earnest money to put up: If it's an individual who owns a property put up no more than $100, Bank/REO $500-$1,000, HUD homes are $100, and Fannie Mae is 10% of the purchase price.
Basically, you will always lose your earnest money if you cannot close on your property. Usually if a property is owned by a bank, you will not be allowed to assign your contract. Each state varies so you may want to check with an agent.
These are the main causes of not being able to close:
1. You paid too much for the property
2. Your repairs are way off
3. Your comps are too high
4. You don't have a big enough or targeted enough cash buyer's list
I heard once that when you pull comps, look for a recent sale that is much lower than the rest. You will know that that low purchase price was by an investor, and if you can price your property below that price, that investors should be willing to buy at that price. It makes sense. Last piece of advice, make sure you know what your exit strategy is before you make an offer. For example, if you decide you are going to wholesale a property, make sure you know that that is your exit strategy, and always have a back-up plan. For example, if you exit strategy is to wholesale a property, and you will be using transactional funding for a double close, you might have a back-up plan of closing and rehabbing the property using hard money or private money and the selling it retail for full price. Trust me, a back-up plan will save you some times. Good luck, and try to buy at the right price, quote accurate repair costs, get accurate comps, and market properly so you won't have any problems selling your properties.