Concepts
Closing and payout
The four ways an order or position ends, and how its balances come back.
Four endings#
| Ending | When | What happens |
|---|---|---|
| Cancelled | The maker cancels an order nobody took | The deposit and the account rent go back to the maker, and the account closes. |
| Matured | The market's last epoch settles | The position closes and both balances wait for payout. |
| Under margin | After a settlement, one side can't cover a worst epoch plus the reserve | The position closes early. That side pays the reserve to whoever settled, and the remaining legs are cancelled. |
| Oracle timeout | An epoch's checkpoint isn't final by the delay limit | Anyone can end the position. Legs from that epoch on are cancelled, and no reserve is paid. |
The app names the last three matured, liquidated and ended by oracle timeout on the position's card.
Payout#
Once a position is closed, one transaction pays it out: the maker's balance goes to the maker, the taker's balance to the taker, and the account closes with its rent returned to the maker. Anyone can send it, because the destinations are written in the account and nobody can change them. Crest's keeper pays out closed positions, and the app shows Pay out on any of yours that is waiting.
Ending a stalled position#
Settlement needs each epoch's checkpoint to be final. If one isn't, because it was never posted or a dispute was never resolved, the position waits. Once the epoch it is waiting on is more than the delay limit in the past, the app shows End position. Ending it closes the position with the balances as they stand: legs already settled stay settled, and the rest are cancelled rather than estimated.
After payout#
A paid-out position's account no longer exists, so it leaves the Positions list in the app. Every settlement and the payout itself remain in your wallet's transaction history on chain.