createMaker runs a maker: it delivers every open RFQ, publishes your quotes, and signs your answer to each
acceptance. It never broadcasts a vault transaction: the maker wallet sends those itself and pays the gas in
HYPE. Set up your maker first (Market making).
A minimal bot
examples/node-bot.mjs in the package is a
fuller version.
Quote
onRfq(handler, onError?)
Runs handler once per open RFQ per subscription, from both events and the snapshot.
- A restart or new subscription delivers the still-open RFQs again. Quoting again replaces your earlier quote, so it cannot double-fill.
- An RFQ with an acceptance waiting for you is held back, and offered again once you decline it or its
deadlinepasses on the venue clock. - An RFQ you filled, or one that ended, is never offered again.
onErrorreceives whatever the handler throws, and the RFQ can be offered again.
quote(rfq, { payout })
Publishes entry terms with the deployment’s fees and returns the quoteId. It starts the stream and waits
until it is live. After a truncated snapshot or a cursor resume, it first pages
List acceptances, which needs quote:read.
bid(rfq, { price })
Publishes sell_back terms when this maker backs the position. Otherwise it publishes transfer terms, paid from
the maker wallet’s own vault balance (Cash-outs).
cancelQuote(quoteId)
Removes a quote. ACCEPTED means you already confirmed it. While an acceptance of it waits for you, the venue
refuses with STATE_CONFLICT: decline the acceptance instead.
Answer acceptances
onAcceptance(handler, onError?)
Answers every pending acceptance once, with the handler’s CONFIRM or DECLINE. It signs only terms this maker
published that have not expired, and resends a lost answer byte for byte. onError receives what fails, with the
acceptance.
To answer one yourself, call confirm(acceptance, decision).
Remember what you published
The SDK only confirms quotes it knows this maker published. Pass apublished store backed by durable storage so
a restarted process can still confirm them. memoryPublished keeps them in memory only.
When an acceptance is waiting
While this maker has an unanswered acceptance on an RFQ that the SDK has already received,quote and bid
send nothing and throw AcceptancePendingError (code ACCEPTANCE_PENDING, with rfqId, quoteId and
deadline).
If the venue records an acceptance while a quote, bid or cancelQuote request is on its way, it refuses that
request with ApiError STATE_CONFLICT (retry REFRESH).
Either way, the acceptance still waits for you: answer it in onAcceptance.
Stay connected
Manage collateral
reduceCollateral requests the reduction, follows it, and returns { job, idempotencyKey, submitted }. With
signTransaction, it signs the certificate transaction and submits it. Without it, sign job.transaction
yourself and send it to Submit self-funded transaction
under the same idempotencyKey. Any wallet with HYPE can sign; the maker wallet works. It needs a key with the
maker collateral scopes.
See Maker collateral for what a reduction frees.
Onboard headless
A maker onboards and manages its keys from a wallet session, with no browser. Sign in with your Totalis account’s exported wallet and the Totalis app’s origin (Sign in with a wallet). A partner-admitted wallet signs in with its partner’s registered origin instead (Partner-admitted wallet).examples/onboard.mjs in the package runs every step below, and resumes if you rerun it.
Open the maker
Both take a client signed in as the account (a wallet session), not a maker key.
Issue the maker’s keys
QUOTING_BOT_SCOPES and COLLATERAL_SCOPES are the maker scope sets.
Give the quoting bot QUOTING_BOT_SCOPES, which move no vault money, and keep COLLATERAL_SCOPES on a separate
key for reductions.
