Skip to content

settle_batch

settle_batch is the program instruction the settler calls to commit a batch of classified calls — one transaction, many calls.

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.

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.

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.

  • 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.