Margin
Margin Ratio Formula
where
𝑀𝑎𝑥𝑁𝑒𝑡𝐵𝑎𝑠𝑒(𝑝) is motivated as follows: Instead of taking |𝐵𝑎𝑠𝑒𝐴𝑚𝑜𝑢𝑛𝑡(𝑝) + 𝑃𝑒𝑛𝑑𝑖𝑛𝑔𝐵𝑖𝑑𝑠(𝑝) − 𝑃𝑒𝑛𝑑𝑖𝑛𝑔𝐴𝑠𝑘𝑠(𝑝)| , we take the max above, since otherwise a user could place equivalent bids and asks without raising its leverage, thus artificially deepening the order book.
Initial and Maintenance Margin Ratio (IMR/MMR)
The IMR and MMR are set at market creation. These are the inverse of leverage, e.g., an IMR of 0.1 equals a maximum leverage of 10x and an MMR of 0.05 means a position can get liquidated once its leverage reaches 20x.
The owner of the AdminCapability
may change these parameters, but the smart contract first stores the new values, so they are visible on-chain, and only updates the actual market parameters after sufficient time has passed (a few days).
Position Margin Requirements
To check that the position's margin ratio is above the market's IMR:
To get the Maintenance Margin Requirements of a position, simply replace 𝐼𝑀𝑅 with 𝑀𝑀𝑅 .
Last updated