skills/opentrade/opentrade-gateway/SKILL.md
This skill should be used when the user asks to 'broadcast transaction', 'send tx', 'estimate gas', 'simulate transaction', 'check tx status', 'track my transaction', 'get gas price', 'gas limit', 'broadcast signed tx', or mentions broadcasting transactions, sending transactions on-chain, gas estimation, transaction simulation, tracking broadcast orders, or checking transaction status. Covers gas price, gas limit estimation, transaction simulation, transaction broadcasting, and order tracking across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, and 20+ other chains. Do NOT use for swap quote or execution — use opentrade-dex-swap instead. Do NOT use for general programming questions about transaction handling.
npx skillsauth add 6551team/openskills opentrade-gatewayInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
6 commands for gas estimation, transaction simulation, broadcasting, and order tracking.
Every time before running any opentrade command, always follow these steps in order. Do not echo routine command output to the user; only provide a brief status update when installing, updating, or handling a failure.
Confirm installed: Run which opentrade. If not found, install it:
curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
If the install script fails, ask the user to install manually following the instructions at: https://github.com/6551Team/openskills
Check for updates: Read ~/.opentrade/last_check and compare it with the current timestamp:
cached_ts=$(cat ~/.opentrade/last_check 2>/dev/null || true)
now=$(date +%s)
cached_ts is non-empty and (now - cached_ts) < 43200 (12 hours), skip the update and proceed.curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
If a newer version is installed, tell the user and suggest updating their opentrade skills from https://github.com/6551Team/openskills to get the latest features.If any opentrade command fails with an unexpected error during this
session, try reinstalling before giving up:
curl -sSL https://raw.githubusercontent.com/6551Team/openskills/main/skills/opentrade/install.sh | sh
Find or create a .env file in the project root to override the default API credentials, Load it before performing opentrade operations.
OPEN_TOKEN=your_token_here
Get your API token at: https://6551.io/mcp
Security warning: Never commit .env to git (add it to .gitignore) and never expose credentials in logs, screenshots, or chat messages.
IMPORTANT: If the user has not specified a trading router, you MUST first discover available routers:
opentrade trade routers
Response format:
{
"ok": true,
"data": [
{
"api": "v2",
"created_at": "2026-03-10 01:15:42",
"is_active": true,
"name": "6551dex test",
"quota_reward": 0,
"trader": "6551dex",
"updated_at": "2026-03-10 01:15:42"
},
{
"api": "v1",
"created_at": "2026-03-03 21:24:34",
"is_active": true,
"name": "okx test",
"quota_reward": 0,
"trader": "okx",
"updated_at": "2026-03-03 21:24:34"
}
]
}
Usage:
trader and api from the responseopentrade commands in this session MUST include --trader <trader> and --api <api> flagsopentrade gateway gas --chain ethereum --trader okx --api v1--trader okx --api v1opentrade-dex-swapopentrade-marketopentrade-tokenopentrade-portfolioopentrade-gateway)# Get current gas price on XLayer
opentrade gateway gas --chain xlayer
# Estimate gas limit for a transaction
opentrade gateway gas-limit --from 0xYourWallet --to 0xRecipient --chain xlayer
# Simulate a transaction (dry-run)
opentrade gateway simulate --from 0xYourWallet --to 0xContract --data 0x... --chain xlayer
# Broadcast a signed transaction
opentrade gateway broadcast --signed-tx 0xf86c...signed --address 0xYourWallet --chain xlayer
# Track order status
opentrade gateway orders --address 0xYourWallet --chain xlayer --order-id 123456789
The CLI accepts human-readable chain names and resolves them automatically.
| Chain | Name | chainIndex |
|---|---|---|
| XLayer | xlayer | 196 |
| Solana | solana | 501 |
| Ethereum | ethereum | 1 |
| Base | base | 8453 |
| BSC | bsc | 56 |
| Arbitrum | arbitrum | 42161 |
| # | Command | Description |
|---|---|---|
| 1 | opentrade gateway chains | Get supported chains for gateway |
| 2 | opentrade gateway gas --chain <chain> | Get current gas prices for a chain |
| 3 | opentrade gateway gas-limit --from ... --to ... --chain ... | Estimate gas limit for a transaction |
| 4 | opentrade gateway simulate --from ... --to ... --data ... --chain ... | Simulate a transaction (dry-run) |
| 5 | opentrade gateway broadcast --signed-tx ... --address ... --chain ... | Broadcast a signed transaction |
| 6 | opentrade gateway orders --address ... --chain ... | Track broadcast order status |
This skill is the final mile — it takes a signed transaction and sends it on-chain. It pairs with swap (to get tx data).
User: "Swap 1 ETH for USDC and broadcast it"
1. opentrade-dex-swap opentrade swap swap --from ... --to ... --amount ... --chain ethereum --wallet <addr>
↓ user signs the tx locally
2. opentrade-gateway opentrade gateway broadcast --signed-tx <signed_hex> --address <addr> --chain ethereum
↓ orderId returned
3. opentrade-gateway opentrade gateway orders --address <addr> --chain ethereum --order-id <orderId>
Data handoff:
tx.data, tx.to, tx.value, tx.gas from swap → user builds & signs → --signed-tx for broadcastorderId from broadcast → --order-id param in orders queryUser: "Simulate this transaction first, then broadcast if safe"
1. opentrade gateway simulate --from 0xWallet --to 0xContract --data 0x... --chain ethereum
↓ simulation passes (no revert)
2. opentrade gateway broadcast --signed-tx <signed_hex> --address 0xWallet --chain ethereum
3. opentrade gateway orders --address 0xWallet --chain ethereum --order-id <orderId>
User: "Check gas, swap for USDC, then send it"
1. opentrade gateway gas --chain ethereum → check gas prices
2. opentrade-dex-swap opentrade swap swap --from ... --to ... --chain ethereum --wallet <addr>
↓ user signs
3. opentrade gateway broadcast --signed-tx <signed_hex> --address <addr> --chain ethereum
4. opentrade gateway orders --address <addr> --chain ethereum --order-id <orderId>
opentrade gateway gasopentrade gateway gas-limitopentrade gateway simulateopentrade gateway broadcastopentrade gateway ordersopentrade gateway chains--chain xlayer, low gas, fast confirmation) as the default, then ask which chain the user prefers--signed-tx → remind user to sign the transaction first (this CLI does NOT sign)List all chains supported by the gateway.
opentrade gateway chains
Output:
{
"code": "0",
"data": [
{ "chainId": "196", "chainName": "XLayer" },
{ "chainId": "1", "chainName": "Ethereum" },
{ "chainId": "501", "chainName": "Solana" }
],
"msg": ""
}
Display to user:
Get current gas price for a specific chain.
opentrade gateway gas --chain <chain_name>
Parameters:
--chain: Chain name (e.g., xlayer, ethereum, solana)Example:
opentrade gateway gas --chain xlayer
Output:
{
"code": "0",
"data": [
{
"chainId": "196",
"eip1559Protocol": {
"suggestBaseFee": "100000000",
"proposePriorityFee": "0"
},
"normal": {
"maxFeePerGas": "100000000",
"baseFee": "100000000",
"gasPrice": "100000000",
"priorityFeePerGas": "0"
},
"fast": {
"maxFeePerGas": "100000000",
"baseFee": "100000000",
"gasPrice": "100000000",
"priorityFeePerGas": "0"
},
"slow": {
"maxFeePerGas": "100000000",
"baseFee": "100000000",
"gasPrice": "100000000",
"priorityFeePerGas": "0"
}
}
],
"msg": ""
}
Display to user:
100000000 wei = 0.1 GweiEstimate the gas limit required for a transaction.
opentrade gateway gas-limit \
--from <sender_address> \
--to <recipient_address> \
--chain <chain_name> \
[--value <amount_in_wei>] \
[--data <hex_data>]
Parameters:
--from: Sender wallet address (required)--to: Recipient address (required)--chain: Chain name (required)--value: Amount to send in wei (optional, default: 0)--data: Transaction data in hex format (optional, default: 0x)Example:
opentrade gateway gas-limit \
--from 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb \
--to 0x1234567890abcdef1234567890abcdef12345678 \
--chain xlayer \
--value 1000000000000000000
Output:
{
"code": "0",
"data": [
{
"gasLimit": "21000"
}
],
"msg": ""
}
Display to user:
21000gasLimit × gasPriceSimulate a transaction before broadcasting (dry-run).
opentrade gateway simulate \
--from <sender_address> \
--to <recipient_address> \
--chain <chain_name> \
[--value <amount_in_wei>] \
[--data <hex_data>] \
[--gas-limit <limit>] \
[--gas-price <price_in_wei>]
Parameters:
--from: Sender wallet address (required)--to: Recipient address (required)--chain: Chain name (required)--value: Amount to send in wei (optional, default: 0)--data: Transaction data in hex format (optional, default: 0x)--gas-limit: Gas limit (optional)--gas-price: Gas price in wei (optional)Example:
opentrade gateway simulate \
--from 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb \
--to 0x1234567890abcdef1234567890abcdef12345678 \
--chain xlayer \
--value 1000000000000000000 \
--gas-limit 21000 \
--gas-price 100000000
Output (Success):
{
"code": "0",
"data": [
{
"executionResult": {
"used": 21000,
"success": true,
"gasLimit": 21000,
"gasUsed": 21000
}
}
],
"msg": ""
}
Output (Failure):
{
"code": "0",
"data": [
{
"executionResult": {
"used": 0,
"success": false,
"error": "execution reverted: insufficient balance"
}
}
],
"msg": ""
}
Display to user:
success: true: "Simulation successful! Gas used: 21000"success: false: "Simulation failed: [error message]"Broadcast a signed transaction to the blockchain.
opentrade gateway broadcast \
--signed-tx <signed_transaction_hex> \
--address <sender_address> \
--chain <chain_name>
Parameters:
--signed-tx: Signed transaction in hex format (EVM) or base58 (Solana) (required)--address: Sender wallet address (required)--chain: Chain name (required)Example (EVM):
opentrade gateway broadcast \
--signed-tx 0xf86c808504a817c800825208941234567890abcdef1234567890abcdef12345678880de0b6b3a764000080820a96a0... \
--address 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb \
--chain xlayer
Example (Solana):
opentrade gateway broadcast \
--signed-tx 4hXTCkRzt9WyecNzV1XPgCDfGAZzQKNxLXgynz5QDuWWPSAZBZSHptvWRL3BjCvzUXRdKvHL2b7yGrRQcWyaqsaBCncVG7BFggS8w9snUts67BSh3EqKpXLUm5UMHfD7ZBe9GhARjbNQMLJ1QD3Spr6oMTBU6EhdB4RD8CP2xUxr2u3d6fos36PD98XS6oX8TQjLpsMwncs5DAMiD4nNnR8NBfyghGCWvCVifVwvA8B8TJxE1aHwYbgByseGmZJYDUSi5McBJdm7f9YY9d8FU7XMWoLM1gCWmoL92aPQuGHafb \
--address YourSolanaWalletAddress \
--chain solana
Output:
{
"code": "0",
"data": [
{
"orderId": "123456789",
"txHash": "0xabc123def456..."
}
],
"msg": ""
}
Display to user:
Query the status of a broadcast transaction by order ID.
opentrade gateway orders \
--address <wallet_address> \
--chain <chain_name> \
--order-id <order_id>
Parameters:
--address: Wallet address (required)--chain: Chain name (required)--order-id: Order ID from broadcast response (required)Example:
opentrade gateway orders \
--address 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb \
--chain xlayer \
--order-id 123456789
Output:
{
"code": "0",
"data": [
{
"orderId": "123456789",
"txHash": "0xabc123def456...",
"txStatus": "2",
"chainId": "196",
"blockNumber": "12345678",
"timestamp": "1709876543"
}
],
"msg": ""
}
Transaction Status Codes:
0: Pending (not yet confirmed)1: Failed (transaction reverted or rejected)2: Success (confirmed on-chain)Display to user:
User says: "What's the gas price on XLayer?"
opentrade gateway gas --chain xlayer
# → Display: Normal: 0.1 Gwei, Fast: 0.1 Gwei, Slow: 0.1 Gwei
User says: "How much gas do I need to send 1 ETH?"
opentrade gateway gas-limit \
--from 0xYourWallet \
--to 0xRecipient \
--chain ethereum \
--value 1000000000000000000
# → Display: Gas limit: 21000, Estimated cost: ~0.002 ETH ($5.50)
User says: "Simulate this transaction before I send it"
opentrade gateway simulate \
--from 0xYourWallet \
--to 0xContract \
--chain xlayer \
--data 0xa9059cbb... \
--gas-limit 100000
# → Display: Simulation successful! Gas used: 65432
User says: "Broadcast this signed transaction"
opentrade gateway broadcast \
--signed-tx 0xf86c...signed \
--address 0xYourWallet \
--chain xlayer
# → Display:
# Transaction broadcast! Order ID: 123456789
# Tx Hash: 0xabc...def
User says: "Check the status of my broadcast order"
opentrade gateway orders --address 0xYourWallet --chain xlayer --order-id 123456789
# → Display:
# Order 123456789: Success (txStatus=2)
# Tx Hash: 0xabc...def
# Confirmed on-chain
--signed-tx format matches the chain.opentrade gateway chains first to verify.⚠️ Service is not available in your region. Please switch to a supported region and try again.--signed-tx is broadcast twice, the API may return an error or the same txHash — handle idempotently.18.5 Gwei), never raw wei21000, 145000)1.5 ETH), never base unitseip1559Protocol.suggestBaseFee + proposePriorityFee for EIP-1559 chains, normal for legacyethereum → 1, solana → 501)development
Twitter/X data via the 6551 API. Supports user profiles, tweet search, user tweets, follower events, deleted tweets, and KOL followers.
tools
This skill should be used when the user asks to 'create a custodial wallet', 'create a managed wallet', 'get my wallet address', 'show my custodial account', 'custodial swap', 'swap with managed wallet', 'withdraw from custodial wallet', 'withdraw BNB', 'withdraw SOL', 'send native tokens from custodial wallet', or mentions creating, managing, swapping, or withdrawing with a custodial (managed/hosted) wallet. Only supports BSC and Solana networks. Do NOT use for non-custodial wallet operations, general balance queries (use opentrade-portfolio), or swap quotes without custodial execution (use opentrade-dex-swap).
development
This skill should be used when the user asks to 'find a token', 'search for a token', 'look up PEPE', 'what's trending', 'top tokens', 'trending tokens on Solana', 'token rankings', 'who holds this token', 'holder distribution', 'token market cap', 'token liquidity', 'research a token', 'tell me about this token', 'token info', or mentions searching for tokens by name or address, discovering trending tokens, viewing token rankings, checking holder distribution, or analyzing token market cap and liquidity. Covers token search, metadata, market cap, liquidity, volume, trending token rankings, and holder analysis across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, and 20+ other chains. Do NOT use when the user says only a single generic word like 'tokens' or 'crypto' without specifying a token name, action, or question. For simple current price checks, price charts, candlestick data, or trade history, use opentrade-market instead. For meme token safety analysis, developer reputation, rug pull checks, bundle/sniper detection, or finding tokens by same creator, use opentrade-market instead.
development
This skill should be used when the user asks to 'check my wallet balance', 'show my token holdings', 'how much OKB do I have', 'what tokens do I have', 'check my portfolio value', 'view my assets', 'how much is my portfolio worth', 'what\'s in my wallet', or mentions checking wallet balance, total assets, token holdings, portfolio value, remaining funds, DeFi positions, or multi-chain balance lookup. Supports XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, and 20+ other chains. Do NOT use for general programming questions about balance variables or API documentation. Do NOT use when the user is asking how to build or integrate a balance feature into code.