Dave's Refinery is the place you go to sell the ores in your inventory. You can find it near the fountain and the stone statue. Later on the creator moved it to the back of Steve's General Store (in the holiday/current update).
To sell ores you need to step up to Dave. When you are near him, a window will pop up, giving you the ability to see what each ore is worth, and from here you can sell your ores by pressing a ore from the scroll menu, followed by the sell button. If you are trying to sell dirt it will say: "Sell X Dirt for $Y" where X is the number of dirt you have and Y is the value of all your dirt.
Selling everything in your inventoryEdit
You can also choose to sell everything in your inventory, this is easily explained with dirt, but it accounts for every ore in the scroll menu.To sell everything in your inventory press the dirt in Dave's Refinery twice, you will now see a new button in the lower right corner of Dave's Refinery that reads: "Sell all for $X" where X is the value of your inventory.
Chat messages from selling oresEdit
Have you ever wondered why you sometimes see in the chat that: "Someone has sold all for ..." or "Someone has sold Tektite for ... "
The message appears in the chat when you sell for over $50,000 in total.