API Reference
DBot OfficialDBot DashboardPricing

Trailing Stop Tasks (WS)

Used to get the user's all trailing stop tasks

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": "listTrailingStopOrders", // Method to query trailing stop orders
  "params": {
    "source": "swap_order", // Source (swap_order for fast buy/sell, follow_order for copy trading)
    "page": 0, // Page number (0 / 1 / 2 ...)
    "size": 10, // Page size (10 / 20, max 20)
    "chain": "solana", // Chain (solana/ethereum/base/bsc/tron)
    "state":"init", // Status (init/in progress, done/completed, expired/invalid)
    "token":"AgBPkSqL64uQ58kka9LqcxyuNk4erExTfM779YYJpump", // Token address
    "sourceId":"mh4bis9l0017ts" // Fast buy and sell record id & 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": "mh4biuhj003mla", // 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": "2MbUDEs8tpNW4gC2ijoWrSGWvfVvj3kYbic3uxkMLT7P", // Trading pair contract address
                "token": "AgBPkSqL64uQ58kka9LqcxyuNk4erExTfM779YYJpump", // Token address
                "tokenInfo": { // Token information
                    "contract": "AgBPkSqL64uQ58kka9LqcxyuNk4erExTfM779YYJpump",
                    "createAt": 1761147333609, // Creation time (ms timestamp)
                    "name": "Bullseus Maximus",
                    "symbol": "BULL",
                    "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": "mglqkeq5003dol", // Wallet ID used, obtainable via "Wallet Info API"
                "tradeType": "sell", // Trade type, values buy or sell
                "basePriceUsd": 0.0003948836497453323, // Base buy price (USD)
                "trailingDistancePercent": 0.22,
                "triggerPriceUsd": 0.00030811728440592004, // Trigger buy/sell price (USD)
                "highestPriceUsd": 0.0003950221594947693,
                "lastPriceUpdateAt": 1761278220003,
                "amountOrPercent": 0.99, // For buy type, enter buy amount (ETH/SOL/BNB/TRX); for sell type, enter sell ratio (0.00-1.00)
                "expireAt": 1761710129623, // Task expiration time (ms timestamp)
                "expireDelta": 432000000, // Task validity duration, max 432000000 (ms)
                "expireExecute": true, // "true" means if not triggered within validity period, execute automatically at end
                "useMidPrice": true, // "true" enables Anti-Spike mode using 1-second mid-price as trigger price (not 100% guaranteed)
                "source": "swap_order", // "follow_order" indicates this task is created by copy trading, "swap_order" indicates this task is created by fast buy/sell
                "sourceId": "mh4bis9l0017ts", // 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": "mh4bis9l0017ts", // 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": 0, // Segmented PNL task index (starts from 0)
                "maxSlippage": 0.26, // 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.00001, // Priority Fee (SOL), valid for Solana, empty string means auto priority fee
                "jitoEnabled": true, // "true" enables anti-MEV mode (Solana & Ethereum & Bsc)
                "jitoTip": 0.00002, // Bribery tip for Anti-MEV (Solana), required when jitoEnabled or customFeeAndTip is true (null for auto)
                "customFeeAndTip": true, // "true" means both priorityFee and jitoTip valid; "false" means turbo: only priorityFee, anti-MEV: only jitoTip, auto allocation
                "retries": 2, // Number of retries after failure (0-10)
                "concurrentNodes": 2, // Number of concurrent nodes (1-3)
                "state": "init", // Order status: init (initial), processing, done (completed), fail, expired
                "lastStateUpdateAt": 1761278129623,
                "createAt": 1761278129623, // Creation time (ms timestamp)
                "updateAt": 1761278129623,
                "lastHighestPriceEventId": "mh4bkqul62l73x",
                "errorCode": "", // Error type
                "errorMessage": "", // Error message
                "triggerPercent": -0.22, // Actual PNL percentage
                "links": { // Related links for this transaction
                    "etherscan": null,
                    "dexscreener": "https://dexscreener.com/solana/2MbUDEs8tpNW4gC2ijoWrSGWvfVvj3kYbic3uxkMLT7P",
                    "uniswap": "https://jup.ag/swap/So11111111111111111111111111111111111111112-AgBPkSqL64uQ58kka9LqcxyuNk4erExTfM779YYJpump"
                },
                "walletName": "222", // Wallet name
                "walletAddress": "6pNBhbgtWwWd6tnQHNoH1tqZW2hBvUfLPVtq5BwTQNZt", // Wallet address
                "walletType": "solana", // Wallet type (solana/evm)
                "nonceCount": 4
            }
        ]
    }
}

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": "listTrailingStopOrders",
               "params": {
                 "source": "swap_order",
                 "page": 0,
                 "size": 10,
                 "chain": "solana",
                 "state":"init",
                 "token":"AgBPkSqL64uQ58kka9LqcxyuNk4erExTfM779YYJpump",
                 "sourceId":"mh4bis9l0017ts"
             }
         })
        )

        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": "listTrailingStopOrders",
      "params": {
        "source": "swap_order",
        "page": 0,
        "size": 10,
        "chain": "solana",
        "state":"init",
        "token":"AgBPkSqL64uQ58kka9LqcxyuNk4erExTfM779YYJpump",
        "sourceId":"mh4bis9l0017ts"
      }
    }

    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