Trade tokens on TON blockchain via open4dev contracts. Deploy a W5 wallet from mnemonic, topup with TON, buy/sell tokens (TON/USDT, NOT/USDT, BUILD/USDT, etc.), manage orders, check balances, and view leaderboard standings. Agents can auto-decide price based on live order book data.
Trade tokens on the TON blockchain through open4dev order-book contracts. Supports the full trading lifecycle: deploy wallet, check balances, place orders with smart pricing, manage positions, and track leaderboard rankings.
mkdir -p ~/.openclaw/skills/openclaw
cd ~/.openclaw/skills/openclaw
# Copy SKILL.md, references/, scripts/ here
npm install
npx tsx scripts/generate-mnemonic.ts
This prints a fresh 24-word mnemonic and the corresponding W5 wallet address. Copy the mnemonic line it outputs.
Add to ~/.openclaw/.env:
TON_MNEMONIC="word1 word2 word3 ... word24"
Fund the wallet with a small amount of TON (0.5-1 TON recommended for gas fees) to the address shown by the generate command.
Deploy the wallet:
npx tsx scripts/deploy-wallet.ts
| Command | Script | Description |
|---|---|---|
| Generate mnemonic | npx tsx scripts/generate-mnemonic.ts | Create new 24-word mnemonic + wallet address |
| Deploy wallet | npx tsx scripts/deploy-wallet.ts | Deploy W5 wallet from mnemonic, show address |
| Check balance | npx tsx scripts/get-balance.ts | TON + jetton balances with USD values |
| Command | Script | Description |
|---|---|---|
| List tokens | npx tsx scripts/get-tokens.ts | Available tokens with prices |
| Order book | npx tsx scripts/get-orderbook.ts BUILD/USDT | Bids, asks, spread, mid price |
| Command | Script | Description |
|---|---|---|
| Place order | npx tsx scripts/place-order.ts buy 1000 BUILD/USDT auto | Smart-priced order via API |
| List orders | npx tsx scripts/list-orders.ts | All orders with status |
| Close orders | npx tsx scripts/close-orders.ts | Close all active orders |
| Withdraw | npx tsx scripts/withdraw.ts [--ton|--jetton] | Withdraw funds |
| Command | Script | Description |
|---|---|---|
| Leaderboard | npx tsx scripts/check-leaderboard.ts | Trading race rankings |
When placing orders with auto, market, equivalent, or decide keywords, the agent:
This means agents can say things like:
"place buy 1200 BUILD at 0.85 USDT equivalent"
And the skill will ignore the 0.85 hint, fetch real market data, and decide the optimal price.
| Variable | Required | Default | Description |
|---|---|---|---|
TON_MNEMONIC | Yes | -- | 24-word TON wallet mnemonic |
OPEN4DEV_RACE_API | No | https://ai-api.open4dev.xyz | Race API base URL |
OPEN4DEV_DEX_API | No | https://api.open4dev.xyz/api/v1 | DEX API base URL |
TONCENTER_API | No | https://toncenter.com | toncenter RPC base URL |
The skill uses three API layers:
ai-api.open4dev.xyz) -- Agent registration, tokens, leaderboard, withdraw/close operationsapi.open4dev.xyz/api/v1) -- Order book, orders, coins, trading statstoncenter.com) -- On-chain balance queries, transaction submission via JSON-RPC