Risk Parameters
This risk parameters are relevant to perpetual futures. Further risk parameters are also set out in ๏ปฟPlatform Risks and ๏ปฟBorrow Lend Risk Parameters.๏ปฟ
In Drift v2, to prevent market manipulation and protect users during volatile events, markets will prevent users from sending orders if oracle-mark price breaches the 10% band of the oracle's 5-minute time-weighted average price (TWAP). If the mark and the 5-minute oracle TWAP diverges by 10%, markets will prevent orders from filling until price reverts back within this band.
These formulas are defined below:
Oracle-mark divergence = (mark - oracle) * max_spread
Oracle-TWAP-mark band = within 10% of mark - oracle_twap_{5 minutes}
To guard against concentration risk from a single whale, when assets exceed certain size, their asset weights can be discounted. ๏ปฟ
Size Weightage = 1.1 / (weight * sqrt{size} * imf_factor)
Additionally, liabilities (borrows) can have premium applied.
(1-weight/imf_factor) + sqrt{size} * imf_factor
The Clearinghouse will also pause risk-increasing trades that further increase large oracle-mark divergence. Closing/reducing a position that further breaches this divergence is also not allowed (unless the divergence has already been breached).
An individual user sub-account can have up to 32 outstanding orders at any one time. A Market Order sent has limits within each instruction (so may be filled iteratively).
- exceed 2% price impact (set by the market's max_slippage_ratio )
Market Orders have the possibility of only being partially filled before expiration if any of the following limits occur:
- exceeds its slippage tolerance implied limit price
- exceeds its active time limit (for market orders, the Clearinghouse sets this at 30 seconds)๏ปฟ
Within a single transaction, orders can filled up by the max_base_asset_amount against the AMM. This maximum is set per market and calling of multiple fill instructions may work. For example, if the maximum amount was 10,000 SOL, an order for 100,000 SOL can be filled against the AMM in 10 instruction calls.
The following conditions will also expire/cancel the remainder(s) of orders:
- ๏ปฟOut of favor oracle price divergence from maker's set limit price (post only orders)๏ปฟ
- oracle price 2.5% above maker's ask limit price
- oracle price 2.5% below maker's bid limit price
- order fill would reduce free collateral below 0 (for taker orders)
๏ปฟNote that whenever a user's orders are cancelled, fillers receive a small reward for the user they filled, if they did not receive payment otherwise.๏ปฟ
This risk is addressed in Risks and P&L.
Users can technically achieve unbounded unrealised P&L from entering and exiting a trade against the AMM. Further, as the AMM allows for asynchronous trading; there may not be an offsetting loss within the system to account for the gain made by particular users.
As such, even if user can achieve unbounded unrealised gains - those gains cannot be settled and withdrawable as collateral until there is a dollar of offsetting loss to account for the dollar of gain.
In a circumstance where the majority of participants are in extreme positive unrealised P&L and the unrealised P&L cannot be settled; the market may be eligible for settlement through the Delisting Process.