Gate.io command reference
This page lists every command parameter Autoview reads for Gate.io spot, and what each one does on Gate.io. Autoview takes a webhook from whatever sends it: a charting alert, a script, your own server. The command inside that webhook is what this page covers. If you haven't connected Gate.io yet, start with getting started with Gate.io.
We built this list by reading Autoview's Gate.io connector line by line. If a parameter isn't here, the connector doesn't read it. These commands were not run live for this page, so send each one with d=1 first and read the log before you trade.
Write Gate.io pairs with the separator: BTC_USDT, not BTCUSDT. Every example below ends in d=1, which builds the order and sends nothing. Remove it only when the log shows what you meant.
The basics
A command is one line of key=value pairs separated by spaces. The order of the pairs doesn't matter. Here is a limit buy 5% under the market for 0.001 BTC:
e=gate s=BTC_USDT b=buy p=-5% q=0.001 d=1e=gate tells the Chrome extension to route the order to Gate.io. gateio, gate-io, and gate.io work too. On the webhook platform the webhook already belongs to your Gate.io account, so you can leave e= off.
Two parameters need care on every order. b= is required; without it the command fails. q= defaults to 100% of your available balance, so set it every time.
Parameter table
| Parameter | What it does on Gate.io |
|---|---|
e= | Routes the command to Gate.io on the Chrome extension. Accepts gate, gateio, gate-io, or gate.io. |
a= | Picks which saved Gate.io key to use, by the name you gave it. Leave it off if you only have one key. |
s= | The pair, in Gate.io's form, for example s=BTC_USDT. Autoview checks it against Gate.io's list of spot pairs and rejects a pair it can't find. |
b= | Side: buy or sell for spot. long or short sends a margin order instead. Required. |
t= | Order type: limit (the default), gtc, post, market, ioc, or fok. See order types. |
p= / fp= | Limit price. p= is an offset from the current best price, fp= is a fixed price. |
px= / fpx= | Trigger price. Either one turns the order into a price-triggered order. px= is an offset, fpx= is a fixed price. |
et= | How long a price-triggered order waits, in seconds. The default is 30 days. |
q= | Size, in the base coin (the BTC in BTC_USDT). A percent like q=25% uses that share of your available balance. |
u=currency | Reads q= as an amount of the quote coin instead. q=20 u=currency on BTC_USDT means about 20 USDT worth. |
y=equity | On a trade, makes a percent q= count your whole balance, including funds locked in open orders, not only what's free. |
h= | Iceberg. Shows only part of a limit order on the book. h=10% shows a tenth of the order. |
lt= | Margin account for b=long and b=short: lt=isolated for isolated margin. Anything else uses cross margin. |
ab= | ab=1 lets Gate.io borrow automatically on a margin order when your balance falls short. |
ar= | ar=1 turns on automatic repayment. Gate.io applies it to cross margin orders only. |
c=order | Cancels open orders on the pair, including price-triggered ones. |
cm= / cmo= | Cancel only some orders. cm= is how many, cmo= is which ones: newest, oldest, lowest, highest, smallest, biggest, or random. |
w= / y= | Moves funds between your Gate.io accounts. w= is the coin, y= is the direction. |
d= | d=1 builds the order or transfer, logs it, and sends nothing to Gate.io. |
Order types
t= picks the order type. Gate.io treats two of these differently from most exchanges, so read the last row.
| Command | What Autoview sends |
|---|---|
e=gate s=BTC_USDT b=buy p=-5% q=0.001 d=1 | A limit buy 5% under the best bid. t=limit is the default, so you don't need to write it. |
e=gate s=BTC_USDT b=buy t=gtc p=-5% q=0.001 d=1 | The same limit order, marked good until cancelled. |
e=gate s=BTC_USDT b=buy t=post p=-5% q=0.001 d=1 | A post-only limit. Gate.io cancels it rather than let it fill as a taker. |
e=gate s=BTC_USDT b=sell t=market q=0.001 d=1 | A market sell of 0.001 BTC. |
e=gate s=BTC_USDT b=sell t=ioc q=0.001 d=1 | A market order, immediate or cancel. t=fok is the same but fill or kill. Gate.io only accepts those two on market orders, so Autoview sends them as market orders and p= sets no limit. |
On a market buy, Gate.io wants the size in the quote coin. Autoview converts your q= for you at the current price, so you still write the base amount.
Setting the price
With no price at all, a limit buy sits at the best bid and a limit sell at the best ask. Autoview reads those from the top of Gate.io's order book when the command arrives.
p= moves the price from there. The sign is the direction: p=-5% is 5% lower, p=2% is 2% higher, and p=-100 is 100 USDT lower on BTC_USDT. fp= sets a fixed price instead:
e=gate s=BTC_USDT b=sell fp=150000 q=0.001 d=1That rests a sell at 150000 USDT. Autoview rounds the price to the number of decimals Gate.io allows for the pair.
Price-triggered orders
Add px= or fpx= and the order waits on Gate.io's side. When the market reaches the trigger price, Gate.io places a limit order at your p= price. You can use this as a stop or as a target, but it's always its own order. It doesn't attach to an earlier entry.
The direction is set for you. A trigger above the current price fires when the market rises to it. A trigger below fires when the market falls to it.
e=gate s=BTC_USDT b=sell px=-5% p=-6% q=0.001 d=1That's a stop for a spot holding. When the price drops 5%, Gate.io places a limit sell 6% under today's price, which gives the fill some room.
Always set p= on a triggered order. Both px= and p= are measured from the price when the command arrives. Leave p= off and the limit goes in at that old price. A sell stop would then sit above a falling market and never fill.
A few details:
- The order that gets placed is always a limit.
t=marketdoesn't change that. Onlyt=iocchanges it, to an immediate-or-cancel limit. et=sets how long the trigger waits, in seconds.et=86400is one day. Without it, Autoview asks for 30 days. Gate.io cancels the trigger when the time runs out.h=,ab=, andar=don't apply to triggered orders.
Sizing
q= reads three ways.
- A number is base coin.
q=0.001onBTC_USDTis 0.001 BTC. - A percent is a share of your free balance. For a buy that's your USDT, converted to BTC at the order price. For a sell it's your BTC. Add
y=equityto count funds locked in open orders too. - With
u=currency, a number is quote coin.q=20 u=currencybuys about 20 USDT of BTC.
Autoview rounds the size to the number of decimals Gate.io allows for the pair. Gate.io also has a minimum order value per pair. Check it on Gate.io before you size a test order, since an order under it comes back rejected.
No q= means 100%. A command without a size uses your whole free balance. Write the size you mean on every order.
Margin orders
b=long buys and b=short sells through your margin account instead of spot. Cross margin is the default. Add lt=isolated for isolated margin on that pair.
e=gate s=BTC_USDT b=long lt=isolated p=-1% q=0.001 ab=1 d=1That's a limit buy 1% under the bid on isolated margin, with automatic borrowing turned on. ar=1 adds automatic repayment, but Gate.io only applies that to cross margin.
Three things to know before you use margin here:
- Use a fixed
q=. On cross margin, Autoview sizes a percent from one account-wide margin figure, not from a coin balance. That makes a percent short come out at the wrong size. - Autoview doesn't set leverage on Gate.io. It reads no
l=for this exchange. Set your margin terms on Gate.io. - Check your account type. Gate's current API reference names three order accounts: spot, margin, unified. Autoview sends
cross_marginfor cross margin orders, and that value isn't on the list. If cross margin orders come back rejected, that's the first place to look.
Cancelling orders
c=order cancels open orders on the pair. It covers regular orders and price-triggered orders.
e=gate s=BTC_USDT c=order d=1b= narrows what gets cancelled:
- No
b=: spot orders plus cross and isolated margin orders.lt=crossorlt=isolatedlimits the margin part to one account. b=buyorb=sell: spot orders on that side only.b=longorb=short: margin orders on that side only.
fp= keeps only orders at that exact price. cm= and cmo= cancel a subset. cm=1 cmo=oldest cancels just the oldest one:
e=gate s=BTC_USDT b=buy c=order cm=1 cmo=oldest d=1Autoview reads the first 100 open orders in each account. With more than that open on one pair, run the cancel again.
Moving funds between accounts
w= names the coin and y= names the direction. Without the spot- prefix, funds move out of spot. With it, they move back into spot.
e=gate w=USDT y=futures q=50 d=1That moves 50 USDT from spot to your futures account. y=spot-futures would move it back.
| y= | Direction |
|---|---|
margin | Spot to isolated margin. Add s= for the pair, for example s=BTC_USDT. |
cross_margin | Spot to cross margin. |
futures | Spot to perpetual futures. |
delivery | Spot to delivery futures. |
options | Spot to options. |
spot-margin, spot-cross_margin, spot-futures, spot-delivery, spot-options | The same accounts, back to spot. |
Rules for transfers:
q=must be a fixed amount. A percent returns an error, and so does leavingq=off, since the default is 100%.w=takes a list.w=USDT,BTCmoves the sameq=of each coin.- Your key needs wallet permission on Gate.io, or the transfer fails.
Some directions may be rejected by Gate.io. Gate's API reference requires the pair for any transfer to or from margin, and the settle coin for any transfer to or from futures. Autoview sends the pair only when moving into isolated margin, and the settle coin only when moving into perpetual futures. Gate's transfer list also doesn't include cross margin. So y=futures and y=margin are the safest. For the other directions, if Gate.io rejects the transfer, move the funds on Gate.io itself.
What Gate.io doesn't support
These look like they should work and don't:
- No attached stop-loss, take-profit, or trailing stop. Autoview reads no
sl=ortp=for Gate.io. Use a separatepx=order. Leavets=off too. Older Autoview builds dropped it without a word. Builds from October 2026 on refuse the whole command with an error that beginsTrailing Stop (ts/fts) is not supported., so the entry never goes out. Either way, no trailing stop is placed. - No
c=positionorc=all. Both return an unsupported feature error, and so doesb=flat. Cancel withc=orderand exit a holding with a sell. - No leverage setting.
l=isn't read here. - No reduce-only or hedge flags.
ro=andhedge=aren't read here. - No futures on this connection. Gate.io Futures is a separate Autoview connection with its own commands. To rehearse with demo funds, see the Gate.io Futures Testnet guide.
When a command does something you didn't expect, put d=1 back on it and compare the log with this page. For more on reading the log, see test and debug your setup.