Skip to content

webhookPricer

webhookPricer(url, opts): Pricer

A pricer for bots and agents: the price comes from an HTTP endpoint that never touches ledger logic. It receives the request (pair, size, fees, notional) and answers { "wantAmount": "…" } or { "decline": true }; the SDK signs the quote and does everything after acceptance.

bound is the most we will pay out for a request (midBound gives one from the reference mid and our inventory; null declines): a webhook bug, or anyone between us and an http:// webhook, cannot make the SDK sign a quote above it.

Parameter Type
url string
opts { bound: (req) => bigint | null; timeoutMs?: number; settlement?: "solver_offer" | "user_offer"; }
opts.bound (req) => bigint | null
opts.timeoutMs? number
opts.settlement? "solver_offer" | "user_offer"

Pricer