Skip to main content
A settlement is a coordinated transaction between two or more parties. It represents a real-world financial obligation (e.g. delivery of tokenized securities in exchange for payment) that must be executed atomically.

Anatomy of a settlement

Every settlement has:
PropertyDescription
idUnique identifier (UUID)
template_idThe template governing this settlement’s workflow
stateCurrent position in the state machine
settlement_typesingle_platform or cross_platform
partiesThe entities involved and their roles
legsThe obligations to be fulfilled
idempotency_keyClient-provided key for safe retries
timeout_atDeadline - settlement rolls back if not completed by this time
settlement_categoryOptional. repo_open, repo_close, or null for standard DvP
parent_settlement_idOptional. Links a repo_close settlement to its repo_open parent
maturity_atOptional. When a repo_open settlement’s closing leg should be created

Settlement types

Single-platform

Both parties belong to the same platform. The initiating platform provides all party details (external reference, name, wallet address) inline in the settlement instruction. The settlement proceeds immediately through the state machine.

Cross-platform

Parties span multiple platforms. The initiating platform specifies counterparty platforms by slug. Counterparty parties are created as placeholders (status: pending_confirmation) until the counterparty platform confirms by providing their party details.
Platform A initiates --> Counterparty party created as placeholder
Platform B confirms  --> Party filled in, engine resumes
See Cross-Platform Settlements for details.

Settlement categories

Settlements can optionally carry a settlement_category that identifies their role in a multi-settlement workflow.
CategoryDescription
repo_openOpening leg of a tokenised repo. Created by the platform with a maturity_at timestamp.
repo_closeClosing leg of a tokenised repo. Auto-created by KeyStone at maturity with reversed legs.
nullA standard settlement (default).

Repo settlements

A tokenised repo is modelled as two linked DvP settlements. The opening settlement carries a maturity_at timestamp. When it finalizes and maturity arrives, KeyStone automatically creates the closing settlement with:
  • parent_settlement_id pointing to the opening settlement
  • Reversed legs (buyer returns bonds, seller returns USDC)
  • Full compliance re-screening
Query all settlements in a repo via GET /v1/settlements/{id}/related. See Tokenised Repo for the full concept explanation and Execute a Tokenised Repo for a step-by-step guide.

Idempotency

Every settlement instruction includes an idempotency_key scoped to your environment. If you send the same key twice, the API returns the existing settlement rather than creating a duplicate. This makes all settlement creation calls safe to retry.

Timeout and rollback

Every settlement has a timeout_at deadline. If the settlement hasn’t reached a terminal state by this time, it transitions to TIMED_OUT and the escrow contract returns any deposits to their original owners. This guarantee means there is no risk of funds being locked indefinitely.