Skip to main content
This guide walks through a cross-platform DvP where Platform A’s seller delivers tokens to Platform B’s buyer using bilateral instruction submission and autonomous on-chain execution.

Flow overview

Step 1: Platform A submits seller instruction

Platform A creates their side of the settlement:
The response includes a generated trade_reference:

Step 2: Share trade reference

Platform A shares the trade reference with Platform B through their own communication channels (API integration, OTC desk, email, etc.).

Step 3: Platform B submits buyer instruction

Platform B submits the matching instruction with the same trade reference:
The response includes status: "matched" and the new settlement_id.
Both platforms authenticate with their own M2M tokens. Each platform can only see and manage their own instructions.

Step 4: Compliance and autonomous execution

Once instructions match, the settlement is created on-chain with both parties confirmed. KeyStone handles compliance screening and attestation. After compliance clears:
  1. Both parties deposit to escrow contracts using their deposit secrets (via their own custody provider)
  2. Contracts detect deposits complete, coordinator reveals recipient addresses and auto-executes the atomic swap
  3. Settlement auto-finalizes
Both platforms receive the settlement’s webhooks as it progresses - see the webhook event catalog for which states emit events.

Monitoring

Both platforms can track the settlement:

Cancelling before match

If Platform A wants to cancel before Platform B submits:
Only pending_match instructions can be cancelled. Once matched, the settlement follows its normal lifecycle.

Cross-chain variant

v1 settles single-chain: both legs must live on the configured settlement chain, and registration rejects foreign-chain legs. Cross-chain settlement (e.g. bonds on Ethereum against USDC on Avalanche) is on the v2 roadmap.