Skip to Content
Drift ProtocolTradingBlock Conditions

Block Conditions

Deposits

  • User attempting to deposit when the max_deposits for that spot asset would be or has been reached

  • Spot market is in reduce only mode and deposit does not pay off a borrow

Withdraws

  • User attempting to withdraw with outstanding liabilities when an oracle is invalid

  • Attempting to borrow or withdraw when there are outstanding liabilities and any asset or liability’s Oracle the user has is deemed invalid (“invalid” in accordance with MarginCalc action)

  • User attempting to increase the number of liabilities above 1 with an isolated tier liability

  • Users can only have one outstanding liability when the liability has the isolated asset tier.

  • Users cannot withdraw assets that would put their total collateral (weighted collateral value) below their initial margin requirement

  • Users cannot withdraw an asset amount that would put that particular asset’s protocol liquidity below the rolling limits

    • These limits differ based on whether the withdraw would open borrow or not

Placing Orders

  • Users cannot place orders that are risk-increasing and would put their initial margin requirement above their total collateral

  • Users cannot place orders that would increase their number of outstanding liabilities above 1 if the liability has the isolated asset tier

  • [SPOT ONLY] without margin trading enabled on an account, users won’t be able to open spot orders than would create borrows on the account

  • [SPOT ONLY] with margin trading enabled, users won’t be able to borrow using the same rolling limits for withdraws

Filling Orders

  • A user’s orders will not fill if it sends them under the margin requirement plus buffer (since they have `InsufficientCollateral`)
    • Within a match, if either user hits this condition, the match won’t go through

Settle Perp PnL

  • When market’s oracle is deemed invalid

  • When user account value is below the maintenance margin requirement

  • When AMM repeg cost exceeds budget

Last updated on