Overview
Use the Settlement API through gRPCSettlementService to coordinate DVP settlement, exchange settlement messages over a long-lived stream, record settlement outcomes, and query settlement state and history.
API surface
Below are the Settlement API sections.Settlement stream
SettlementStream is the core realtime RPC in this service.
Message Flow:
- The agent sends a handshake,
- heartbeats,
- preconfirmations,
- DVP lifecycle events, and
- RFQ quotes or rejections.
Endpoints:
| Endpoint | Use Сase |
|---|---|
SettlementStream | Long-lived bidirectional stream for RFQ handling and settlement lifecycle coordination. |
Proposal queries
UseGetPendingProposals to retrieve pending proposals for a party and GetSettlementStatus to inspect the current state of a specific settlement. The proto comments describe these as optional unary RPCs for specific operations.
These endpoints are suitable for monitoring UIs, operational dashboards, and background workers that need to poll the settlement state without joining the bidirectional stream.
Endpoints:
| Endpoint | Use Сase |
|---|---|
GetPendingProposals | Fetch pending settlement proposals for a party. |
GetSettlementStatus | Check the current status of a settlement. |
Preconfirmation
UseSubmitPreconfirmation when you need to send a preconfirmation outside the streaming flow. Explicitly labels it as a manual pre-confirmation path when the stream is idle.
This is useful for fallback flows, operational tooling, or integrations that do not maintain a long-lived settlement stream.
Endpoints:
| Endpoint | Use Сase |
|---|---|
SubmitPreconfirmation | Submit a manual preconfirmation when not using the stream flow. |
Disclosed contracts
UseSaveDisclosedContract to persist a disclosed contract during allocation, and use GetDisclosedContracts to retrieve disclosed contracts. Operators can access all disclosed contracts, while buyers and sellers can access their own.
These endpoints are the right place to document allocation-time artifacts and settlement disclosures separately from the higher-level settlement proposal objects.
Endpoints:
| Endpoint | Use Сase |
|---|---|
SaveDisclosedContract | Save a disclosed contract during allocation. |
GetDisclosedContracts | Retrieve disclosed contracts for the current participant or operator. |
Recording and history
UseRecordSettlement to record a completed settlement and RecordTransaction to store a transaction in history. Use GetTransactionHistory to retrieve historical transactions, RecordSettlementEvent to append to the settlement proposal event log, and GetSettlementHistory to fetch the event history for a proposal. Settlement history is treated as an append-only event log.
This part of the API is best documented as the audit and observability layer of settlement. It is useful for post-trade operations, internal reconciliation, and external status reporting.
Endpoints:
| Endpoint | Use Сase |
|---|---|
RecordSettlement | Record a completed settlement. |
RecordTransaction | Record a transaction in the settlement history. |
GetTransactionHistory | Retrieve historical settlement-related transactions. |
RecordSettlementEvent | Append an event to the settlement proposal history log. |
Proposal lifecycle
UseUpdateProposalStatus to move a proposal through its lifecycle, GetSettlementProposalById to fetch proposal details by ID, and CancelSettlement to cancel a settlement before execution.UpdateProposalStatus is operator-only and is described CancelSettlement as available to the buyer or seller before settlement execution.
This is the lifecycle-management part of the service and is the section to document for operational controls, dispute handling, and manual intervention flows.
Endpoints:
| Endpoint | Use Сase |
|---|---|
UpdateProposalStatus | Update the proposal status to operator-only. |
GetSettlementProposalById | Fetch a settlement proposal by ID. |
CancelSettlement | Cancel a settlement before execution. |
Example flow
A typical settlement flow looks like this:- Open
SettlementStreamand complete the handshake. - Receive RFQ requests or settlement proposals from the server.
- Send preconfirmations and other settlement lifecycle messages as the flow progresses.
- Record outcomes and events through the unary recording endpoints when needed.
- Query status or proposal history through the history and lifecycle endpoints.
[liquidity_provider] is configured in agent.toml.