A pool with collateral, can have multiple perpetuals. These perpetuals have the same type of collateral.
A market where trader can trade / deposit / withdraw, has collateral and underlying asset. Stored accounts of all traders.
Price of underlying asset in perpetual. Offered by oracle. Used to help AMM calculating.
Price of underlying asset in perpetual. Offered by oracle. Used to calculate account data.
Cash and position of a trader in perpetual, both values can be negative.
cash - position * unit accumulative funding
. The cash which counted funding payment.
available cash + mark price * position
. The margin of an account in perpetual considering position.
mark price * abs(position) * initial margin rate
. The used margin of an account in perpetual.
mark price * abs(position) * maintenance margin rate
. The maintenance margin of an account in perpetual.
- If position = 0:
cash
- If position != 0:
margin - max(initial margin, keeper gas reward)
The available margin of an account in perpetual.
available margin >= 0
- If position = 0:
cash >= 0
- If position != 0:
margin >= max(maintenance margin, keeper gas reward)
- If position = 0:
cash >= 0
- If position != 0:
margin >= keeper gas reward