usdc.address in Get deployment). Totalis pays
the gas.
Open a position
- Subscribe to the account channel and wait for the snapshot.
- Create RFQ.
- Collect
QUOTE_CREATEDevents. - Sign one quote and accept it.
- Follow
OPERATION_UPDATEDuntilCOMMITTED.
Create RFQ
Legs go in strictly ascendingoutcome_id order. Two or more legs make a combo; an RFQ also takes one leg.
Which markets can be a leg
Every market from List markets and Get market says whether it can be a Combo leg now. A market can be a leg when both hold:combo.reason is one of:
Show a market’s price as its
chance, never its value. value is the raw book midpoint, so an
empty book reads 50 cents. A chance of null means the market has no price. Don’t estimate a
Combo’s payout by multiplying leg prices: legs can be related, and the quote is the price.
These fields change with the clock, the book and the market’s state, so read them close to the RFQ. A market can
trade alone while combo.status is CLOSED. A one-leg RFQ checks the same fields.
Which legs combine
A Combo holds at most one leg per question. Outcomes of one question sharenative_question_id
(Get market). A standalone market has none and
combines with anything. The leg count is on Limits.
An accepted RFQ can still get no quote: each maker prices the legs and can decline.
Collect quotes
EachQUOTE_CREATED carries one quote:
payout is what the position pays if every leg wins. QUOTE_REMOVED names a quote that left. Every listed quote
can be accepted. Totalis keeps a quote’s terms fresh while it is listed, so a maker’s quote can come back under a
new quote_id, with QUOTE_REMOVED for the old one.
Accept
Sign the quote’ssigning.entry terms as TakerAccept (Signing).
The Idempotency-Key becomes the acceptance_id: choose it before the first send and reuse it on every
retry.
Read later, an acceptance can also be
FILLED or FAILED. Responses carry no clocks, so you never compare
against the venue’s clock.
Funding
The accept body is onlytaker_signature; a funding field is refused with 400 INVALID_REQUEST. If your free
vault balance is short of the stake, the venue draws the shortfall from your wallet’s USDC approval to
WalletAccept, in the same transaction as the trade. Set the approval once with a gasless permit
(Create wallet approval); every entry then draws
what it needs until it is spent. The venue draws only your account’s linked wallet, and only under a session or a
key with funding:deposit. It never draws the wallet for a cash-out.
If the approval or the wallet’s USDC doesn’t cover the shortfall, the trade fails: the operation’s
reason is INSUFFICIENT_CASH, and the acceptance’s reason says which part fell short, INSUFFICIENT_APPROVAL or
INSUFFICIENT_WALLET_USDC. A short approval fails at once. Missing wallet USDC is waited for at least 6 seconds
from the accept’s arrival. So if you bridge USDC from HyperCore to fund the entry, send the bridge once the accept
returns ACCEPTED, and within 4 seconds of sending the accept. WALLET_FUNDING_UPDATED reports the funding’s
progress.
Lost response
Resend the identical request with the sameIdempotency-Key. Or read
Get acceptance: a 404 means no accept was admitted;
cancel the RFQ and read once more. A 404 after the cancel
is final. Never accept the same quote under a second key.
Follow the fill
An entry’s
position_id is its accepted quote_id:
Cash out
Cash out position opens a cash-out RFQ on anOPEN position you own. The body is an empty JSON object, {}.
QUOTE_CREATED, from the maker that backs the position. kind is SELL_BACK, price is what the maker pays, and the terms to sign sit under signing.sell_back:
signing.sell_back as SellBack, then accept it like an entry quote. A cash-out never draws your wallet. On
COMMITTED the position closes (POSITION_CLOSED, and the position’s reason is SELL_BACK), and the proceeds land in your vault balance:
price less the profit fee on the part above the position’s net_stake,
floor((price - net_stake) * fee_bps / 10000), with no fee when price is at or below net_stake
(Limits and fees). The SDK’s netCashout(bid, position) computes it from the
bid and the position of Get position.
Settlement
Automatic. Totalis settles every resolved position, then claims a win into your vault balance. Nothing to call or sign.SETTLED_UNCLAIMED is the short wait between the two.
Each leg’s result is
result_numerator / result_denominator. The position pays its payout times the
product of its legs’ results.
