The HIP-4 SDK exposes four share-conversion methods on the trading adapter. They settle directly against your spot balances at the protocol mint price - no orderbook, no slippage, no spread paid. See the Converting tokens concept page for the underlying bundle equivalences. All four methods use L1 agent signing, the same authority asDocumentation Index
Fetch the complete documentation index at: https://docs.outcome.xyz/llms.txt
Use this file to discover all available pages before exploring further.
placeOrder. Authenticate once with auth.initAuth, then call any conversion method.
Setup
hip4.trading.splitOutcome, hip4.trading.mergeOutcome, hip4.trading.mergeQuestion, and hip4.trading.negateOutcome. Each returns a WalletActionResult:
result.success.
Split: USDH → Yes + No
splitOutcome burns X USDH and mints X Yes + X No of one outcome. Use it when you want exposure to both sides of an outcome, or to seed paired shares before a negate.
outcome field is the numeric outcome ID (matches market.outcomeId on a fetched market). The amount is a decimal string - the SDK strips trailing zeros to match Hyperliquid’s wire format.
Merge outcome: Yes + No → USDH
mergeOutcome is the inverse of split - burn X Yes + X No of one outcome and mint X USDH. Use it to recover collateral from a paired position.
amount: null to merge the maximum available - the protocol will burn min(yes_balance, no_balance) shares automatically:
Merge question: full Yes-bundle → USDH
mergeQuestion burns X Yes shares from every outcome of a question (named outcomes plus the fallback) and mints X USDH. Useful when you hold the full bundle and want to redeem before settlement - the bundle is already worth exactly 1 USDH by the bundle equivalence.
mergeOutcome, amount: null redeems the maximum - min(yes_balance) across every outcome of the question:
question field is the question ID. For multi-outcome and price-bucket markets, this is market.questionId. For default-binary markets (which have no parent question), mergeQuestion doesn’t apply - use mergeOutcome instead.
Negate: No → Yes of every other outcome
negateOutcome burns X No shares of one outcome and mints X Yes shares of every other outcome in the same question (including the fallback). “I don’t think this wins” becomes “I think one of the others wins” without touching the book.
The on-wire sub-key is
negateOutcome (matching Hyperliquid’s testnet
“Convert Outcomes” UI). Hyperliquid’s docs body shows negateQuestion in
places - that’s a typo. The SDK uses the correct key.Error handling
All four methods return aWalletActionResult and never throw. Common error cases:
success: true, the conversion settled and your spot balances now reflect the new shares. There’s no fill price to inspect - conversions don’t fill against the book.
Putting it together: lock in profit on a Yes bundle
You hold100 Yes shares across every outcome of question 42 - a full bundle worth exactly 1 USDH each by equivalence. Instead of waiting for settlement, redeem now:
null redeems 80 - the protocol enforces the bundle constraint automatically.
See also
- Trading adapter reference - full parameter and return-type specs
- Converting tokens concept - the bundle equivalences behind these primitives
- Authentication - the agent key flow that conversions share with
placeOrder