Skip to main content

Get Grid Bot Detail

Retrieve comprehensive details for a specific spot grid bot, including configuration, status, profit metrics, arbitrage count, TP/SL settings, and close reason.

info
  • grid_id:
    Obtained from the Create Spot Grid Bot response or grid list queries.

  • APR fields:
    grid_apr and total_apr are returned as decimal ratios (e.g. "0.15" means 15% APR). Multiply by 100 to convert to percentage.

  • current_profit / current_per:
    Only present for bots in RUNNING state.

  • Rate limit:
    10 requests per second per UID.

HTTP Request

POST/v5/grid/query-grid-detail

Request Parameters

ParameterRequiredTypeComments
grid_idtruestringGrid bot ID to query

Response Parameters

ParameterTypeComments
status_codeintegerBusiness status code
debug_msgstringDebug message (testnet only)
detailobjectGrid bot detail object (see below)
> grid_idintegerGrid bot ID
> symbolstringTrading pair (e.g. BTCUSDT)
> base_tokenstringBase token symbol (e.g. BTC)
> quote_tokenstringQuote token symbol (e.g. USDT)
> statusstringBot lifecycle status: RAW, REJECTED, NEW, INITIALIZING, RUNNING, CANCELLING, COMPLETED
> max_pricestringGrid upper price bound (decimal string)
> min_pricestringGrid lower price bound (decimal string)
> cell_numberintegerNumber of active grid intervals
> total_investmentstringTotal investment amount in quote token (decimal string)
> total_profitstringTotal profit in quote token (decimal string)
> grid_profitstringGrid arbitrage profit in quote token (decimal string)
> grid_aprstringGrid APR as decimal ratio (e.g. "0.15" = 15%)
> total_aprstringTotal APR as decimal ratio (e.g. "0.2" = 20%)
> arbitrage_numintegerTotal number of completed arbitrage trades
> arbitrage_num_24integerNumber of arbitrage trades in the last 24 hours
> current_pricestringCurrent market price (decimal string)
> current_profitstringCurrent unrealized P&L for running bots (decimal string)
> current_perstringCurrent P&L as decimal ratio (e.g. "0.05" = 5%)
> equitystringCurrent equity in quote token (decimal string)
> entry_pricestringEntry trigger price if set (decimal string)
> stop_loss_pricestringStop-loss price if set (decimal string)
> take_profit_pricestringTake-profit price if set (decimal string)
> close_reasonstringReason for closure: UNKNOWN, CLOSED_MANUALLY, CLOSED_FAILED_INITIATION, CLOSED_SYMBOL_DELISTED, CLOSED_STOP_LOSS, CLOSED_TAKE_PROFIT, CLOSED_USER_BAN, CLOSED_TRAILING_STOP, CLOSE_STANDARD_CLEARANCE, CLOSE_TAX_TAG_CHANGE
> bot_close_codestringClose code: Unknown, Failed initiation, Canceled manually, Auto canceled (other), Auto canceled (take-profit), Auto canceled (stop-loss), Trailing stop
> ts_percentstringTrailing stop callback as decimal ratio (e.g. "0.05" = 5%)
> is_support_tsbooleanWhether the symbol supports trailing stop
> enable_trailingbooleanWhether grid trailing is enabled
> limit_up_pricestringUpper limit price for grid trailing (decimal string)
> ori_max_pricestringOriginal max price before trailing shift
> ori_min_pricestringOriginal min price before trailing shift
> ori_cell_numberintegerOriginal grid count before trailing shift
> allow_followintegerWhether copy-trading is allowed: 1 yes, 0 no
> follow_numintegerNumber of copy-trade followers
> operation_timeintegerMilliseconds since bot creation
> create_timeintegerCreation timestamp (Unix milliseconds)
> end_timeintegerEnd timestamp (Unix milliseconds). 0 if still running
> used_reward_amountstringTotal voucher amount used in quote token (decimal string)
> settlement_assetsstringSettlement asset information on close
> account_typestringAccount type: Unspecified, Derivatives account, Unified account, Account upgrading, Spot account, UTA account, Fund account
> cum_withdrew_amountstringCumulative withdrawn profit in quote token (decimal string)

Request Example

POST /v5/grid/query-grid-detail HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672211928338
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{"grid_id":1234567890}

Response Example

{
"retCode": 0,
"retMsg": "",
"result": {
"status_code": 200,
"detail": {
"grid_id": "612340768081708828",
"symbol": "MNTUSDT",
"base_token": "MNT",
"quote_token": "USDT",
"total_investment": "200",
"total_profit": "40.4186",
"max_price": "1.0968",
"min_price": "0.3656",
"cell_number": 50,
"grid_profit": "61.3113",
"grid_apr": "111.893143923675",
"total_apr": "73.763945",
"arbitrage_num": 291,
"arbitrage_num_24": 0,
"allow_follow": 1,
"operation_time": "986587",
"status": "RUNNING",
"entry_price": "",
"stop_loss_price": "",
"take_profit_price": "",
"current_price": "0.7279",
"close_reason": "UNKNOWN_GridCloseReason",
"bot_close_code": "BOT_CLOSE_CODE_UNKNOWN",
"follow_num": 0,
"create_time": "1774513139000",
"end_time": "0",
"used_reward_amount": "",
"settlement_assets": "",
"account_type": "BOT_ACCOUNT_TYPE_FUND",
"cum_withdrew_amount": "0",
"current_profit": "40.4186",
"current_per": "0.202093",
"spot_symbol_status": "ONLINE",
"used_reward_id": "",
"taker_fee_rate": "0.0006",
"maker_fee_rate": "0.0004",
"equity": "237.412782",
"ts_exit_equity": "0",
"ts_percent": "0",
"is_support_ts": true,
"enable_trailing": false,
"limit_up_price": "",
"ori_max_price": "",
"ori_min_price": "",
"ori_cell_number": 0
},
"debug_msg": ""
},
"retExtInfo": {},
"time": 1774514125596
}