Concepts

Closing and payout

The four ways an order or position ends, and how its balances come back.

Four endings#

EndingWhenWhat happens
CancelledThe maker cancels an order nobody tookThe deposit and the account rent go back to the maker, and the account closes.
MaturedThe market's last epoch settlesThe position closes and both balances wait for payout.
Under marginAfter a settlement, one side can't cover a worst epoch plus the reserveThe position closes early. That side pays the reserve to whoever settled, and the remaining legs are cancelled.
Oracle timeoutAn epoch's checkpoint isn't final by the delay limitAnyone 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.