Skip to main content

UpsertGridBot (REST)


Grid Bot settings. Open API reads the current pair price and calculates the nearest levels and level count from gridPercentStep. Interval grids also use lowPrice and highPrice as borders. The calculated values then pass through the cabinet upsert validation.

namestringrequired

Name shown in the cabinet.

Example: My Grid Bot
exchangeCodestringrequired

Enabled exchange code.

Example: BINANCE
pairCodestringrequired

Trading pair code on the selected exchange.

Example: BTCUSDT
profilesCodesstring[]required

API profile codes for the selected exchange.

Possible values: >= 1

Example: ["my-profile-code"]
gridMarketstring

Selects spot or derivative market. Pass it as a query parameter; the body value is ignored.

Possible values: [spot, derivative]

gridTypestringrequired

Grid size mode: bounded Interval or expanding Infinite.

Possible values: [interval, infinite]

gridMethodstringrequired

Execution method: classic or two-way.

Possible values: [classic, two_way]

gridTradingTypestringrequired

Trade direction selected in the Grid Bot form.

Possible values: [long, short, neutral, two_way]

midPricenumberrequired

Price separating long and short grid orders. Match the cabinet calculation: Interval Long uses highPrice, Interval Short uses lowPrice, Interval Neutral uses (highPrice + lowPrice) / 2. Infinite Long uses 10000000000, Infinite Short uses 0 (the server-side sentinel), and Infinite Neutral uses the current last price. For Two-way, use the selected middle price from the grid setup; do not use 0 as a generic missing value.

Possible values: >= 0

highPricenumber | nullnullable

Upper price boundary for an Interval grid.

Possible values: > 0

lowPricenumber | nullnullable

Lower price boundary for an Interval grid.

Possible values: > 0

gridPercentStepnumberrequired

Grid step as a fraction (1% = 0.01). Open API uses it with the server's current pair price to calculate grid levels.

Possible values: > 0

investmentBasenumber | nullnullable

Conventional quote-asset amount allocated to the spot grid (USDT in BTC/USDT).

Possible values: >= 0

investmentRefnumber | nullnullable

Conventional base-asset amount allocated to the spot grid (BTC in BTC/USDT).

Possible values: >= 0

amountPerTradenumberrequired

Amount used for each entry order, in amountPerTradeType units.

Possible values: > 0

amountPerTradeTypestringrequired

Unit used by amountPerTrade. In legacy bot fields, ref is the conventional base asset (BTC in BTC/USDT), and base is the conventional quote asset (USDT).

Possible values: [base, ref, percents]

amountPerTradeMultipliernumber | nullnullable

Order amount multiplier on derivative exchanges.

Possible values: >= 1 and <= 125

leveragenumber | nullnullable

Leverage configured for the bot.

Possible values: >= 1 and <= 125

exchangeLeveragenumber | nullnullable

Leverage setting applied on the exchange.

Possible values: >= 1 and <= 125

signalCodestring | nullnullable

Existing webhook signal code to retain when editing; keep it secret.

startConditionstring

Start immediately, on an indicator, or after a webhook alert.

Possible values: [immediate, indicator, webhook_alert]

signalSourcestring | nullnullable

Signal source for webhook_alert start condition.

stopConditionstringrequired

Actions to take when the bot stops.

Possible values: [stop_only, stop_and_close_all, stop_and_close_all_and_convert_to_profit_currency]

profitCurrencyTypestringrequired

Asset in which grid profit is kept: legacy ref is the conventional base asset; base is the conventional quote asset.

Possible values: [base, ref]

takeProfitnumber | nullnullable

Always an absolute USD ($) amount, including spot pairs quoted in another currency. Stops the bot when total PnL reaches this profit; 10 means $10, not 10%.

Possible values: > 0

takeProfitOrderTypestring

Order type used when taking profit.

Possible values: [market, best_bid_ask_limit]

takeProfitOrderTypeSettings objectnull

Settings for best_bid_ask_limit take-profit orders.

postOnlyboolean

Place the take-profit limit order without taking existing liquidity.

stopLossnumber | nullnullable

Always an absolute USD ($) amount, including spot pairs quoted in another currency. Stops the bot when selected PnL reaches this loss; 10 means a loss of $10.

Possible values: > 0

stopLossPnlCompareTypestring

Choose USD-valued total (realized plus unrealized) or unrealized PnL for the absolute stopLoss threshold.

Possible values: [total, unrealized]

Default value: total
trailingStopActivationnumber | nullnullable

Always an absolute USD ($) amount. The selected PnL must reach this peak before the bot-level trailing stop activates.

Possible values: > 0

trailingStopExecutenumber | nullnullable

Always an absolute USD ($) amount. The bot-level trailing stop triggers after the selected PnL drops this far from its peak.

Possible values: > 0

trailingStopPnlCompareTypestring

Choose USD-valued total or unrealized PnL for the absolute trailing-stop peak and drop thresholds.

Possible values: [total, unrealized]

Default value: total
strategyProfitConditionstring

Exit each grid position by take profit or trailing stop.

Possible values: [take_profit, trailing_stop]

Default value: take_profit
strategyStopLossFixedPercentRationumber | nullnullable

Fixed stop-loss distance for each grid position, as a fraction.

Possible values: > 0

stopOnOutOfGridboolean

Stop the bot when price leaves an Interval grid.

Default value: false
pumpProtectionboolean

Classic grid: use market entries instead of resting limits. Two-way grid: when crossing a level from below, enter Long only; from above, enter Short only. This does not guarantee protection from a pump or dump.

Default value: false
pumpProtectionOrderTypestring

For two-way pump-protected entries, choose market or limit. In classic mode, pumpProtection itself selects market entries.

Possible values: [market, limit]

Default value: market
maxRequiredAmountstring | nullnullable

Client-side required-amount estimate stored with the bot.

indicators objectnull

Required for indicator start conditions. Use one indicator key.

rsi object

RSI settings for indicator start.

periodinteger

Candle period used to calculate RSI.

Possible values: >= 1 and <= 100

rsiValuenumber | nullnullable

RSI threshold that starts the bot.

Possible values: >= 0.01 and <= 100

macd object

MACD settings for indicator start.

fastPeriodinteger

Fast moving-average period for MACD.

Possible values: >= 1 and <= 100

slowPeriodinteger

Slow moving-average period for MACD.

Possible values: >= 1 and <= 100

signalPeriodinteger

Signal-line period for MACD.

Possible values: >= 1 and <= 100

bb object

Bollinger Bands settings for indicator start.

periodinteger

Candle period used to calculate Bollinger Bands.

Possible values: >= 1 and <= 100

stdDevnumber

Standard-deviation multiplier for Bollinger Bands.

Possible values: >= 0.001 and <= 50

price_change object

Price-change settings for indicator start.

priceDeviationnumber

Price change that starts the bot, as a fraction.

Possible values: >= 0.005 and <= 0.1




UpsertGridBot — REST API
{
"name": "My Grid Bot",
"exchangeCode": "BINANCE",
"pairCode": "BTCUSDT",
"profilesCodes": [
"my-profile-code"
],
"gridMarket": "spot",
"gridType": "interval",
"gridMethod": "classic",
"gridTradingType": "long",
"midPrice": 0,
"highPrice": 0,
"lowPrice": 0,
"gridPercentStep": 0,
"investmentBase": 0,
"investmentRef": 0,
"amountPerTrade": 0,
"amountPerTradeType": "base",
"amountPerTradeMultiplier": 0,
"leverage": 0,
"exchangeLeverage": 0,
"signalCode": "string",
"startCondition": "immediate",
"signalSource": "string",
"stopCondition": "stop_only",
"profitCurrencyType": "base",
"takeProfit": 0,
"takeProfitOrderType": "market",
"takeProfitOrderTypeSettings": "Unknown Type: object,null",
"stopLoss": 0,
"stopLossPnlCompareType": "total",
"trailingStopActivation": 0,
"trailingStopExecute": 0,
"trailingStopPnlCompareType": "total",
"strategyProfitCondition": "take_profit",
"strategyStopLossFixedPercentRatio": 0,
"stopOnOutOfGrid": false,
"pumpProtection": false,
"pumpProtectionOrderType": "market",
"maxRequiredAmount": "string",
"indicators": "Unknown Type: object,null"
}