Skip to main content

Network Identifiers

All methods use consistent network identifiers:
  • EVM networks: "ethereum:{chainId}"
  • Solana: "solana"
  • Hyperliquid Perps: "hypercore:perp"
  • Hyperliquid Spot: "hypercore:spot"

Supported EVM Chains


Native Tokens

Native tokens are handled slightly differently depending on the surface:
  • In some SDK methods (e.g., Swap quoting/executing), you omit fromToken / toToken for native tokens.
  • In config and position data, native assets are represented by a canonical “null address” per network.

Common Native Tokens

Note: EVM native tokens use the EIP-7528 canonical address (0xeeee...eeee). Allocation balances use these addresses. Some SDK methods (e.g., swap quoting) let you omit the token address for native tokens instead.

Amounts and Units

  • Amounts are typically strings and in the smallest unit for the given network
    • wei (EVM), lamports (Solana), etc.
    • Hyperliquid Exception: When placing orders or fetching data from Hyperliquid’s API, amounts will be formatted (e.g. $1.5 USDC would be “1.5”). You will also need to consider Hyperliquid’s restrictions on tick and lot sizing when placing orders.
  • Keep them as strings to preserve precision for large values.

Agent Context Properties

Core Methods

Memory

All memory methods default to session scope. Pass { shared: true } options object (TS) or shared=True (Python) to use agent-wide shared storage accessible across all sessions.

Swap (agent.swap)

Quote request fields: from, to, amount, fromToken?, toToken?, slippage?, engines? Execute fields: quoteData, expiresAt?

Custom Transactions

signAndSend fields (EVM): network, request.toAddress, request.data, request.value signAndSend fields (Solana): network, request.hexTransaction

Hyperliquid (agent.platforms.hyperliquid)

placeOrder fields: coin, side, size, price, market, type: "market", reduceOnly?, postOnly?: false, message?, idempotencyKey?, expiresAt?. Agent orders are immediate only; resting and trigger orders are rejected. positions fields: dex? to filter positions for a specific builder DEX (for example "xyz", "cash", or "vntl"). Omit it to fetch positions across the default venue and supported builder DEXes. The currently supported builder DEX set is "xyz", "cash", and "vntl", and unsupported builder DEX names are rejected. Coins: Perps use "BTC", builder DEX perps use "xyz:GOLD", "cash:GOLD", or "vntl:MAG7" (currently xyz, cash, and vntl are supported; unsupported builder DEX prefixes are rejected), spot uses the live listing pair name - bridged majors are Unit assets with a U prefix ("UBTC/USDC", "UETH/USDC", "USOL/USDC"; Hyperliquid-native tokens are plain: "HYPE/USDC") - never "BTC/USDC", which does not exist. Account model: Circuit Hyperliquid accounts are unified - one USDC balance collateralizes spot and perp trading alike, so there is no spot↔perp balance transfer. Deposited USDC is immediately usable for both; just place orders. The allocation’s collateral balance is total collateral (includes locked margin, excludes unrealized PnL); equity = collateral + Σ positions’ unrealizedPnlUsd; free margin ≈ equity − Σ marginUsed.

Polymarket (agent.platforms.polymarket)

marketOrder fields: tokenId, side, spendUsd (BUY) / shares (SELL), idempotencyKey?, expiresAt? redeemPositions fields: tokenIds (required, non-empty - filter your positions for isRedeemable first), idempotencyKey? Amounts are unit-explicit: a BUY takes spendUsd (USD to spend), a SELL takes shares (shares to sell) - the mismatched field fails validation. Finding the tokenId: searchEvents(query) (specific names, not category words; check moreEvents for buried matches) → eventMarkets(slug) (the ONLY authority on which markets exist - search never shows totals/spreads/props) → pick the most liquid market matching the intent → the outcome’s tokenId. Full guide: Polymarket → Getting Token IDs.

Kraken (agent.platforms.kraken)

Spot trading on the Kraken exchange, authorized by a connected exchange credential - never an API key/secret. The session’s selected credential is agent.credentials.kraken, a ready-made credentialRef = { kind: "exchange", id }. See Kraken for full detail. placeOrder fields: credentialRef, order (pair, side, type: "limit", volume, price), validate?, idempotencyKey?, expiresAt?. Limit orders only - market orders are rejected (allocation enforcement meters volume x price); use a marketable limit for immediate fills. Pairs: venue-namespaced, e.g. "KRAKEN:XBT/USD" (the concatenated "KRAKEN:XBTUSD" also works; responses return the concatenated form). Enabled pairs: XBT/ETH/SOL x USD/USDC. Sell minimums are 0.0001 XBT / 0.01 ETH / 0.1 SOL; fee-safe buy minimums are 0.000102 XBT / 0.0102 ETH / 0.102 SOL. A per-order notional cap also applies. Amounts are strings. Spot only - margin/leverage/withdrawals are out of scope.

Common Transaction Parameters

expiresAt is accepted by suggestion-producing manual-mode methods such as swap.execute, placeOrder, and marketOrder. Transaction confirmation is handled automatically server-side - the server waits for onchain confirmation and returns success: false with an error message if a transaction reverts. idempotencyKey is accepted by Polymarket marketOrder and redeemPositions and Hyperliquid placeOrder and deleteOrder in auto mode. SDKs generate it automatically; provide a stable key only when retrying the same logical action after a process restart.

Response Pattern

Every method returns:
Always check success before using data. See Error Handling for patterns.