We change the database schema, and the code, mostly ".to_f" > "to_d" (and sometimes the developer forced that to make sure of the type even).
Good answer

A harder one now : What do you think about the whole architecture, to be more precise, about the fact that everything runs inside resque workers leading to potential race conditions, and unexpected behaviour ? Did you make any changes to the way things run and the order in which they run ?
Hi,
This is the next major code change. While we changed the way hedging is made and assets balances are accounted, and move some of the database update, there is still a lot of database call/update from resque workers. So the next step is to move every database call to models, along with a major trading organisation change (that will make a lot of code obsolete) that we are working on with Myself.
It would be a pleasure, thanks Naima

Ichthyo, I realise my answer was quite short about the hedging of position. For now, what we have done to avoid potential unhedged position is to lower the spread (avg. of 0.06 these days) and to increase the base interest used to charge position. Right now a USD deposit (and short position) is remunerated at over 16% a year, while long position are charged at almost 30% a year. The idea is to encourage short term trading and discourage long term position until balances are restored. Because each time a user close and open a new position, the system check the balances and hedge accordingly.
There are options that we're working on, like deposit only accounts (for people who want to accrue interests and are not interested in trading), and the change that I talked above.
Anyway thanks for your post
Raphael