trading-execution
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTrading Execution (Solana)
Solana代币交易执行
Execute Solana token trades including market orders, limit/pending orders, copy trading, and order management.
执行Solana代币交易,包括市价单、限价/挂单、跟单交易及订单管理。
Overview
概述
This skill helps you:
- Place market buy/sell orders on Solana DEXs
- Create and manage limit/pending orders
- Set up copy trading (follow smart wallets)
- Query order history and statistics
- Configure buy/sell order settings
本技能可帮助您:
- 在Solana DEX上挂市价买入/卖出订单
- 创建并管理限价/挂单
- 设置跟单交易(追踪智能钱包)
- 查询订单历史与统计数据
- 配置买入/卖出订单设置
Authentication Required
需身份验证
All trading operations require authentication. See skill for setup.
dex_cookieauth-helperbash
undefined所有交易操作均需身份验证。请查看技能了解设置方法。
dex_cookieauth-helperbash
undefinedSet your cookie (get from browser after login at www.alph.ai)
设置您的cookie(登录www.alph.ai后从浏览器获取)
export ALPH_DEX_COOKIE="your_dex_cookie_value_here"
export ALPH_DEX_COOKIE="your_dex_cookie_value_here"
Use in requests as Cookie header:
在请求中作为Cookie头使用:
Cookie: dex_cookie=${ALPH_DEX_COOKIE}
undefinedCookie: dex_cookie=${ALPH_DEX_COOKIE}
undefinedAPI Base URL
API基础URL
https://b.alph.aihttps://b.alph.aiImportant Notes
重要说明
- Solana Only: This platform supports Solana chain only. Chain parameter is always .
sol - All trading endpoints require authentication.
- Always confirm with user before executing trades.
- 仅支持Solana:本平台仅支持Solana链。链参数始终为。
sol - 所有交易端点均需身份验证。
- 执行交易前务必与用户确认。
Quick Reference
快速参考
Market Order Endpoints
市价单端点
| 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 |
| 端点 | 方法 | 用途 |
|---|---|---|
| GET | 交易前验证 |
| POST | 挂市价单 |
| POST | 批量创建订单 |
| POST | 查询订单(分页) |
| POST | 批量查询订单 |
| POST | 订单统计 |
| GET | 获取基础币种 |
| POST | 查询订单手续费 |
Pending/Limit Order Endpoints
限价/挂单端点
| 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 |
| 端点 | 方法 | 用途 |
|---|---|---|
| POST | 创建限价单 |
| POST | 更新限价单 |
| POST | 取消限价单 |
| POST | 取消所有限价单 |
| POST | 批量创建订单+限价单 |
| POST | 查询限价单(分页) |
| POST | 查询特定限价单 |
Copy Trading Endpoints
跟单交易端点
| 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 |
| 端点 | 方法 | 用途 |
|---|---|---|
| POST | 创建跟单交易 |
| POST | 更新跟单交易 |
| POST | 停止跟单交易 |
| POST | 暂停跟单交易 |
| POST | 恢复跟单交易 |
| POST | 查询跟单交易 |
| POST | 跟单交易收益 |
| POST | 跟单交易统计 |
| POST | 默认跟单交易参数 |
Order Configuration Endpoints
订单配置端点
| 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 |
| 端点 | 方法 | 用途 |
|---|---|---|
| GET | 获取买入订单设置 |
| GET | 获取买入设置v2 |
| GET | 获取卖出订单设置 |
| GET | 获取卖出设置v2 |
| POST | 更新卖出设置 |
| GET | 高级交易设置 |
| GET | 顶级交易设置 |
| GET | 自动滑点配置 |
| GET | 自动手续费设置 |
Trading Workflow
交易工作流
Step 1: Pre-Trade Check
步骤1:交易前检查
bash
curl -s "https://b.alph.ai/smart-web-gateway/order/pre-check?chain=sol&token={token_address}" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"Response:
json
{
"code": "200",
"data": {
"check": true
}
}bash
curl -s "https://b.alph.ai/smart-web-gateway/order/pre-check?chain=sol&token={token_address}" \
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"响应:
json
{
"code": "200",
"data": {
"check": true
}
}Step 2: Confirm Trade with User
步骤2:与用户确认交易
Use AskUserQuestion to confirm:
json
{
"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"
}
]
}]
}使用AskUserQuestion进行确认:
json
{
"questions": [{
"question": "确认交易详情?",
"header": "交易",
"multiSelect": false,
"options": [
{
"label": "确认",
"description": "以市价买入价值1 SOL的BONK"
},
{
"label": "取消",
"description": "取消本次交易"
},
{
"label": "修改",
"description": "更改交易参数"
}
]
}]
}Step 3: Place Market Order
步骤3:挂市价单
bash
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"
}'Response (success):
json
{
"code": "200",
"msg": "success",
"data": {}
}bash
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"
}'响应(成功):
json
{
"code": "200",
"msg": "success",
"data": {}
}Step 4: Query Order Status
步骤4:查询订单状态
bash
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
}'Response includes orders with: , , , , , status, amounts, etc.
idclientOrderIdchainbuyCointokenCoinbash
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
}'响应包含以下订单信息:、、、、、状态、金额等。
idclientOrderIdchainbuyCointokenCoinLimit/Pending Orders
限价/挂单
Create Limit Order
创建限价单
bash
curl -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"
}'Response:
json
{
"code": 200,
"msg": "success",
"orderVo": {
"id": 12345,
"chain": "sol",
"clientOrderId": "...",
"buyCoin": "SOL",
"tokenCoin": "BONK"
}
}bash
curl -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"
}'响应:
json
{
"code": 200,
"msg": "success",
"orderVo": {
"id": 12345,
"chain": "sol",
"clientOrderId": "...",
"buyCoin": "SOL",
"tokenCoin": "BONK"
}
}Cancel Limit Order
取消限价单
bash
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
}'bash
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
}'Cancel All Limit Orders
取消所有限价单
bash
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"
}'bash
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"
}'Query Limit Orders
查询限价单
bash
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
}'bash
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
}'Copy Trading (Follow Wallet)
跟单交易(追踪钱包)
Create Copy Trade
创建跟单交易
Follow a smart wallet to automatically copy their trades:
bash
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"
}'追踪智能钱包,自动复制其交易操作:
bash
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"
}'Manage Copy Trade
管理跟单交易
bash
undefinedbash
undefinedPause
暂停
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}'
-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/follow/order/pause"
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{"orderId": 12345}'
-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}'
-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/follow/order/resume"
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{"orderId": 12345}'
-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}'
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{"orderId": 12345}'
undefinedcurl -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}'
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{"orderId": 12345}'
undefinedQuery Copy Trade Stats
查询跟单交易统计
bash
undefinedbash
undefinedQuery 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}'
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{"page": 1, "pageSize": 10}'
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}'
-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 '{}'
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{}'
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 '{}'
-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 '{}'
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{}'
undefinedcurl -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 '{}'
-H "Content-Type: application/json"
-H "Cookie: dex_cookie=${ALPH_DEX_COOKIE}"
-d '{}'
undefinedOrder Fee Query
订单手续费查询
bash
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": "..."}'Response includes: , , , , .
platformFeeRatemaxPriorityFeemaxSlippageminUsdtantiMevbash
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": "..."}'响应包含:、、、、。
platformFeeRatemaxPriorityFeemaxSlippageminUsdtantiMevSafety Guidelines
安全指南
Pre-Trade Checks
交易前检查
ALWAYS perform these checks before executing:
- Verify token address (use market-data skill to check holders/whale data first)
- Check current price via market-data skill
- Run pre-check API
- Get explicit user confirmation via AskUserQuestion
- Start with small amounts
执行交易前务必完成以下检查:
- 验证代币地址(先使用market-data技能查看持有者/巨鲸数据)
- 通过market-data技能查看当前价格
- 调用pre-check API
- 通过AskUserQuestion获取用户明确确认
- 先尝试小额交易
Risk Warnings
风险提示
Display these warnings for:
- New Tokens (< 7 days): "New unverified token - high risk of rug pull"
- Low Liquidity: "Low liquidity - high slippage risk"
- High Whale Concentration: "Top 10 holders own >50% - manipulation risk"
- Large Orders: "Large order relative to liquidity - significant price impact"
出现以下情况时需显示对应警告:
- 新代币(上线<7天):“未经验证的新代币——存在极高跑路风险”
- 低流动性:“流动性不足——滑点风险高”
- 巨鲸持仓集中:“前10大持有者持仓占比>50%——存在操控风险”
- 大额订单:“订单规模相对于流动性过大——会对价格产生显著影响”
Example Confirmation Flow
确认流程示例
text
User: "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 resulttext
用户:“买入价值1 SOL的BONK”
Agent步骤:
1. 从market-data获取BONK价格(调用currentPrice端点)
2. 检查持有者数据是否存在风险信号
3. 调用order/pre-check接口
4. 通过AskUserQuestion展示确认信息:
“确认交易:
- 买入:约134亿枚BONK(约1 SOL)
- 价格:0.0000000747 SOL/枚BONK
- 平台:Raydium(Solana)
- 手续费:通过orderFee API查询
是否继续?”
5. 若用户确认,调用order/create接口
6. 查询订单状态
7. 展示结果Error Handling
错误处理
Common Errors
常见错误
| 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 |
| 代码 | 信息 | 解决方案 |
|---|---|---|
| 200 | success | 正常响应 |
| 400 | Bad request | 检查参数 |
| 401 | Unauthorized | 令牌过期,重新验证 |
| 403 | Insufficient balance | 用户需要更多SOL |
| 500 | sys error | 服务器问题,重试 |
Error Response Format
错误响应格式
json
{
"code": "403",
"msg": "Insufficient balance",
"errorDetail": {
"key": "value"
}
}json
{
"code": "403",
"msg": "Insufficient balance",
"errorDetail": {
"key": "value"
}
}Use Cases
使用场景
Use Case 1: Market Buy
场景1:市价买入
text
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 resultstext
用户:“买入价值1 SOL的BONK”
步骤:
1. 获取BONK地址和当前价格
2. 执行交易前检查
3. 展示确认信息
4. 调用order/create执行交易
5. 查询订单状态
6. 展示结果Use Case 2: Limit Buy
场景2:限价买入
text
User: "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"text
用户:“当BONK价格跌至0.00000005 SOL时买入”
步骤:
1. 创建挂单并设置目标价格
2. 确认订单已创建
3. 说明:“当BONK价格达到目标价时,订单将自动执行”Use Case 3: Copy Trade
场景3:跟单交易
text
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 settingstext
用户:“追踪这个智能钱包:2jJfuPMN3R3Se5c8y7BdeiQDJMKv9wms1z1wG14xJH4H”
步骤:
1. 通过market-data技能的smart/wallet端点查询钱包信息
2. 展示钱包统计数据(盈亏率、胜率)
3. 与用户确认
4. 创建跟单订单
5. 说明跟单交易设置Use Case 4: Cancel Orders
场景4:取消订单
text
User: "Cancel all my pending orders"
Steps:
1. Query pending orders first
2. Show list to user
3. Confirm cancellation
4. Call cancelAll
5. Confirm resulttext
用户:“取消我所有的挂单”
步骤:
1. 先查询挂单列表
2. 向用户展示列表
3. 确认取消操作
4. 调用cancelAll接口
5. 确认结果Tips
技巧
- Always Confirm: Never execute trades without explicit user confirmation
- Check First: Use market-data skill to research tokens before trading
- Small Amounts: Recommend starting with small amounts for new tokens
- Copy Trading: Research the wallet's track record before following
- Error Recovery: Provide clear next steps on failures
- 务必确认:未经用户明确确认,切勿执行交易
- 先做调研:交易前使用market-data技能研究代币信息
- 小额起步:建议新代币交易先从小额开始
- 跟单需谨慎:追踪钱包前先调研其交易记录
- 错误恢复:交易失败时提供清晰的后续步骤
Related Skills
相关技能
- market-data: Get prices, holder stats, smart wallet data before trading
- auth-helper: Setup authentication (required for all trading)
- market-data:交易前获取价格、持有者统计数据、智能钱包信息
- auth-helper:设置身份验证(所有交易操作均需)