Grid Trading
Grid Trading
Add Investment Amount
Add investment amount to a grid trading bot. Supports adding spot investment amount and adjusting futures margin.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Add Investment Amount › Request Parameters
categoryBusiness line
botIdGrid bot ID. The business line must match the grid bot ID, otherwise an error will be returned
coinCoin to add
sizeAmount
fundsSourceSource of funds
funding: Funding account
uta: Unified account
otc: OTC account
adjustTypeAdjustment type. Only applicable to futures grid, required for futures
increase
decrease
reinvestProfitWhether to reinvest profit, default yes. Only applicable to spot grid
yes
no
Add Investment Amount › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
Get Grid Bot Detail
Query the detailed information of a specified strategy, including parameter configuration, current status, accumulated profit, etc.
- Rate limit: 10/sec/UID
- Permission: UTA trade (read-only)
Request Parameters
botIdGrid bot ID
Get Grid Bot Detail › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
symbolTrading pair
statusStatus
init: Initializing
waiting: Waiting to start
running: Running
terminating: Terminating
terminated: Terminated
totalProfitTotal profit, in USDT
roiROI, in decimal form
gridProfitGrid profit, in USDT
gridProfitRateGrid profit rate
unpairedProfitUnpaired profit, in USDT
unpairedProfitRateUnpaired profit rate
marginMargin, only for futures
arbitrageAPRArbitrage APR
totalAPRTotal APR
createdTimeCreation time
runningTimeRunning duration, in ms
currentBaseBalanceCurrent base coin balance
currentQuoteBalanceCurrent quote coin balance
initialBaseHoldingsInitial base coin holdings
initialQuoteHoldingsInitial quote coin holdings
reservedBaseTradingFeeReserved base coin trading fee
reservedQuoteTradingFeeReserved quote coin trading fee
gridStartPriceGrid start price
gridTypeGrid type
long
short
netural
maxPriceGrid upper limit price
minPriceGrid lower limit price
gridNumNumber of grids
gridOrderModeGrid order mode
arithmetic
geometric
baseInvestmentCoinBase coin of investment
baseInvestmentAmountBase coin investment amount
quoteInvestmentCoinQuote coin of investment
quoteInvestmentAmountQuote coin investment amount
slippageSlippage
1%
2%
none
triggerConditionTrigger condition
instant
price
rsi
boll
Trigger parameters
triggerPriceTrigger price
terminationConditionTermination condition
rsi
boll
Termination parameters
terminationSellWhether to sell on termination
yes
no
stopLossStop-loss price
takeProfitTake-profit price
hodlModeHODL mode
yes
no
autoTransferProfitsAuto transfer profit
yes
no
arbitrageCountArbitrage count
terminationReasonTermination reason
MANUAL_END: Manually terminated
NEW_WAIT: Waiting to start
ACCOUNT_BALANCE_LACKING_END: Terminated due to insufficient available funds
STOP_PROFIT_END: Terminated by take-profit
STOP_LOSS_END: Terminated by stop-loss
CANCEL_END: Terminated by cancellation
SYSTEM_END: Cancelled due to order placement failure
FOLLOW_END: Terminated by follow
SUBSCRIBE_STOP_PROFIT_END: Terminated by subscription take-profit
SUBSCRIBE_STOP_LOSS_END: Terminated by subscription stop-loss
PLACE_ORDER_FAIL_END: Terminated by consecutive order placement failures
SYMBOL_DOWN_END: Terminated due to trading pair delisting
SUB_ACCOUNT_TRANSFER_FAIL: Terminated due to fund transfer failure
HIGHEST_PRICE_END: Terminated at highest price
BOTTOM_PRICE_END: Terminated at lowest price
BURST_END: Terminated by liquidation
MOVE_GRID_FAIL: Terminated due to grid move failure
EXPIRE_TIME_END: Terminated by scheduled expiration
HANDLE_SUB_POSITION_END: Terminated by manual position reduction
STOP_PRICE_ACHIEVE: Terminated upon reaching stop price
ADL_END: Terminated by ADL
AUTO_CONVERT_END: Terminated by auto-conversion
CONDITION_TRIGGER_END: Terminated by condition trigger
ADL_CONVERT_END: Terminated by ADL reduction
CANCEL_DELIVERY_ORDER: Cancelled due to delivery
BASIS_RATE_TRIGGER: Terminated by basis rate trigger
EARN_REDEEM_FAIL: Terminated due to earn redemption failure
SYSTEM_CANCEL: Cancelled by system
SYMBOL_RSTOCK_SPLIT: Cancelled due to stock split/reverse split
Close Grid Bot
Terminate a specified bot, stopping order placement and handling unfilled orders/positions according to the strategy configuration.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Close Grid Bot › Response Parameters
Successful response
codemsgrequestTimedataResponse data
Create Grid Bot
Submit a request to create a spot or futures grid trading bot.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Create Grid Bot › Request Parameters
categoryBusiness line
SPOT: Spot trading
USDT-FUTURES: USDT-margined futures
USDC-FUTURES: USDC-margined futures
symbolTrading pair name
maxPriceGrid upper limit price
minPriceGrid lower limit price
gridNumNumber of grids
gridOrderModeGrid order mode
arithmetic: Arithmetic
geometric: Geometric
Investment amount
fundsSourceSource of funds
funding: Funding account
uta: Unified account
otc: OTC account
autoTransferProfitsAuto transfer profits, default no
yes
no
gridTypeGrid direction
long
short
netural
Required for futures
leverageLeverage, default 1. Only effective for futures
autoReserveMarginAuto reserve margin
reservedMarginReserved margin. Only effective for futures
triggerConditionTrigger condition, default instant
instant
price
rsi
boll
Trigger parameters
triggerPriceTrigger price
terminationConditionTermination condition
rsi
boll
Termination parameters
terminationSellWhether to sell on termination. Only for spot grid
yes
no
stopLossStop-loss price
takeProfitTake-profit price
slippageSlippage
trailingGridTrailing grid, default no
yes
no
movingAverageGainsMoving average gains
stopUpwardPriceStop upward price
hodlModeHODL mode, default no. Only effective for spot
yes
no
marketOpenMarket open, default enabled. Only effective for futures
yes
no
lossReserveLoss reserve, default enabled. Only effective for futures
yes
no
Create Grid Bot › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
Create Neutral Grid Bot
Submit a request to create a neutral futures grid trading bot.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Create Neutral Grid Bot › Request Parameters
categoryBusiness line
USDT-FUTURES: USDT-margined futures
USDC-FUTURES: USDC-margined futures
symbolTrading pair
maxPriceUpper limit price
minPriceLower limit price
gridNumNumber of grids
gridOrderModeGrid order mode
arithmetic: Arithmetic
geometric: Geometric
fundsSourceSource of funds
funding: Funding account
uta: UTA account
otc: OTC account
leverageLeverage
List of investment coins and amounts. For futures, only quote coin USDT/USDC is supported
triggerPriceTrigger price
stopLossStop-loss price
takeProfitTake-profit price
autoTransferProfitsAuto transfer profit
Create Neutral Grid Bot › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
Get Grid Bot Order Details
Query the order details associated with a specified strategy.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read-only)
Request Parameters
botIdGrid bot ID
Get Grid Bot Order Details › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
symbolTrading pair
Buy order list
Sell order list
Modify Grid Bot Parameters
Modify the basic parameters (price range, investment amount, etc.) of a running grid trading bot.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Modify Grid Bot Parameters › Request Parameters
botIdGrid bot ID
takeProfitTake-profit price. If not passed, the take-profit price will be cleared. If you do not want to modify the current take-profit price, pass in the current value
stopLossStop-loss price. If not passed, the stop-loss price will be cleared. If you do not want to modify the current stop-loss price, pass in the current value
terminationConditionTermination condition
rsi
boll
Termination parameters
hodlModeHODL mode
yes
no
autoTransferProfitsAuto transfer profits
yes: transfer out
no: do not transfer out
Modify Grid Bot Parameters › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
Modify Grid Interval and Grid Number
Modify the grid price range and grid number.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Modify Grid Interval and Grid Number › Request Parameters
categoryBusiness line
SPOT: Spot trading
USDT-FUTURES: USDT-margined futures
USDC-FUTURES: USDC-margined futures
botIdGrid bot ID
maxPriceGrid upper limit price
minPriceGrid lower limit price
gridNumNumber of grids
Modify Grid Interval and Grid Number › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
Modify Neutral Grid Bot Parameters
Modify the basic parameters of a running neutral grid trading bot.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Modify Neutral Grid Bot Parameters › Request Parameters
botIdGrid bot ID
categoryBusiness line
USDT-FUTURES: USDT-margined futures
USDC-FUTURES: USDC-margined futures
takeProfitTake-profit price. If not passed, the take-profit price will be cleared. Pass the current value if no change is intended
stopLossStop-loss price. If not passed, the stop-loss price will be cleared. Pass the current value if no change is intended
autoTransferProfitsAuto transfer profit
yes: Transfer out
no: Do not transfer out
Modify Neutral Grid Bot Parameters › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
Modify Neutral Grid Interval and Grid Number
Modify the grid price range and number of grids.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Modify Neutral Grid Interval and Grid Number › Request Parameters
categoryBusiness line
USDT-FUTURES: USDT-margined futures
USDC-FUTURES: USDC-margined futures
botIdGrid bot ID
maxPriceUpper limit price
minPriceLower limit price
gridNumNumber of grids
Modify Neutral Grid Interval and Grid Number › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
Get Neutral Grid Bot Detail
Query the detailed information of a specified neutral futures grid strategy, including parameter configuration, current status, and cumulative profit.
- Rate limit: 10/sec/UID
- Permission: UTA trade (read-only)
Request Parameters
botIdGrid bot ID
Get Neutral Grid Bot Detail › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
symbolTrading pair
statusStatus
init: Initializing
waiting: Waiting
running: Running
terminating: Terminating
terminated: Terminated
totalProfitTotal profit, in USDT
roiROI, in decimal form
gridProfitGrid profit, in USDT, equal to realized arbitrage profit minus fees
gridProfitRateGrid profit rate, in decimal form
unpairedProfitUnpaired profit, in USDT
unpairedProfitRateUnpaired profit rate, in decimal form
marginMargin (futures only)
arbitrageAPRArbitrage APR, in decimal form. If running for less than 1 day, calculated as 1 day
totalAPRTotal APR, in decimal form. If running for less than 1 day, calculated as 1 day
createdTimeCreation time
runningTimeRunning time, in milliseconds
gridStartPriceGrid start price
maxPriceUpper limit price
minPriceLower limit price
gridNumNumber of grids
gridOrderModeGrid order mode
arithmetic: Arithmetic
geometric: Geometric
triggerPriceTrigger price
leverageLeverage
stopLossStop-loss price
takeProfitTake-profit price
holdAveragePriceAverage holding price
holdPositionHolding position
oneGridMinProfitMinimum profit per grid
oneGridMaxProfitMaximum profit per grid
autoTransferProfitsAuto transfer profit
yes: Transfer out
no: Do not transfer out
Get Neutral Grid Bot Order Details
Query the order details associated with a specified neutral futures grid strategy.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read-only)
Request Parameters
botIdGrid bot ID
Get Neutral Grid Bot Order Details › Response Parameters
Successful response
codemsgrequestTimebotIdGrid bot ID
symbolTrading pair
Buy order list
Sell order list
Validate Neutral Grid Parameters
Before creating a neutral grid strategy, validate whether the grid parameters (price range, number of grids, investment amount, etc.) are legal, without actually creating the strategy.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Validate Neutral Grid Parameters › Request Parameters
categoryBusiness line
USDT-FUTURES: USDT-margined futures
USDC-FUTURES: USDC-margined futures
symbolTrading pair
maxPriceUpper limit price
minPriceLower limit price
gridNumNumber of grids
gridOrderModeGrid order mode
arithmetic: Arithmetic
geometric: Geometric
leverageLeverage
List of investment coins and amounts. For futures, only quote coin USDT/USDC is supported
triggerPriceTrigger price
stopLossStop-loss price
takeProfitTake-profit price
autoTransferProfitsAuto transfer profit
Validate Neutral Grid Parameters › Response Parameters
Successful response
codemsgrequestTimevalidWhether validation passed
reasonReason for validation failure
minInvestmentMinimum investment amount
Validate Grid Parameters
Before creating a grid strategy, validate whether the grid parameters (price range, grid number, investment amount, etc.) are legal. This does not actually create a strategy.
- Rate limit: 1/sec/UID
- Permission: UTA trade (read & write)
Validate Grid Parameters › Request Parameters
categoryBusiness line
SPOT: Spot trading
USDT-FUTURES: USDT-margined futures
USDC-FUTURES: USDC-margined futures
symbolTrading pair name
maxPriceGrid upper limit price
minPriceGrid lower limit price
gridNumNumber of grids
gridOrderModeGrid order mode
arithmetic: Arithmetic
geometric: Geometric
Investment amount
autoTransferProfitsAuto transfer profits, default no
yes
no
gridTypeGrid direction
long
short
netural
Required for futures
leverageLeverage, default 1. Only effective for futures
reservedMarginReserved margin. Only effective for futures
triggerConditionTrigger condition, default instant
instant
price
rsi
boll
Trigger parameters
triggerPriceTrigger price
terminationConditionTermination condition
rsi
boll
Termination parameters
stopLossStop-loss price
takeProfitTake-profit price
trailingGridTrailing grid, default no
yes
no
movingAverageGainsMoving average gains
stopUpwardPriceStop upward price
hodlModeHODL mode, default no. Only effective for spot
yes
no
marketOpenMarket open, default enabled. Only effective for futures
yes
no
lossReserveLoss reserve, default enabled. Only effective for futures
yes
no
Validate Grid Parameters › Response Parameters
Successful response
codemsgrequestTimevalidWhether the validation passed
reasonReason for validation failure
minInvestmentMinimum investment amount
