Act as a Sentinel
How do I watch my book and step in when needed?
Track your open exposure, fund ahead of the daily margin cycle, and assert a default when a taker is short. CRX automates the routine cranks — variation margin and liquidation run on their own keeper — but the desk that watches its own book catches the case the keeper has not reached yet. Time: ~6 min.
You will end able to read your live exposure, keep your general balance ahead of the IM re-true, and open a liquidation when a counterparty cannot pay.
Step 1 — Read your live exposure
Poll your firm state and your open agreements. This is the dashboard you check before every session.
GET /firm/0x…your address…
→ { "balance": "…", "open_acas": … }
- Outcome: your general balance and your open-agreement count. Sum your open notional against the balance — there is no venue cap, so the ceiling is the one you hold yourself to.
- Branch: if
open_acasis higher than you expect, a position bound that you did not mean to win. Reconcile against your own quote log before quoting more.
Step 2 — Fund ahead of the daily cycle
Keep your general balance above what the daily margin cycle will draw. Each day the protocol re-trues your SCA toward its IM target out of your general balance, and variation margin debits your losses from it continuously.
- Outcome: the IM re-true and VM both settle from a funded balance, and your SCAs stay at target.
- Branch: if general cannot cover the re-true, the top-up is partial — no revert — and the gap surfaces to the cascade against you. Top up (
deposit) before the daily valuation time, not after.
Step 3 — Watch the sessions
Track which of your pairs are about to close. A position on a session-windowed or managed currency carries gap risk across the closed window, and no liquidation runs while the session is shut.
- Outcome: you know which open positions sit on a pair (USD/CLP, USD/COP, USD/PEN, or a gappy NDF) that will be frozen overnight or over the weekend.
- Branch: if a managed-currency position looks under-margined going into a close, you cannot raise the IM on a bound trade — the rate was set at bind. Carry the exposure knowingly, or close it. See Security Considerations (~6 min).
Step 4 — Assert a default when a counterparty is short
When a taker you face cannot meet its variation margin and looks globally insolvent, you do not wait. Either counterparty of an agreement can open the liquidation.
- Confirm the taker is short — its general balance cannot cover its VM, and its SCA across its book will not close the gap.
- Open the assertion. This posts a bond from your own general balance and opens a 20-minute proof window, freezing the party.
- Supply the party's complete set of agreements (count-checked on-chain). The cascade force-VMs the whole book, then tests global solvency.
- Outcome — insolvent: the waterfall runs. You are made whole from the taker's own SCA first, then its general balance, then the guarantee fund — never another counterparty's collateral. The book is burned, the party terminated and stamped
DEFAULT, and your honest bond returned. - Branch — solvent: the assertion fails. The book is restored and your bond is forfeited to the accused — you do not get to default someone for nothing. Assert only when you have proven the shortfall.
The keeper usually asserts before you need to. The crx-keeper cranks VM and opens liquidations on a stress trigger automatically. Your assertion is the backstop for the case it has not reached — not the routine path.
Step 5 — Let settlement close the trade
At a position's settlement date you do nothing special. Settlement runs on one Pyth EMA — the same moving average that marked the trade — and either party can crank settle. There is no fixing to submit and no number to dispute.
- Outcome: the position nets to one figure at the settled rate and clears. Your margin unlocks.
- Branch: if CRX's services are dark,
closeOnChainlets the two parties close directly, with no operator. Custody never depends on the relayer being up. See Custody & security (~4 min) for the failsafe.
The mechanics behind these steps are in Variation Margin (~5 min) and Liquidation & Default Waterfall (~5 min).
Next: Running a CRX Desk (~5 min) — the desk in full, from the top.