用于获取用户跟单交易创建的所有止盈止损任务
| Free | Plus | Pro | Enterprise | 积分消耗 |
|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | 0 |
URL
wss://api-bot-v1.dbotx.com/trade/ws/
说明
为保证WebSocket连接的可用性和稳定性,需要至少每1分钟(建议每30-55秒)进行一次心跳订阅,否则系统会自动断开超时链接
请求示例
{
"id": 1761291309, // 调用id,响应结果返回相同ID
"method": "listPnlOrdersFromFollowOrder", // 调用查询跟单交易止盈止损列表方法
"params": {
"page": 0, // 页码 (0 / 1 / 2 ...)
"size": 2, // 每页数量 (10 / 20, 最大20)
"chain": "solana", // 链 (solana/ethereum/base/bsc/tron)
"state":"expired", // 状态 (init/进行中, done/完成, expired/失效)
"token":"64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump", // 代币地址
"sourceId":"m6vy3yc4002c2x" // 跟单任务ID
}
}响应数据
{
"method": "rpcResponse", // rpc响应
"id": 1761291309, // 调用id
"result": {
"err": false, // 是否发生错误
"res": [
{
"id": "mfdc4bse000mlu", // 任务id
"accountId": "lz99kwxp0006q0", // 用户id
"enabled": true, // 任务启用状态,true/false
"chain": "solana", // 链 (solana/ethereum/base/bsc/tron)
"pairType": "pump_swap", // 来源于哪个DEX
"pairFee": null, // 代币交易手续费
"pair": "8ERAFDKyWZZnuqpGfbuDsqnwBZqHAFoobrKsANFxc3rq", // 交易对合约地址
"token": "64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump", // 代币地址
"tokenInfo": { // 代币信息
"contract": "64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump",
"createAt": 1757435408087, // 创建时间 (毫秒时间戳)
"name": "The Original Doge",
"symbol": "DOGE",
"decimals": 6,
"totalSupply": "1000000000000000",
"icon": null,
"tokenProgram": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"mintAuthority": null,
"freezeAuthority": null
},
"currency": "So11111111111111111111111111111111111111112",
"currencyInfo": { // 主币信息
"contract": "So11111111111111111111111111111111111111112",
"name": "Wrapped SOL",
"symbol": "SOL",
"decimals": 9,
"totalSupply": null,
"icon": "https://assets-cdn.trustwallet.com/blockchains/solana/assets/So11111111111111111111111111111111111111112/logo.png",
"createAt": null
},
"pairCurrency": null,
"pairCurrencyInfo": null,
"walletId": "m6056qp3001crx", // 使用的钱包的id,可通过“钱包信息 API”获取
"tradeType": "sell", // 交易类型,值为buy和sell
"triggerDirection": "down", // “down”表示低于触发价格时执行买入/卖出,“up”表示高于触发价格时执行买入/卖出
"triggerPriceUsd": 0.000036002523149753395, // 触发买入/卖出的价格(美元)
"currencyAmountUI": 1, // 交易类型为buy时,填写买入金额(ETH/SOL/BNB/TRX),交易类型为sell时,填写卖出比例(0.00-1.00)
"expireAt": 1757541762734, // 任务过期时间 (毫秒时间戳)
"expireDelta": 72000000, // 任务有效时长,最大值为432000000 (毫秒)
"expireExecute": true,
"useMidPrice": false, // "true"表示启用防插针模式,将使用1秒内的中间价格作为触发价
"source": "follow_order", // "follow_order"表示此任务由跟单创建,"swap_order"表示此任务由快速买卖创建
"sourceId": "m6vy3yc4002c2x", // 若任务由跟单创建,此参数为跟单任务id,若任务由快速买卖创建,此参数为快速买卖记录id
"sourceTradeId": "m6vy3yc4002c2x_mfdc49jp32bv36", // 若任务由跟单创建,此参数为跟单记录id,若任务由快速买卖创建,此参数为快速买卖记录id
"sourceGroupIdx": null, // 分段止盈止损任务编号 (从0开始)
"basePriceUsd": 0.000046157080961222303, // 代币的买入价格
"initPnlPercent": 0.22, // 初始止盈止损比例
"maxSlippage": 0.12, // 最大滑点(0.00-1.00),卖出时表示期望价格和实际成交价格之间的差距
"gasFeeDelta": 5, // 额外增加的gas (Gwei),对EVM链有效
"maxFeePerGas": 100, // 基础gas超过此值时将不进行交易 (Gwei),对EVM链有效
"priorityFee": 0.0002, // 优先费 (SOL),对Solana有效,空字符串表示使用自动优先费
"jitoEnabled": false, // "true"表示启用防夹模式 (Solana & Ethereum & Bsc)
"jitoTip": null, // 防夹模式使用的贿赂费 (Solana)
"customFeeAndTip": false, // "true"表示优先费 (priorityFee) 和贿赂费 (jitoTip) 两个字段均有效,"false"表示高速模式下只有优先费 (priorityFee) 有效,防夹模式下只有贿赂费 (jitoTip) 有效
"retries": 0, // 失败后的重试次数(0-10)
"concurrentNodes": 1, // 并发节点数(1-3)
"state": "fail", // 订单状态,init:初始化,processing:进行中,done:已完成,fail:已失败,expired:已过期
"lastStateUpdateAt": 1757469762734,
"createAt": 1757469762734,
"updateAt": 1757469762734,
"errorMessage": "token has been sold out:m6vy3yc4002c2x_mfdc4k1d1mf2ao", // 错误信息
"errorCode": "E_OTHERS", // 错误类型
"triggerPercent": -0.22, // 实际止盈止损比例
"links": { // 本次交易的相关链接
"etherscan": null,
"dexscreener": "https://dexscreener.com/solana/8ERAFDKyWZZnuqpGfbuDsqnwBZqHAFoobrKsANFxc3rq",
"uniswap": "https://jup.ag/swap/So11111111111111111111111111111111111111112-64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump"
}
}
]
}
}以NodeJS为例
const WebSocket = require('ws')
function main() {
const ws = new WebSocket('wss://api-data-v1.dbotx.com/trade/ws/', {
headers: {
'x-api-key': 'YOUR_API_KEY',
},
})
ws.on('open', () => {
ws.send(
JSON.stringify({
"id": 1761291309,
"method": "listPnlOrdersFromFollowOrder",
"params": {
"page": 0,
"size": 2,
"chain": "solana",
"state":"expired",
"token":"64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump",
"sourceId":"m6vy3yc4002c2x"
}
})
)
setInterval(() => {
ws.ping()
}, 30000)
})
ws.on('message', res => {
console.log('res:', res.toString('utf-8'))
})
}
main()
以Python为例
import asyncio
import websockets
import json
async def main():
uri = "wss://api-data-v1.dbotx.com/trade/ws/"
headers = {"x-api-key": "YOUR_API_KEY"}
msg = {
"id": 1761291309,
"method": "listPnlOrdersFromFollowOrder",
"params": {
"page": 0,
"size": 2,
"chain": "solana",
"state":"expired",
"token":"64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump",
"sourceId":"m6vy3yc4002c2x"
}
}
async with websockets.connect(uri, additional_headers=headers) as ws:
await ws.send(json.dumps(msg))
async def keep_alive():
while True:
await ws.ping()
await asyncio.sleep(30)
async def listen_for_messages():
async for message in ws:
print(message)
await asyncio.gather(keep_alive(), listen_for_messages())
if __name__ == "__main__":
asyncio.run(main())
响应结果可视化参考

