Spot margin trading, by exchange
In an Autoview command, b=buy and b=sell trade spot. b=long and b=short ask for a margin order instead: a buy or a sell through your margin account, where the exchange can lend you the coin or the cash. Whether that happens depends on the exchange. Some send the order to margin, some refuse it, and some quietly treat it as a plain spot buy or sell.
This page goes through each spot exchange. It comes from the Autoview integrations code that runs on our servers today. We read the code; we did not send these orders live for this guide. Futures and perpetuals are margined anyway and are not covered here; for those, see leverage by exchange.
The trap: b=short on a spot-only connection
On Binance.US, Coinbase Advanced and Bitget spot, Autoview has no margin path. It reads b=long as a buy and b=short as a sell, from your spot balance. So b=short sells coins you already hold. It does not borrow and it does not open a short. If you copy a margin strategy to one of these accounts, change the sides to buy and sell so the log says what really happens.
Gemini goes the other way: a b=long or b=short line is refused with a margin trading not supported error, and nothing is sent.
Exchange by exchange
- Binance.
b=longandb=shortgo to Binance margin. Cross margin is the default;lt=isolateduses the isolated account for that pair. Percent sizes come from the margin wallet you picked.c=positionis not supported here, so you exit with an oppositelongorshortorder. Full detail is on the Binance command reference. - Bybit. Autoview tells Bybit to borrow on
b=longandb=short, and not onb=buyorb=sell. Bybit's order docs call this field "Whether to borrow" and ask you to turn on margin trading and set the currency as collateral first. - Bitfinex.
b=longandb=shortplace a margin order instead of an exchange (spot) order. If the pair has no margin market, the order is refused. A stop or target that Autoview attaches to a margin order goes out reduce-only, so a leftover exit cannot open a position the other way. - Crypto.com. On a spot pair, Autoview marks the order as margin. It first checks that Crypto.com allows margin buying (for
long) or margin selling (forshort) on that pair, and refuses the order if not. - Gate.io.
b=longandb=shorttrade from cross margin, or from isolated margin withlt=isolated. See the next section for borrowing.c=positionis not supported. - HTX. Orders go through your isolated margin account, or cross margin with
lt=cross. If that margin account doesn't exist on HTX yet, the order is refused with an account not found error. - Kraken. A
b=longorb=shortline needsl=, or it is refused. The leverage goes on the order. Percent sizes come from your free margin.c=positionworks and uses the open position's leverage. - KuCoin. Margin lines go to KuCoin's margin order endpoint.
lt=isolatedorlt=crossis sent as the margin mode. Percent sizes come from your KuCoin margin account balance, also withlt=isolated. - OKX. Margin is used only on pairs where OKX offers it; on other pairs the order goes out as a cash (spot) order. Isolated is the default, and
l=0asks for cross, which also sets the pair's maximum leverage (see leverage by exchange). A percent size on a margin line comes from your quote currency on both sides, sob=short q=50%works from half your USDT, not half your coins.ro=1is sent only onlongandshortlines.
Borrowing and repaying for you
Autoview has three ways to ask an exchange to borrow, and each exchange reads only one of them, if any.
| Exchange | Borrow | Repay |
|---|---|---|
| Binance | y=borrow | y=repay |
| Gate.io | ab=1 | ar=1 (Gate.io applies it to cross margin only) |
| KuCoin | ab=1 | Not read |
| Bybit | Any b=long or b=short line | Not read |
| Everyone else | ab= and y=borrow are not read on a trade | ar= and y=repay are not read on a trade |
A few details:
ab=andar=only switch on with the value1.ab=trueis read as off.- On Gate.io,
ab=andar=go on a plain order only. A line withpx=becomes a triggered order without them. See the Gate.io command reference. - On KuCoin,
ab=1also lets the order through when your margin account shows no balance of the coin, so KuCoin can borrow it. Withoutab=1that order is refused before it is sent. - On Binance,
ab=andar=do nothing. Usey=borrowory=repayon thelongorshortorder.
e=gate s=BTC_USDT b=short p=1% q=0.001 ab=1 d=1That is a limit sell 1% above the ask on Gate.io cross margin, with automatic borrowing on, as a d=1 test.
Test it once before you rely on it
Add d=1 to see how Autoview reads your line without sending it. Then place one small margin order on the exchange and check that it shows in your margin account, not spot, and that the loan is what you expected. For how a close and a reversal work, see close or reverse on an opposite signal.