Closing Early
An early close ends an open NDF before maturity, at a rate both parties sign. The contract checks that rate against the live market, pays the difference in cash, and returns each side's initial margin — and a co-signed close runs on-chain even with CRX offline.
What is an early close?
An early close is the second way a position ends: before maturity, at a rate both parties sign. Instead of waiting for the fixing at maturity, the trader and CRX settle the position now.
An early close is cooperative. It happens only when both sides sign it. Neither side can force a close on the other.
The money moves exactly as it does at settlement: the contract pays the difference in cash and returns each side's initial margin. For the payout formula, see Settlement & Payout (~2 min).
How does it work?
Both sides act from their own wallets, and the close runs directly on-chain between them. The close takes four steps:
- The trader and CRX agree on a close-out rate.
- Both sides sign the close.
- The contract checks the agreed rate against the live market rate (the oracle) and accepts it only inside the tolerance set in the trade terms.
- The contract pays the difference in cash and returns each side's initial margin to its balance.
The table below shows the two outcomes of the check:
| Check result | What happens |
|---|---|
| Within tolerance | The contract closes the position. |
| Out of tolerance | The contract rejects the close, and the trade runs to maturity as planned. |
The check protects both sides from closing at an off-market rate.
The technical detail (the closeOnChain call, its parameters, and the signature checks) is in the contract reference (~10 min).
Why does it work even if CRX is offline?
The close runs between the trader and CRX alone, without any CRX service. Once both sides have signed, the close is a direct contract call, and the contract verifies the two signatures itself.
It is also the failsafe for ending a trade. Even if every off-chain service CRX runs is offline, a close that both sides have signed still executes. For how a trade opens in normal operation, see Requesting a Quote (~2 min).