Settlement
Use this page after a write returns an ExecutionHandle and you need to know when that operation is finished — for example, when to stop a loading spinner.
If the handle is already confirmed or failed, you are done — refresh your UI from the read APIs. Otherwise call settlement.track with handle.id until the status is confirmed or failed.
You poll status. You do not run bridges, hops, or plan steps yourself — Nutrimatic does that. You only sign what your WalletAdapter is asked to sign.
Multi-step and cross-ledger plans are part of the contract shape; today’s documented ledger is Infinite Mainnet (EVM). Tracking an existing id is a status read on that execution — it does not start a new write.
Signing across steps
A multi-step path may require more than one signature. The SDK calls WalletAdapter.sign again when a later step needs it (purpose may be 'settlement' or the write’s purpose). Your adapter should treat each SignRequest independently — sign what is asked, or reject with USER_REJECTED. You never submit steps yourself.
Polling
While status is still running (pending, submitted, or in_progress):
- Call
settlement.track(handle.id)on an interval you choose (many UIs use ~1–2s; back off if you see repeatedINFRASTRUCTURE_UNAVAILABLE). - Stop when
confirmedorfailed. - If you get
CAPABILITY_NOT_AVAILABLE, stop and show the error — do not keep polling.
Status vocabulary
Handle, settlement, and each plan step use the same status values — ExecutionStatus:
| Status | Meaning | Done? |
|---|---|---|
pending | Accepted, not submitted yet | No |
submitted | In flight on the first (or only) step | No |
in_progress | A multi-step plan is advancing — see steps | No |
confirmed | Success | Yes |
failed | Failure | Yes |
Stop polling when status is confirmed or failed.
| Flow | Statuses you usually see |
|---|---|
| Single-step write (same ledger) | pending → submitted → confirmed | failed |
| Multi-step plan | pending → submitted → in_progress → confirmed | failed |
When to call settlement.track
| Situation | What you do |
|---|---|
Handle is already confirmed or failed | Use the handle; refresh reads on success |
Handle is pending, submitted, or in_progress | Poll settlement.track(handle.id) until confirmed or failed |
Quote included a path | Expect tracking after swap — poll until confirmed or failed even if the first handle looks early |
Overview of the write flow: Write operations.
settlement.track
const status = await sdk.settlement.track(handle.id)Parameters
| Field | Type | Description |
|---|---|---|
id | string | The id from the ExecutionHandle returned by the write (easy.swap, liquidity.*, approve, stake, farm, …). |
Returns — SettlementStatus
| Field | Type | Description |
|---|---|---|
id | string | Same execution id you passed in. |
status | ExecutionStatus | Overall status. Stop when confirmed or failed. |
path | Path | Optional. The ordered plan when there is more than one step. Same shape as on a quote — for your UI only. |
steps | SettlementStepStatus[] | Optional. Progress per step when a plan is running. Present when status is in_progress, or when the plan has more than one step. |
updatedAt | number | Optional. Unix time in milliseconds of the last status update. |
Each entry in steps:
| Field | Type | Description |
|---|---|---|
index | number | Zero-based position in path.steps (same order). |
status | ExecutionStatus | Status of this step only. |
ledger | LedgerId | Optional. Canonical ledger for this step when it is ledger-scoped. |
txRef | string | Optional. Transaction reference for this step when available. |
Rules
- Overall
statusis the source of truth for “am I done?”. Do not infer completion from a single step. - When both
pathandstepsare present,steps[i]describespath.steps[i]. pathon settlement matches the plan for this execution. It may echo the quote’spath; treat either as UI context, not as something you execute.- A failed overall status means the execution failed — show failure and stop. You do not retry individual steps through the SDK.
Example response (plan still running; first step confirmed):
{
"id": "exec_01HZY…",
"status": "in_progress",
"updatedAt": 1719799300000,
"path": {
"steps": [
{
"instrumentId": "evm:421018:instrument:42",
"venueId": "evm:421018:amm:v2:0xabc123",
"ledger": "evm:421018"
},
{
"instrumentId": "evm:421018:instrument:usdt",
"venueId": "evm:421018:amm:v2:0xdef456",
"ledger": "evm:421018"
}
]
},
"steps": [
{
"index": 0,
"status": "confirmed",
"ledger": "evm:421018",
"txRef": "0xabc…"
},
{
"index": 1,
"status": "submitted",
"ledger": "evm:421018"
}
]
}Path
A Path is Nutrimatic’s ordered plan when a quote or execution is not a single pool hop — for example several hops on one ledger, or steps that touch more than one ledger.
You may see it on:
| Where | Role |
|---|---|
Quote.path | Preview of the plan before you swap |
SettlementStatus.path | Same plan while you track the execution |
Integrator contract
- Read-only for your UI (progress, labels, which assets/venues are involved).
- You never submit, reorder, or skip steps.
- Presence of
pathon a quote means you should plan to callsettlement.trackafter the write until status isconfirmedorfailed. - Absence of
pathusually means a single-step route — you may still needsettlement.trackif the handle is still running.
interface PathStep {
readonly instrumentId: InstrumentId
readonly venueId?: VenueId
readonly ledger?: LedgerId
}
interface Path {
readonly steps: readonly PathStep[]
}| Field | Type | Description |
|---|---|---|
steps | PathStep[] | Ordered plan. Index 0 is first. |
steps[].instrumentId | InstrumentId | Instrument this step is about (catalog id). |
steps[].venueId | VenueId | Optional. Pool/venue when the step is venue-scoped. |
steps[].ledger | LedgerId | Optional. Canonical ledger when the step is ledger-scoped (never an alias). |
Example (two hops):
{
"steps": [
{
"instrumentId": "evm:421018:instrument:42",
"venueId": "evm:421018:amm:v2:0xabc123",
"ledger": "evm:421018"
},
{
"instrumentId": "evm:421018:instrument:usdt",
"venueId": "evm:421018:amm:v2:0xdef456",
"ledger": "evm:421018"
}
]
}Errors
| Code | Meaning |
|---|---|
CAPABILITY_NOT_AVAILABLE | Tracking is not available for this config or request. Do not retry as if it were a timeout. |
INFRASTRUCTURE_UNAVAILABLE | Nutrimatic could not complete the status read. Retry later or check connectivity. |
Other failures may be specific to the tracked id. See Errors — When to use which code.