This guide walks you through the full integration path, meaning that by the end, you’ll have a working adapter, a list of available markets, and order submissions functional and verifiable (via the Hyperliquid exchange).Documentation Index
Fetch the complete documentation index at: https://docs.outcome.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Create and initialize the adapter
Import The adapter automatically connects to the correct Hyperliquid testnet endpoints for both REST and WebSocket traffic. Switch to
createHIP4Adapter and call initialize() to warm up the event cache. Every other SDK method depends on this step completing first.{ testnet: false } when you’re ready for mainnet.Fetch markets
Call
fetchMarkets() to retrieve live prediction markets. The response is an array of typed market objects - each one carries pre-computed side identifiers, expiry dates, and outcome metadata.defaultBinary markets are recurring price binary markets (e.g. “Will BTC be above $69,070 at expiry?”). You can also filter by "labelledBinary" or "multiOutcome", or omit the type filter to get all markets.Set up authentication
Trading requires an approved ephemeral agent key. The agent key signs orders on your behalf without exposing your main wallet’s private key. The approval flow is a one-time operation per agent.After
initAuth() completes, the adapter signs all subsequent orders automatically using the agent key.Place a limit order
With auth initialized, call
hip4.trading.placeOrder() to submit a limit order. The method returns a result object - it never throws.getMinShares(markPx) computes the minimum number of shares required to meet the 10 USDH notional floor at the given price. Passing markPx to placeOrder enables the SDK to validate this before signing and submitting.Next steps
- Read the core concepts to understand market types, coin naming, and the two signing flows.
- See the trading guide for market orders, cancellations, and builder fee configuration.
- Explore the real-time data guide to subscribe to live order books and price streams.