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.state 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. An entry quote
stops being acceptable at accept_before, 14 seconds before expiry (unix seconds), which sends no event. A
cash-out quote leaves the list 22 seconds before its expiry.
Accept
Sign the quote’sentry 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. With funding, an ACCEPTED acceptance also carries
fund_by, 2 seconds after the confirm. Judge deadline and fund_by against server_time, not your clock.
Funding
If your free vault balance is short of the stake, addfunding to the accept. The vault draws exactly
the shortfall in the same transaction as the trade. It needs funding:deposit.
value is the stake minus VAULT_FREE in Get balances,
signed as USDC ReceiveWithAuthorization from your wallet to the vault. kind is always WALLET. Sign
valid_after at or before now and valid_before no earlier than the quote’s expiry, at most 900 seconds apart. If
you bridge USDC from HyperCore to fund it, send the bridge only after the accept returns ACCEPTED and before
fund_by. 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
The position’s ID is the
quote_id you accepted:
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 and the quote carries sell_back terms:
sell_back as SellBack, then accept it like an entry quote, with no funding. On COMMITTED the
position closes (POSITION_CLOSED, close_reason: 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 computes it.
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.
