Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Building a Trading Bot

Building a trading bot

A trading bot on SYMMIO's HyperEVM deployment runs an automated strategy that opens, monitors, and closes positions with no human in the loop. The deployment runs SYMMIO contract core v0.8.5, and you build against it with the Trading SDK rather than assembling raw contract transactions and hand-rolled solver calls.

Pick your entry point based on what the bot looks like. If it's headless (Node/TypeScript), @symmio/trading-core gives you typed contract calls, solver REST clients, subgraph reads, and price and notification WebSockets. If it has a dashboard or UI, @symmio/trading-react layers hooks and a provider on top of wagmi and TanStack Query. Either way, a throwaway session key from @symmio/session-key signs the trading hot path, so your main wallet key is used once during setup and never touches the loop.

Scope: the Trading SDK currently supports HyperEVM (chain 999) only. On HyperEVM your solver counterparty is Enigma (0x76bc5889c0cfcC20960b0D81F541595d81a95122). If you're building for another SYMMIO chain (Base, Arbitrum, Mantle, BNB, and others), the SDK does not apply yet; use the manual implementation guide instead.

The account model

Every bot works with three actors. The Owner EOA is your wallet; it signs the one-time setup in Part 1 and nothing else. A SubAccount is an isolated on-chain account under your EOA that holds collateral and is used to open positions. When you trade, the protocol spins up Virtual Accounts (VAs) according to the SubAccount's isolation type: one per position, per market, or per market and direction, depending on the SubAccountIsolationType you chose at creation. The VA, not the SubAccount, is the on-chain owner of a position, so closes and TP/SL are signed against the VA. Passing the SubAccount where a VA belongs is an easy authorization mistake to make.

What the SDK collapses

The underlying protocol still does the same handful of things: create a SubAccount, fund it, delegate authority to your session key, then trade against the Enigma solver. The SDK turns each of those from a hand-built transaction into one typed call.

npm install @symmio/trading-core @symmio/session-key
# add @symmio/trading-react if your bot has a UI

What's in this section

  • Part 1: One-time on-chain setup covers creating and funding a SubAccount, then delegating to a session key.

  • Part 2: Trading covers opening, monitoring, closing, and attaching TP/SL, all signed by the session key.

  • Code examples has a complete runnable bot and links to the SDK's reference app.

Last updated