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

Network IDChain
ethereum:1Ethereum Mainnet
ethereum:10Optimism
ethereum:56BNB Smart Chain
ethereum:100Gnosis
ethereum:137Polygon
ethereum:146Sonic
ethereum:8453Base
ethereum:42161Arbitrum One
ethereum:43114Avalanche
ethereum:59144Linea
ethereum:11155111Sepolia (testnet)

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

NetworkTokenAddress
ethereum:1ETH0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:10ETH0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:56BNB0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:100xDAI0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:137POL (formerly MATIC)0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:146S0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:8453ETH0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:42161ETH0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:43114AVAX0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ethereum:59144ETH0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
solanaSOL11111111111111111111111111111111
hypercore:perpUSDC (Perps)USDC (startingAsset) / 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee (positions)
Note: EVM native tokens use the EIP-7528 canonical address (0xeeee...eeee). Position data from currentPositions / getCurrentPositions() uses 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

PropertyTypeDescription
sessionIdnumberUnique session identifier
sessionWalletAddressstringWallet address for this session
currentPositionsCurrentPosition[]Assets allocated at execution start
executionModestring"auto" or "manual"

Core Methods

Method (TS)Method (Python)Description
log(message, options?)log(message, error=False, debug=False)Send log messages. error: true for error logs, debug: true for console-only.
getCurrentPositions()get_current_positions()Get live positions with pending tx status
transactions()transactions()Get transaction history for the session
clearSuggestedTransactions()clear_suggested_transactions()Clear pending manual mode suggestions

Memory

Method (TS)Method (Python)Description
memory.set(key, value)memory.set(key, value)Store a string value
memory.get(key)memory.get(key)Retrieve a value (returns { value } in data)
memory.delete(key)memory.delete(key)Delete a key
memory.list()memory.list()List all keys

Swap and Bridge (agent.swidge)

Method (TS)Method (Python)Description
swidge.quote(request)swidge.quote(request)Get swap/bridge quote with routing
swidge.execute(quoteData)swidge.execute(quote_data)Execute a quote (or array of quotes)
Quote request fields: from, to, amount, fromToken?, toToken?, slippage? Execute fields: quoteData, expiresAt?

Custom Transactions

Method (TS)Method (Python)Description
signAndSend(request)sign_and_send(request)Sign and broadcast a transaction
signMessage(request)sign_message(request)Sign a message (EVM only, EIP-191/712)
signAndSend fields (EVM): network, request.toAddress, request.data, request.value, request.gas?, request.maxFeePerGas?, request.maxPriorityFeePerGas?, request.enforceTransactionSuccess?, message?, expiresAt? signAndSend fields (Solana): network, request.hexTransaction, message?, expiresAt?

Hyperliquid (agent.platforms.hyperliquid)

Method (TS)Method (Python)Description
placeOrder(request)place_order(request)Place a perp or spot order
balances()balances()Get perp account value + spot balances
positions(dex?)positions(dex=None)Get open perpetual positions; pass a builder DEX name to filter by venue
order(orderId)order(order_id)Get order info by ID
deleteOrder(orderId, symbol)delete_order(order_id, symbol)Cancel an order
openOrders()open_orders()Get all open orders
orders()orders()Get historical orders
orderFills()order_fills()Get fill history
transfer(request)transfer(request)Transfer between spot and perp accounts
liquidations(startTime?)liquidations(start_time?)Get liquidation events
placeOrder fields: symbol, side, size, price, market, type?, triggerPrice?, reduceOnly?, postOnly?, expiresAt? 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. Symbols: 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 "BTC/USDC".

Polymarket (agent.platforms.polymarket)

Method (TS)Method (Python)Description
marketOrder(request)market_order(request)Buy or sell prediction market shares
redeemPositions(request?)redeem_positions(request?)Redeem settled positions
marketOrder fields: tokenId, size, side, expiresAt? redeemPositions fields: tokenIds? Size meaning: BUY = USD to spend, SELL = shares to sell.

Common Transaction Parameters

expiresAt is accepted by all transactional methods. 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.
ParameterTypeDescription
expiresAtstring | nullISO 8601 expiry for suggestions in manual mode. If omitted, no time-based expiry (suggestions are auto-cleared at each run start).

Response Pattern

Every method returns:
{
  success: boolean;
  data?: any;       // present on success
  error?: string;   // present on failure
}
Always check success before using data. See Error Handling for patterns.