KuCoin Futures command reference
This page lists every command parameter Autoview reads for KuCoin Futures, and what each one does there. 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. KuCoin Futures is its own connection with its own API key, so if you've only set up spot, start with getting started with KuCoin and then add a futures key the same way.
We built this list by reading Autoview's KuCoin Futures 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.
Use KuCoin's contract names: XBTUSDTM for the bitcoin USDT perpetual, 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 of 1 lot, 2% under the market, at 5x leverage:
e=kucoinfutures s=XBTUSDTM b=buy p=-2% q=1 l=5 d=1e=kucoinfutures tells the Chrome extension to route the order to KuCoin Futures. kucoin-futures works too. Plain e=kucoin goes to the spot connection instead. On the webhook platform the webhook already belongs to your KuCoin Futures account, so you can leave e= off.
Three parameters need care on every order. b= is required; without it the command fails. q= defaults to 100% of your free margin, so set it every time. l= defaults to 1, so write the leverage you mean.
Parameter table
| Parameter | What it does on KuCoin Futures |
|---|---|
e= | Routes the command to KuCoin Futures on the Chrome extension. Accepts kucoinfutures or kucoin-futures. |
a= | Picks which saved KuCoin Futures key to use, by the name you gave it. Leave it off if you only have one key. |
s= | The contract, for example s=XBTUSDTM. Autoview checks it against KuCoin's list of active contracts and rejects one it can't find. |
b= | Side: buy or sell. long and short work the same way. Required. |
t= | Order type: limit (the default), post, market, or ioc. fok returns an error. |
p= / fp= | Limit price. p= is an offset from the current best price, fp= is a fixed price. |
q= | Size in lots. A percent like q=25% uses that share of your free margin, times your leverage. |
u=currency | Reads q= as an amount of the quote coin instead of lots. |
y=equity | Makes a percent q= count your account equity, not only free margin. |
l= | Leverage sent with the order. The default is 1. |
lt= | Margin mode: lt=isolated or lt=cross. Left off, Autoview sends nothing and KuCoin uses isolated. |
ro= | ro=1 makes the order reduce-only. |
id= | Your own order ID, sent as KuCoin's client order ID. Also a filter for c=order. |
h= | h=100% hides a limit order from the book. A smaller value makes an iceberg that shows only that share. |
sl= / fsl=, tp= / ftp= | Turns the order into a stop order with a trigger price. See stop orders. |
pxs= | Which price fires a stop order: last (the default), mark, or index. |
c=order | Cancels open orders on the contract, stop orders included. |
c=position | Closes open positions on the contract. |
cm= / cmo= | Cancel or close only some. cm= is how many, cmo= is which ones, such as oldest or newest. |
ef= | Enter when flat. With ef=1, Autoview reads your open positions on the symbol before it sends an entry. If one is open, long or short, the entry is skipped and nothing is sent. It never holds back a close or a cancel, or an order with ro=1 or close=1. If Autoview cannot read your positions, the entry is refused with an error instead of going out unchecked. The command reference covers the side words and ef=any. Example: e=kucoinfutures s=XBTUSDTM b=buy p=-2% q=1 ef=1 d=1. |
d= | d=1 builds the order, logs it, and sends nothing to KuCoin. |
Order types
| Command | What Autoview sends |
|---|---|
e=kucoinfutures s=XBTUSDTM b=buy p=-2% q=1 d=1 | A limit buy 2% under the best bid, good until cancelled. t=limit is the default. |
e=kucoinfutures s=XBTUSDTM b=buy t=post p=-2% q=1 d=1 | A post-only limit. KuCoin cancels it rather than let it fill as a taker. |
e=kucoinfutures s=XBTUSDTM b=sell t=market q=1 d=1 | A market sell of 1 lot. |
e=kucoinfutures s=XBTUSDTM b=buy t=ioc p=0.1% q=1 d=1 | A limit buy, immediate or cancel. Whatever doesn't fill at once is cancelled. |
With no p=, a limit buy sits at the best bid and a limit sell at the best ask. The sign of p= is the direction: p=-2% is 2% lower, p=50 is 50 higher. fp= sets a fixed price. Autoview rounds the price to KuCoin's tick size for the contract.
h= only applies to limit orders, and KuCoin won't take it together with t=post.
Sizing in lots
KuCoin sizes futures orders in lots, and each contract has its own lot value. On some contracts one lot is a small slice of a coin, so check the contract's multiplier on KuCoin before you write a number.
- A number is lots.
q=3is 3 lots. - A percent is a share of your free margin, with leverage. Autoview reads your balance in the contract's settle coin, multiplies by
l=, and converts to lots at the order price.y=equityuses your equity instead. - With
u=currency, a number is quote coin.q=100 u=currencyonXBTUSDTMis about 100 USDT of bitcoin, converted to lots.
Autoview rounds the size to whole lots. A size that rounds to zero comes back rejected.
Leverage and margin mode
l= goes out with every order, and it also scales percent sizing. Without it, Autoview sends 1.
lt= sets the margin mode on the order. Write lt=cross or lt=isolated to match how the contract is set on your KuCoin account. Without lt=, Autoview leaves the field off and KuCoin's API treats the order as isolated.
e=kucoinfutures s=XBTUSDTM b=buy t=market q=10% l=3 lt=cross d=1Stop orders with sl= and tp=
On KuCoin Futures, sl= and tp= don't attach a bracket to a position. They make the order you're sending a stop order. KuCoin holds it until the trigger price is hit, then places it as a limit at p=, or at market with t=market.
The trigger direction comes from the side and from which name you use, not from where the price sits:
| Command has | Fires when the price |
|---|---|
b=buy sl= | falls to the trigger |
b=buy tp= | rises to the trigger |
b=sell sl= | rises to the trigger |
b=sell tp= | falls to the trigger |
So a protective stop under a long position is a sell that fires on a fall, which is b=sell tp= here:
e=kucoinfutures s=XBTUSDTM b=sell t=market tp=-5% q=1 ro=1 pxs=mark d=1Check the stop in the log before you trust it. sl= and tp= share one trigger field, so a command with both sends only tp=. Read the stop and stopPrice values in the d=1 output and confirm the direction is the one you want.
Cancelling orders
c=order cancels open orders on the contract. That covers regular orders and stop orders.
e=kucoinfutures s=XBTUSDTM c=order d=1Narrow it with these:
b=buyorb=sellkeeps one side.fp=keeps orders at that exact price.id=keeps one client order ID.l=keeps orders at that leverage.ro=1keeps reduce-only orders.t=limitort=marketkeeps one type.t=openskips stop orders,t=stopcancels only stop orders.cm=andcmo=cancel a subset.cm=1 cmo=oldestcancels just the oldest one.
Closing positions
c=position reads your open position on the contract and sends the opposite order for its size.
e=kucoinfutures s=XBTUSDTM c=position t=market ro=1 d=1- Without
t=market, the close goes in as a limit at the best price on its side, so it may not fill at once. q=here is a share of the position.q=50%closes half.b=longorb=shortcloses only that side.lt=closes only positions in that margin mode.- Add
ro=1so the close can never open a position the other way.
What KuCoin Futures doesn't support
These look like they should work and don't:
- No
c=allorb=flat. Both return an unsupported feature error. Usec=orderandc=positionas two commands. - No transfers.
w=returns an unsupported feature error. Move funds between spot and futures on KuCoin. - No fill or kill.
t=fokreturns an error. - No trailing stops or separate trigger orders. The connector reads no
ts=,px=, oret=. - Copy trading is separate. A lead trader account needs its own exchange code. See lead traders below.
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.
KuCoin Futures lead traders (copy trading)
If you are a KuCoin Futures Lead Trader, the trades your followers copy happen in your lead trading account. KuCoin keeps that account apart from your normal futures account, and it answers on its own copy trading API. Autoview reaches it through a separate exchange code, kucoinfuturescopy.
Why a normal futures key says "Access Denied"
With e=kucoinfutures, Autoview calls KuCoin's normal futures endpoints for the balance and the order. A key made for lead trading isn't allowed there, so KuCoin answers with error 400007, "Access Denied". And a key that does work there trades your normal futures wallet, so the order never reaches your followers. The fix is the exchange code.
Set it up
- Create an API key for your lead trading account on KuCoin. Turn on the Futures permission and the lead trading permission. KuCoin's API documentation calls that one
LeadtradeFutures; the label on the key screen may read differently, such as Copy Trading. Set a passphrase, then copy the key, the secret, and the passphrase. - Save the key in Autoview. On the Chrome extension, save it as a Kucoin Futures Copy key. The copy connection keeps its own keys, apart from your normal Kucoin Futures keys. If you save more than one lead key, give each its own account name, for example
lead, and adda=leadto your lead commands. On the webhook platform, add it as a KuCoin key with a clear name such as KuCoin Lead, so you can tell it apart from a normal KuCoin key. - Send the copy exchange code. On the Chrome extension, write
e=kucoinfuturescopy(kucoin-futures-copyworks too). On the webhook platform, choose Kucoin Futures Copy as the exchange for the webhook and use the lead key.
A long entry at 5x leverage, then the close, both as tests:
e=kucoinfuturescopy a=lead s=XBTUSDTM b=buy t=market q=10% l=5 d=1e=kucoinfuturescopy a=lead s=XBTUSDTM c=position d=1Remove d=1 when the log shows the order you meant. If the live order comes back with 400007, check both permissions on the key and that it belongs to your lead trading account.
What works differently on a lead account
- USDT perpetuals only. Contracts that settle in another coin, or that expire, are rejected as unknown symbols.
- Isolated margin. Orders go out isolated unless you write
lt=cross, and KuCoin may refuse cross on a lead account. If it does, the log tells you to uselt=isolated. - Leverage of 20 or less. A higher
l=is lowered to 20, with a warning in the log. - Percent sizing works off KuCoin's limit. KuCoin gives no balance for the lead account, so
q=10%is 10% of the most KuCoin will let you open at that price and leverage. - No
c=ordercancels. Cancelling open orders returns an unsupported feature error. Cancel them on KuCoin. - Closes are one market order.
c=positionsends a single market close for the contract. If your lead account uses hedge mode, addhedge=1andb=to say which side to close. - Stops trigger on last or mark price.
sl=andtp=go to KuCoin's lead stop orders, withpxs=last(the default) orpxs=mark.pxs=indexreturns an error. - No trailing stops.
ts=,fts=,tsx=andftsx=are not supported.