Concepts
Deposits and margin
Each side deposits two worst-case epochs and a small reserve. Here is the formula, a calculator, and when a position closes early.
The deposit#
Each side's deposit is set by a formula; there is nothing to choose.
Long crest pays the fixed rate, so its worst epoch is the crest at zero. Short crest pays the crest, which can't count above the cap, so its worst epoch is the crest at the cap. On chain, with rates in ppb, the worst epoch is ceil(notional × rate ÷ 1,000,000,000) lamports, rounded up so a deposit is never a lamport short.
- Worst epoch: the crest at zero
- 0.0600 SOL
- Deposit
- 0.1210 SOL
- Stays open while it holds
- 0.0610 SOL
Long crest pays the fixed rate, so its worst epoch is the crest at zero: 1,000 × 0.0060%. Amounts round up to the lamport, as the program funds them.
Why two epochs#
The program checks both balances after every settlement. Starting with two worst epochs means a side can pay the worst possible epoch and still hold enough for the next one, so a single bad epoch never closes a position by itself.
When a position closes early#
After each settlement, if either side holds less than one worst epoch plus the reserve, the position closes on the spot:
- the side that fell short pays the reserve, or what is left of its balance if that is less, to whoever sent the settlement;
- every remaining leg is cancelled;
- both balances wait to be paid out.
Nothing is owed after that, and nobody else's position is affected. It does mean a hedge can end before its market does.
Rent#
The order account holds rent on top of the deposits: about 0.002 SOL for a position's 156 bytes. The maker pays it when placing the order and gets it back when the account closes, by cancel or by payout. The ticket shows the exact amount.
Example#
A 1,000 SOL order at a fixed 0.0060% per epoch, in a market capped at 0.0150%, with a 0.001 SOL reserve:
| Long crest | Short crest | |
|---|---|---|
| Worst epoch | 1,000 × 0.0060% = 0.06 SOL | 1,000 × 0.0090% = 0.09 SOL |
| Deposit | 0.121 SOL | 0.181 SOL |
| Stays open while it holds | 0.061 SOL | 0.091 SOL |
The figures are an example. The app uses each market's real cap and Crest's reserve.