BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Inverse-quoting vs. Flat Quoting in Contract/Settlement #159

Closed patrickdugan closed 4 years ago

patrickdugan commented 4 years ago

Add a flag, that is true by default, that sets a contract to be inverse-quoted or not. If it is inverse-quoted it is assumed that the collateral is equal to the numerator of the contract pair and we use the 1/entry-1/exit in the settlement and we divide the notional value of the contract by the price to figure out how much of this inverse-quoted collateral is needed.

E.g there is a BTC/USD contract with a notional value of $1, and it is inverse quoted with a synthetic Bitcoin collateral. The initial margin is 0.05, but because Inverse is true, then the initial margin would be 0.05/price so if price is $10000 the sBTC needed to initial margin 1 contract is 0.000005

If the flag is set to false then the collateral is assumed to be equal to the denominator, settlement is calculates simply as exit-entry, and initial margin at 0.05 would mean 0.05 of that collateral is used.

santos177 commented 4 years ago

working on inverse-quoting branch

santos177 commented 4 years ago

flag added in every function related with quoting. We need now QA.