I don't know if I understand the code in github correctly or accurate enough, correct me if I am not. Some thoughts as below:
How does the market price BTS(in real USD)? It is from the expectation of all players who would trade BTS from/to real cash.
How does the market price bitUSD(in BTS)? It is from the expectation of all players who bet on bitUSD with BTS.
But currently those two prices have nothing in connection except that we hope they can be connected.
What if we use the price of BTS in real USD to deal all margin calls instead of the price of bitUSD? I think that would give a connection to bitUSD and real USD. And someone who pays real USD can finish arbitrages if bitUSD differs from USD to some level.