Block Conditions
Deposits
User attempting to deposit when the
max_depositsfor that spot asset would be or has been reached.Spot market is in reduce-only mode and the 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
MarginCalcaction).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 a 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 rules:
Without margin trading enabled on an account, users won't be able to open spot orders that would create borrows on the account.
With margin trading enabled, users won't be able to borrow using the same rolling limits applied for withdraws.
Filling Orders
A user's orders will not fill if filling them would send the account below the margin requirement plus buffer (resulting in
InsufficientCollateral).Within a match, if either user hits this condition, the match will not go through.
Settle Perp PnL
Settle perp PnL is blocked when any of the following apply:
The market's oracle is deemed invalid.
The user's account value is below the maintenance margin requirement.
The AMM repeg cost exceeds budget.

