Loading...
Loading...
Execute Solana token trades - market orders, limit/pending orders, copy trading, and order management. Use when user wants to "buy tokens", "sell tokens", "place order", "cancel order", "check order status", "copy trade", "follow wallet", or execute any trading operation.
npx skill4agent add ben-alph-ai/crypto-trading-api trading-executiondex_cookieauth-helper# Set your cookie (get from browser after login at www.alph.ai)
export ALPH_DEX_COOKIE="your_dex_cookie_value_here"
# Use in requests as Cookie header:
Cookie: dex_cookie=${ALPH_DEX_COOKIE}https://b.alph.aisol| Endpoint | Method | Purpose |
|---|---|---|
| GET | Pre-trade validation |
| POST | Place market order |
| POST | Batch create orders |
| POST | Query orders (paginated) |
| POST | Batch query orders |
| POST | Order statistics |
| GET | Get base currencies |
| POST | Query order fees |
| Endpoint | Method | Purpose |
|---|---|---|
| POST | Create limit order |
| POST | Update limit order |
| POST | Cancel limit order |
| POST | Cancel all limit orders |
| POST | Batch create orders + limit orders |
| POST | Query limit orders (paginated) |
| POST | Query specific limit order |
| Endpoint | Method | Purpose |
|---|---|---|
| POST | Create copy trade |
| POST | Update copy trade |
| POST | Stop copy trade |
| POST | Pause copy trade |
| POST | Resume copy trade |
| POST | Query copy trades |
| POST | Copy trade profit |
| POST | Copy trade stats |
| POST | Default copy trade params |
| Endpoint | Method | Purpose |
|---|---|---|
| GET | Get buy order settings |
| GET | Get buy settings v2 |
| GET | Get sell order settings |
| GET | Get sell settings v2 |
| POST | Update sell settings |
| GET | Advanced trade settings |
| GET | Top trade settings |
| GET | Auto slippage config |
| GET | Auto fee settings |
curl -s "https://b.alph.ai/smart-web-gateway/order/pre-check?chain=sol&token={token_address}" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"{
"code": "200",
"data": {
"check": true
}
}{
"questions": [{
"question": "Confirm trade details?",
"header": "Trade",
"multiSelect": false,
"options": [
{
"label": "Confirm",
"description": "Buy 1 SOL worth of BONK at market price"
},
{
"label": "Cancel",
"description": "Cancel this trade"
},
{
"label": "Modify",
"description": "Change trade parameters"
}
]
}]
}curl -s -X POST "https://b.alph.ai/smart-web-gateway/order/create" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{
"chain": "sol",
"token": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"type": "buy",
"amount": "1"
}'{
"code": "200",
"msg": "success",
"data": {}
}curl -s -X POST "https://b.alph.ai/smart-web-gateway/order/query/page" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{
"chain": "sol",
"page": 1,
"pageSize": 10
}'idclientOrderIdchainbuyCointokenCoincurl -s -X POST "https://b.alph.ai/smart-web-gateway/pending/order/create" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{
"chain": "sol",
"token": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"type": "buy",
"amount": "1",
"price": "0.00000005"
}'{
"code": 200,
"msg": "success",
"orderVo": {
"id": 12345,
"chain": "sol",
"clientOrderId": "...",
"buyCoin": "SOL",
"tokenCoin": "BONK"
}
}curl -s -X POST "https://b.alph.ai/smart-web-gateway/pending/order/cancel" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{
"orderId": 12345
}'curl -s -X POST "https://b.alph.ai/smart-web-gateway/pending/order/cancelAll" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{
"chain": "sol"
}'curl -s -X POST "https://b.alph.ai/smart-web-gateway/pending/order/query/page" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{
"chain": "sol",
"page": 1,
"pageSize": 10
}'curl -s -X POST "https://b.alph.ai/smart-web-gateway/follow/order/create" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{
"chain": "sol",
"wallet": "2jJfuPMN3R3Se5c8y7BdeiQDJMKv9wms1z1wG14xJH4H"
}'# Pause
curl -s -X POST "https://b.alph.ai/smart-web-gateway/follow/order/pause" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{"orderId": 12345}'
# Resume
curl -s -X POST "https://b.alph.ai/smart-web-gateway/follow/order/resume" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{"orderId": 12345}'
# Stop
curl -s -X POST "https://b.alph.ai/smart-web-gateway/follow/order/stop" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{"orderId": 12345}'# Query copy trades
curl -s -X POST "https://b.alph.ai/smart-web-gateway/follow/order/query/page" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{"page": 1, "pageSize": 10}'
# Get profit
curl -s -X POST "https://b.alph.ai/smart-web-gateway/follow/order/profit" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{}'
# Get statistics
curl -s -X POST "https://b.alph.ai/smart-web-gateway/follow/order/statistic" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{}'curl -s -X POST "https://b.alph.ai/order/orderFee" \
-H "Content-Type: application/json" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}" \
-d '{"chain": "sol", "token": "..."}'platformFeeRatemaxPriorityFeemaxSlippageminUsdtantiMevUser: "Buy 1 SOL worth of BONK"
Agent steps:
1. Get BONK price from market-data (currentPrice endpoint)
2. Check holder stats for red flags
3. Run order/pre-check
4. Show confirmation with AskUserQuestion:
"Confirm trade:
- Buy: ~13.4B BONK (~1 SOL)
- Price: 0.0000000747 SOL per BONK
- Platform: Raydium (Solana)
- Fee: Check with orderFee API
Proceed?"
5. If confirmed, call order/create
6. Query order status
7. Display result| Code | Message | Solution |
|---|---|---|
| 200 | success | Normal response |
| 400 | Bad request | Check parameters |
| 401 | Unauthorized | Token expired, re-authenticate |
| 403 | Insufficient balance | User needs more SOL |
| 500 | sys error | Server issue, retry |
{
"code": "403",
"msg": "Insufficient balance",
"errorDetail": {
"key": "value"
}
}User: "Buy 1 SOL worth of BONK"
Steps:
1. Get BONK address and current price
2. Run pre-check
3. Show confirmation
4. Execute order/create
5. Query status
6. Display resultsUser: "Buy BONK when price drops to 0.00000005 SOL"
Steps:
1. Create pending order with target price
2. Confirm order placed
3. Explain: "Order will execute when BONK hits target price"User: "Follow this smart wallet: 2jJfuPMN3R..."
Steps:
1. Look up wallet via smart/wallet endpoint (market-data skill)
2. Show wallet stats (PnL, win rate)
3. Confirm with user
4. Create follow order
5. Explain copy trade settingsUser: "Cancel all my pending orders"
Steps:
1. Query pending orders first
2. Show list to user
3. Confirm cancellation
4. Call cancelAll
5. Confirm result