Orderly onboarding

From Starchild-ai-agent/official-skills · View interactive version

Orderly onboarding is an AI agent skill from the GitHub repository Starchild-ai-agent/official-skills. Orderly Network onboarding: omnichain perps infra, MCP server, SDK and CLI quickstart. Also indexes executed Orderly fills into Starchild trade analytics. Use when starting on Orderly (e.g. install Orderly MCP, set up the DEX template, integrate the React SDK, use the orderly CLI), and after executi

How to use this skill

Skill file

Orderly Network: Agent Onboarding

Orderly is an omnichain orderbook-based trading infrastructure providing perpetual futures liquidity for decentralized exchanges. This skill is your starting point for building on or learning about Orderly Network.

When to Use

What is Orderly Network

Orderly is a combination of an orderbook-based trading infrastructure and a robust liquidity layer offering perpetual futures orderbooks. Unlike traditional platforms, Orderly doesn't have a front end—it operates at the core of the ecosystem, providing essential services to projects built on top.

Key Characteristics:

Primary Use Cases:

| Use Case | Description |

| --------------------- | -------------------------------------------------------------------------- |

| Builders/DEXes | Create your own Perps DEX on EVM and Solana with plug-and-play SDKs |

| Perps Aggregators | Access Orderly's shared liquidity directly via API or SDK |

| Trading Desks | Use APIs for CEX-level trading with low latency orderbook |

| Trading Bots | Connect to orderbook for best rates, SL/limit orders, gasless transactions |

Key Advantages

Architecture

Your Application (DEX, Bot, Wallet, Aggregator)

Getting Started: AI Agent Tools

To build on Orderly, install the MCP server for the best development experience. It provides 8 powerful tools for documentation search, SDK patterns, contract addresses, workflows, and API reference.

MCP Server (Recommended)

The MCP server provides AI assistants with instant access to Orderly documentation, code patterns, and API references.

Quick Install:

npx @orderly.network/mcp-server init --client <client>

Supported Clients:

| Client | Command | Config File |

| ----------- | ------------------- | ---------------------- |

| Claude Code | --client claude | .mcp.json |

| Cursor | --client cursor | .cursor/mcp.json |

| VS Code | --client vscode | .vscode/mcp.json |

| Codex | --client codex | ~/.codex/config.toml |

| OpenCode | --client opencode | .opencode/mcp.json |

Manual Configuration:

If automatic setup doesn't work, add this configuration to your AI client:

Claude Code (.mcp.json):

{
  "mcpServers": {
    "orderly": {
      "command": "npx",
      "args": ["@orderly.network/mcp-server@latest"]
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "orderly": {
      "command": "npx",
      "args": ["@orderly.network/mcp-server@latest"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "orderly": {
      "command": "npx",
      "args": ["@orderly.network/mcp-server@latest"]
    }
  }
}

OpenCode (.opencode/mcp.json):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "orderly": {
      "type": "local",
      "command": ["npx", "@orderly.network/mcp-server@latest"],
      "enabled": true
    }
  }
}

Codex (~/.codex/config.toml):

[mcp_servers.orderly]
command = "npx"
args = ["@orderly.network/mcp-server@latest"]

What the MCP Server Provides:

| Tool | Description |

| -------------------------- | ------------------------------------------------ |

| search_orderly_docs | Search Orderly documentation for specific topics |

| get_sdk_pattern | Get code examples for SDK v2 hooks and patterns |

| get_contract_addresses | Lookup smart contract addresses for any chain |

| explain_workflow | Step-by-step guides for common tasks |

| get_api_info | REST API and WebSocket endpoint documentation |

| get_indexer_api_info | Trading metrics, events, volume statistics |

| get_component_guide | React UI component building guides |

| get_orderly_one_api_info | DEX creation and management API for Orderly One |

Agent Skills

Install Orderly skills to enhance your AI agent with procedural knowledge for building on Orderly.

Install all skills globally (recommended):

npx skills add OrderlyNetwork/skills --all --agent '*' -g

Install all skills locally:

npx skills add OrderlyNetwork/skills --all

Install specific skills:

# List available skills
npx skills add OrderlyNetwork/skills --list

# Install specific skill
npx skills add OrderlyNetwork/skills --skill orderly-trading-orders

# Install multiple skills
npx skills add OrderlyNetwork/skills --skill orderly-api-authentication --skill orderly-trading-orders

# Install for specific agent
npx skills add OrderlyNetwork/skills --all --agent claude-code -g

Global vs Local:

Available Skills:

| Category | Skill | Description |

| ------------------ | -------------------------------- | --------------------------------------------------- |

| API / Protocol | orderly-api-authentication | Two-layer auth: EIP-712 (EVM) + Ed25519 (Solana) |

| | orderly-trading-orders | Place, manage, cancel orders via REST API or SDK |

| | orderly-positions-tpsl | Monitor positions, TP/SL, leverage, PnL |

| | orderly-websocket-streaming | Real-time WebSocket for orderbook and executions |

| | orderly-deposit-withdraw | Token deposits, withdrawals, cross-chain operations |

| SDK / React | orderly-sdk-react-hooks | Reference for all React SDK hooks |

| | orderly-ui-components | Pre-built React UI components |

| | orderly-sdk-install-dependency | Install Orderly SDK packages |

| | orderly-sdk-dex-architecture | Complete DEX project structure and setup |

| | orderly-sdk-page-components | Pre-built page components |

| | orderly-sdk-theming | CSS variable theming and customization |

| | orderly-sdk-trading-workflows | End-to-end trading flows |

| Platform | orderly-sdk-wallet-connection | Wallet integration for EVM and Solana |

| | orderly-sdk-debugging | Debug/troubleshoot SDK errors |

| | orderly-one-dex | Create/manage custom DEX with Orderly One API |

For Builders (SDK & DEX Development)

Build custom trading interfaces using Orderly's React SDK v2.

Fastest Way to Get Started (Default for DEX Creation)

Fork the DEX Template to get a working DEX in minutes.

⚠️ CRITICAL FOR AGENTS — NEVER try to build a DEX by installing @orderly.network/cli:

- @orderly.network/cli is a terminal trading tool for placing perp orders, NOT a DEX builder or scaffolding CLI. Installing it pulls keytar (native C++ build via node-gyp), which will OOM-kill (SIGKILL / 137) 1GB sandboxes.

- Zero-install DEX deployment: The official DEX template requires NO heavy installs on the agent box. Fork OrderlyNetwork/dex-template to the user's GitHub, configure .env, and let GitHub Actions build and deploy it directly to GitHub Pages for free (or deploy to Vercel/Netlify).

  1. Fork the repository OrderlyNetwork/dex-template to your GitHub account (or user's GitHub via Composio/gh)
  2. Configure .env with your broker ID (VITE_ORDERLY_BROKER_ID) and name (VITE_ORDERLY_BROKER_NAME)
  3. Customize your theme in app/styles/theme.css with orderly-sdk-theming (pure CSS custom properties, no build step needed)
  4. Complete the required one-time GitHub settings after forking (see template README / AGENTS.md):

(Without these permissions, GitHub Actions will not run and auto-deployment will fail.)

  1. Push to main — GitHub Actions builds via GitHub-hosted runner and publishes to https://<user>.github.io/<repo>/

This template uses the components SDK — pre-built page components that work out of the box with less customization. For full control over individual components, use the MCP server and load SDK skills (especially orderly-sdk-react-hooks and orderly-sdk-ui-components) for hooks-level development.

Core SDK Packages:

Package Manager: Prefer pnpm add (or yarn add) over npm install — pnpm uses ~⅓ the peak memory during dependency resolution, avoiding memory pressure in resource-constrained container environments.

# Full DEX setup (prefer pnpm)
pnpm add @orderly.network/react-app \
         @orderly.network/trading \
         @orderly.network/portfolio \
         @orderly.network/markets \
         @orderly.network/wallet-connector \
         @orderly.network/i18n

# Required: EVM wallet support
pnpm add @web3-onboard/injected-wallets @web3-onboard/walletconnect

# Required: Solana wallet support
pnpm add @solana/wallet-adapter-base @solana/wallet-adapter-wallets

Key Components Available:

Orderly One (White-Label DEX):

Launch your own branded perpetuals DEX without building from scratch. Orderly One provides a turnkey solution with:

Load these skills for SDK development:

For API / Bot Developers

Integrate directly with Orderly's REST API and WebSocket streams.

API Base URLs:

| Network | URL |

| ------- | --------------------------------- |

| Mainnet | https://api.orderly.org |

| Testnet | https://testnet-api.orderly.org |

WebSocket URLs:

| Network | URL |

| ------- | --------------------------------- |

| Mainnet | wss://ws.orderly.org/ws |

| Testnet | wss://testnet-ws.orderly.org/ws |

Authentication:

Symbol Format:

PERP_<TOKEN>_USDC

Examples: PERP_ETH_USDC, PERP_BTC_USDC, PERP_SOL_USDC

Key Endpoints:

Load these skills for API development:

Orderly CLI (Terminal Trading Only — NOT for DEX Building)

A terminal trading tool (@orderly.network/cli) wrapping the Orderly REST API for CLI-based trading.

⚠️ Memory Warning: Do NOT install @orderly.network/cli in resource-constrained environments (≤1GB RAM). It depends on keytar which triggers native C++ compilation (node-gyp) and will OOM-kill the container. For trading or onboarding via agent, prefer Orderly REST API or the hosted MCP server (https://mcp.orderly.network).

Install & Quick Start (Testnet, local machines with >2GB RAM only):

npm install -g @orderly.network/cli
orderly wallet-create --type EVM --network testnet
orderly wallet-register --broker-id demo --network testnet
orderly faucet-usdc <address> --chain-id 421614 --network testnet
orderly wallet-add-key --network testnet
orderly auth-list --network testnet
orderly order-place PERP_ETH_USDC BUY MARKET 0.01 --account <id> --network testnet

Note: --account is required for authenticated commands (get IDs via auth-list). Hex IDs must be shell-quoted. Default network is testnet — pass --network mainnet for production. Linux requires libsecret.

Broker IDs

Supported Chains

Orderly supports multiple EVM and non-EVM chains. To get the current list of supported networks with their chain IDs, vault addresses, and RPC endpoints:

GET https://api.orderly.org/v1/public/chain_info

This endpoint returns all mainnet and testnet chains currently supported by Orderly, including Arbitrum, Optimism, Base, Ethereum, Polygon, Mantle, Solana, Sei, Avalanche, BSC, Abstract, and more.

$ORDER Token

The $ORDER token is central to the Orderly ecosystem:

Token Contracts:

| Network | Address |

| ---------------- | ---------------------------------------------- |

| Ethereum (ERC20) | 0xABD4C63d2616A5201454168269031355f4764337 |

| EVM Chains (OFT) | 0x4E200fE2f3eFb977d5fd9c430A41531FB04d97B8 |

| Solana | ABt79MkRXUsoHuV2CVQT32YMXQhTparKFjmidQxgiQ6E |

For full tokenomics details, visit: https://orderly.network/docs/introduction/tokenomics

Key Links

| Resource | URL | Notes |

| --------------------- | ---------------------------------------------------------------------- | ---------------------------------------------- |

| Documentation | https://orderly.network/docs | |

| SDK Repository | https://github.com/orderlynetwork/js-sdk | |

| DEX Template | https://github.com/OrderlyNetwork/dex-template | Fastest start, uses components SDK |

| MCP Server (npm) | https://www.npmjs.com/package/@orderly.network/mcp-server |

| CLI (npm) | https://www.npmjs.com/package/@orderly.network/cli |

| Skills (npm) | https://www.npmjs.com/package/@orderly.network/skills |

| Skills.sh | https://skills.sh |

| DEX Dashboard | https://dex.orderly.network |

| Orderly App | https://app.orderly.network |

| Discord | https://discord.gg/OrderlyNetwork |

| Twitter | https://twitter.com/OrderlyNetwork |

Recommended Next Steps

If you're building a DEX:

  1. Fork the DEX Template for the fastest start
  2. Install MCP server: npx @orderly.network/mcp-server init
  3. Configure your broker settings in .env and customize your theme
  4. For more control, load orderly-sdk-install-dependency and orderly-sdk-dex-architecture to build from scratch
  5. Set up wallet connection with orderly-sdk-wallet-connection

If you're building trading bots or API integrations:

  1. Load orderly-api-authentication first
  2. Install MCP server for API reference
  3. Load orderly-trading-orders and orderly-websocket-streaming

If you want to trade from the terminal or use the CLI:

  1. Install the CLI: npm install -g @orderly.network/cli
  2. Run orderly --help to see all commands
  3. Follow the testnet quick start (6 commands, see Orderly CLI section above)
  4. Use --broker-id demo for testing, or get a custom broker ID at dex.orderly.network ($10, manual browser interaction required)

If you're launching a white-label DEX:

  1. Install MCP server for Orderly One API tools: npx @orderly.network/mcp-server init
  2. Load orderly-one-dex skill for DEX creation and management workflows
  3. Load orderly-sdk-theming skill to understand theme structure for API updates

If you're troubleshooting:

  1. Load orderly-sdk-debugging
  2. Use MCP server to search documentation

For testing:

Common Issues

"Where do I start building?"

For a quick DEX: Fork the DEX Template, configure .env, and deploy. Uses pre-built components — fastest path.

For more control: Install the MCP server first: npx @orderly.network/mcp-server init --client <your-client>, then load SDK skills like orderly-sdk-react-hooks and orderly-sdk-dex-architecture to build with the hooks SDK.

Then ask: "How do I connect to Orderly Network?" or load orderly-sdk-wallet-connection.

"What's the difference between MCP server and Skills?"

Use both for the best experience.

"How do I test without real funds?"

Use the Testnet environment:

"Do I need to handle authentication manually?"

The SDK handles authentication automatically. For API-only integration, load orderly-api-authentication for the complete auth flow.

"How do I get a custom broker ID?"

Go to dex.orderly.network, select the "Custom API integration" option, and follow the steps. It costs $10. This requires manual browser interaction and cannot be done via CLI or agent. For testing and development, use --broker-id demo — no setup needed.

Related Skills

API / Protocol

SDK / React

Platform

Trade Indexing (Starchild Agents)

Starchild indexes Orderly fills into trade_events via

POST {AI_AGENT_API_URL}/v1/trade-events (same pipeline as hyperliquid /

polymarket / DEX skills). Two layers — use both:

| Layer | Who | What it covers |

|---|---|---|

| Realtime (this skill) | Agent, after each Orderly trade | Confirmed agent-initiated fills |

| Central daily Public Info scan | Platform cron (~10:30 Asia/Hong_Kong) | Agent EVM + personal/login EVM wallets (~thousands of addresses); catch-up / third-party wallets |

The private ed25519 /v1/trades endpoint alone is not enough for

platform analytics — API-key / SDK trading often binds to the **user's

personal wallet**, not the agent Privy wallet. Always record the wallet

that actually executed the trade.

Critical: `wallet_address` = execution wallet

When reporting, set wallet_address to the address that holds the Orderly

account / signed the order — not always the agent Privy wallet.

| Situation | wallet_address value |

|---|---|

| Trade via agent Privy wallet | agent EVM address from wallet service |

| Trade via user's own / third-party wallet (API key, SDK, broker UI) | that third-party 0x… address |

| Sync script with override | --address 0x… or ORDERLY_WALLET_ADDRESS |

Wrong address → volume mis-attributed or dropped from agent analytics.

Realtime report after every Orderly trade (required)

After any successful Orderly order / fill (SDK, CLI, REST, or a future trading

skill), fire-and-forget report. Never block or fail the trade on reporting

errors.

One call, zero follow-up. This is a plain HTTP POST — no LLM call, no extra

turn. Do not verify that the report landed, do not retry it, and do

not mention it to the user unless it raises. The server dedupes, so a

duplicate send is harmless and a lost one is picked up by the daily scan.

from scripts._trade_report import report_trade_events
# or: copy the same helper used by hyperliquid / other trading skills

report_trade_events([{
    "source": "orderly",                 # realtime skill/agent report
    "venue": "orderly:<broker>",         # e.g. orderly:woofi_pro
    "event_type": "fill",                # or "order" if not yet filled
    "wallet_address": execution_wallet,  # MUST be the wallet that traded
    "account_id": orderly_account_id,    # Orderly account_id if known
    "symbol": "PERP_ETH_USDC",
    "side": "buy",                       # buy | sell
    "price": "2500.1",
    "size": "0.5",
    "notional_usd": "1250.05",
    "fee": "0.12",
    "fee_currency": "USDC",
    "order_id": str(order_id),
    "dedupe_key": f"orderly:{account_id}:{trade_id}",  # stable unique
    "occurred_at": "2026-07-15T12:00:00Z",             # ISO8601 UTC
    "raw": {"trade_id": trade_id, "broker": broker},
}])

dedupe_key convention (server unique on (user_id, dedupe_key)):

id/trade_id/match_id, and all such fills would collapse onto one

dedupe_key. trade_sync.py falls back to

synthetic_trade_id(ts_ms, symbol, side, price, size) (sha1-derived).

Calling from a short-lived script (cron, one-shot sync)? Pass

report_trade_events(events, blocking=True). The default background thread is

a daemon and is killed when the process exits, so the POST never leaves the

machine. Long-lived agent processes keep the default non-blocking mode. Batches

larger than 500 events are split automatically.

Source tags used in analytics:

| source | Meaning | Tier |

|---|---|---|

| orderly | Realtime agent/skill report | Confirmed |

| orderly_sync | This script, private /v1/trades | Confirmed |

| orderly_public_sync | This script, Public Info API | Reference (esp. third-party) |

| backfill:agent_wallet | Platform daily Public Info (agent) | Attributable |

| backfill:login_wallet | Platform daily Public Info (login) | Reference |

Historical / catch-up sync script

pip install pynacl base58   # one-time
# Agent wallet (default)
python3 scripts/trade_sync.py --broker woofi_pro --days 90
# User's third-party / login wallet that actually trades on Orderly
python3 scripts/trade_sync.py --address 0xUserWallet --broker woofi_pro --days 90
# Force zero-auth Public Info (no private key needed)
python3 scripts/trade_sync.py --address 0xUserWallet --public-only

Env override (same as --address): ORDERLY_WALLET_ADDRESS=0x…

What the script does (idempotent):

  1. Resolves execution wallet: --address → ORDERLY_WALLET_ADDRESS → agent EVM.
  2. Looks up Orderly account for that address + broker (registers only when the

address is the agent wallet and can EIP-712-sign).

  1. If a read-scope ed25519 key is available for that account → private

GET /v1/trades. Agent wallets can mint a read key via AddOrderlyKey;

third-party wallets only use an existing key file (agent cannot sign for

another wallet).

  1. Else falls back to Public Info POST /v1/public/query {type:trades,address}

(zero auth) — covers third-party wallets without keys.

  1. Maps fills with wallet_address=<execution wallet> and

dedupe_key=orderly:<account_id|address>:<trade_id>, then fire-and-forget

reports to /v1/trade-events.

Keys are stored per account at workspace/.orderly_key_<account_prefix>.json

(mode 600). Safe to schedule daily; server-side dedupe prevents double-count

against both this script and the platform Public Info cron.

**After any trade you execute on Orderly, either call report_trade_events

immediately (preferred) or run this sync** so the fill is indexed. Reporting

must never block or fail trading.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.