Closing Early
What is an early close?
An early close ends an open NDF before maturity, by agreement of both parties. Rather than wait for the fixing, you and CRX settle now at a rate you both sign. The contract checks that rate against the oracle within tolerance and pays the difference in USDC: the same mechanics as settlement, only sooner.
It is cooperative. One side cannot force it; both must co-sign.
How does it work?
Both parties hold their own keys; the close runs directly on-chain between them.
- You and CRX agree a close-out rate.
- Each co-signs a
closeOnChaincall on the contract. - The contract checks the rate against the oracle within tolerance: an off-market rate is rejected.
- It pays the gap in USDC and returns both sides' initial margin to general balance.
Within tolerance, the position closes. Out of tolerance, the call reverts and the trade runs to maturity.
Why does it not need the operator?
The close is a direct contract call, co-signed by you and CRX. It is also the failsafe: with the relayer, keeper, and bots all offline, the two signatures still land on-chain and free both sides whole. The contract ends a trade on its own.