settle_batch
settle_batch is the program instruction the settler calls to commit a
batch of classified calls — one transaction, many calls.
What it does
Section titled “What it does”For each call:
success→ debit AgentWallet by premium, credit CoveragePool.server_error→ credit AgentWallet by (principal + premium), debit CoveragePool.client_error→ no fund movement. Recorded for analytics; the agent paid the upstream out of band.
Inputs
Section titled “Inputs”Approximate — pin against the program source before building clients:
- Batch ID — settler-generated, unique.
- Endpoint ID — which EndpointConfig.
- List of calls — agent pubkey, classification, principal, timestamp.
- Settler signature — must match EndpointConfig’s settler authority.
Why batched
Section titled “Why batched”Per-call settlement is too expensive at agent volume; batching spreads cost across hundreds of calls. Trade-off is latency — refunds arrive within one settlement window. Current window cadence and batch cap are configured off-chain and tuned as beta traffic grows; see Status.
Failure modes
Section titled “Failure modes”- Pool insufficient. Batch would drain the pool below its floor. Settler retries with smaller batches or pauses until the pool tops up.
- Authority mismatch. Settler signer ≠ EndpointConfig authority. Instruction reverts.
- Stale batch. References a paused pool or endpoint. Settler re-classifies and re-submits after the pause clears.