API Reference
DBot OfficialDBot DashboardPricing

TP / SL Tasks (copy trading) (WS)

Used to get the user's all TP / SL tasks (from copy trading)

FreePlusProEnterprise积分消耗
0

URL

wss://api-bot-v1.dbotx.com/trade/ws/

Notes

To ensure the availability and stability of the WebSocket connection, a heartbeat subscription must be sent at least once every minute (recommended every 30–55 seconds), otherwise the system will automatically disconnect the timeout link

Request Example

{
  "id": 1761291309, // Call ID; the response returns the same ID as the request
  "method": "listPnlOrdersFromFollowOrder", // Method to query PNL orders from follow order
  "params": {
    "page": 0, // Page number (0 / 1 / 2 ...)
    "size": 2, // Page size (10 / 20, max 20)
    "chain": "solana", // Chain (solana/ethereum/base/bsc/tron)
    "state":"expired", // Status (init/processing, done/completed, expired/invalid)
    "token":"64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump", // Token address
    "sourceId":"m6vy3yc4002c2x" // Copy trading task ID
  }
}

Response Data

{
    "method": "rpcResponse", // RPC response
    "id": 1761291309, // Call ID
    "result": {
        "err": false, // Request result status; false means succeeded, true means failed
        "res": [
            {
                "id": "mfdc4bse000mlu", // Task id
                "accountId": "lz99kwxp0006q0", // User ID
                "enabled": true, // Task enable status, true/false
                "chain": "solana", // Chain (solana/ethereum/base/bsc/tron)
                "pairType": "pump_swap", // DEX source
                "pairFee": null,
                "pair": "8ERAFDKyWZZnuqpGfbuDsqnwBZqHAFoobrKsANFxc3rq", // Trading pair contract address
                "token": "64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump", // Token address
                "tokenInfo": { // Token information
                    "contract": "64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump",
                    "createAt": 1757435408087, // Creation time (ms timestamp)
                    "name": "The Original Doge",
                    "symbol": "DOGE",
                    "decimals": 6,
                    "totalSupply": "1000000000000000",
                    "icon": null,
                    "tokenProgram": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
                    "mintAuthority": null,
                    "freezeAuthority": null
                },
                "currency": "So11111111111111111111111111111111111111112", // Base currency address
                "currencyInfo": { // Base currency information
                    "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", // Wallet ID used, obtainable via "Wallet Info API"
                "tradeType": "sell", // Trade type, values buy or sell
                "triggerDirection": "down", // "down" means execute buy/sell when below trigger price, "up" when above
                "triggerPriceUsd": 0.000036002523149753395, // Trigger buy/sell price (USD)
                "currencyAmountUI": 1, // For buy type, enter buy amount (ETH/SOL/BNB/TRX); for sell type, enter sell ratio (0.00-1.00)
                "expireAt": 1757541762734, // Task expiration time (ms timestamp)
                "expireDelta": 72000000, // Task validity duration, max 432000000 (ms)
                "expireExecute": true, // "true" means if not triggered within validity period, execute automatically at end
                "useMidPrice": false, // "true" enables Anti-Spike mode using 1-second mid-price as trigger price (not 100% guaranteed)
                "source": "follow_order", // "follow_order" indicates this task is created by copy trading, "swap_order" indicates this task is created by fast buy/sell
                "sourceId": "m6vy3yc4002c2x", // If task created by copy trading, this is copy trading task id; if by fast buy/sell, this is fast buy/sell record id
                "sourceTradeId": "m6vy3yc4002c2x_mfdc49jp32bv36", // If task created by copy trading, this is copy trading record id; if by fast buy/sell, this is fast buy/sell record id
                "sourceGroupIdx": null, // Segmented PNL task index (starts from 0)
                "basePriceUsd": 0.000046157080961222303, // Base buy price (USD)
                "initPnlPercent": 0.22, // Initial PNL percentage
                "maxSlippage": 0.12, // Max slippage tolerance (0.00-1.00), for buy: difference between actual and expected price; for sell: expected and actual, multiplier = 1/(1-slippage)
                "gasFeeDelta": 5, // Extra added gas (Gwei), valid for EVM
                "maxFeePerGas": 100, // When base gas exceeds this value, no transaction (Gwei), valid for EVM chains
                "priorityFee": 0.0002, // Priority Fee (SOL), valid for Solana, empty string means auto priority fee
                "jitoEnabled": false, // "true" enables anti-MEV mode (Solana & Ethereum & Bsc)
                "jitoTip": null, // Bribery tip for Anti-MEV (Solana), required when jitoEnabled or customFeeAndTip is true (null for auto)
                "customFeeAndTip": false, // "true" means both priorityFee and jitoTip valid; "false" means turbo: only priorityFee, anti-MEV: only jitoTip, auto allocation
                "retries": 0, // Number of retries after failure (0-10)
                "concurrentNodes": 1, // Number of concurrent nodes (1-3)
                "state": "fail", // Order status: init (initial), processing, done (completed), fail, expired
                "lastStateUpdateAt": 1757469762734,
                "createAt": 1757469762734, // Creation time (ms timestamp)
                "updateAt": 1757469762734,
                "errorMessage": "token has been sold out:m6vy3yc4002c2x_mfdc4k1d1mf2ao", // Error message
                "errorCode": "E_OTHERS", // Error type
                "triggerPercent": -0.22, // Actual PNL percentage
                "links": { // Related links for this transaction
                    "etherscan": null,
                    "dexscreener": "https://dexscreener.com/solana/8ERAFDKyWZZnuqpGfbuDsqnwBZqHAFoobrKsANFxc3rq",
                    "uniswap": "https://jup.ag/swap/So11111111111111111111111111111111111111112-64VG7ATaPRGf28PAAnEGWM31gqB45sqfCNVnQbQ9pump"
                }
            }
        ]
    }
}

Example in 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()

Example in 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())

Response data visualization reference