Saving energy using market-based control