| 1 | # Exchange-specific Notes |
| 2 | |
| 3 | This page combines common gotchas and informations which are exchange-specific and most likely don't apply to other exchanges. |
| 4 | |
| 5 | ## Binance |
| 6 | |
| 7 | !!! Tip "Stoploss on Exchange" |
| 8 | Binance supports `stoploss_on_exchange` and uses stop-loss-limit orders. It provides great advantages, so we recommend to benefit from it. |
| 9 | |
| 10 | ### Binance Blacklist |
| 11 | |
| 12 | For Binance, please add `"BNB/<STAKE>"` to your blacklist to avoid issues. |
| 13 | Accounts having BNB accounts use this to pay for fees - if your first trade happens to be on `BNB`, further trades will consume this position and make the initial BNB trade unsellable as the expected amount is not there anymore. |
| 14 | |
| 15 | ### Binance sites |
| 16 | |
| 17 | Binance has been split into 3, and users must use the correct ccxt exchange ID for their exchange, otherwise API keys are not recognized. |
| 18 | |
| 19 | * [binance.com](https://www.binance.com/) - International users. Use exchange id: `binance`. |
| 20 | * [binance.us](https://www.binance.us/) - US based users. Use exchange id: `binanceus`. |
| 21 | * [binance.je](https://www.binance.je/) - Binance Jersey, trading fiat currencies. Use exchange id: `binanceje`. |
| 22 | |
| 23 | ## Kraken |
| 24 | |
| 25 | !!! Tip "Stoploss on Exchange" |
| 26 | Kraken supports `stoploss_on_exchange` and can use both stop-loss-market and stop-loss-limit orders. It provides great advantages, so we recommend to benefit from it. |
| 27 | You can use either `"limit"` or `"market"` in the `order_types.stoploss` configuration setting to decide which type to use. |
| 28 | |
| 29 | ### Historic Kraken data |
| 30 | |
| 31 | The Kraken API does only provide 720 historic candles, which is sufficient for Freqtrade dry-run and live trade modes, but is a problem for backtesting. |
| 32 | To download data for the Kraken exchange, using `--dl-trades` is mandatory, otherwise the bot will download the same 720 candles over and over, and you'll not have enough backtest data. |
| 33 | |
| 34 | Due to the heavy rate-limiting applied by Kraken, the following configuration section should be used to download data: |
| 35 | |
| 36 | ``` json |
| 37 | "ccxt_async_config": { |
| 38 | "enableRateLimit": true, |
| 39 | "rateLimit": 3100 |
| 40 | }, |
| 41 | ``` |
| 42 | |
| 43 | !!! Warning "Downloading data from kraken" |
| 44 | Downloading kraken data will require significantly more memory (RAM) than any other exchange, as the trades-data needs to be converted into candles on your machine. |
| 45 | It will also take a long time, as freqtrade will need to download every single trade that happened on the exchange for the pair / timerange combination, therefore please be patient. |
| 46 | |
| 47 | !!! Warning "rateLimit tuning" |
| 48 | Please pay attention that rateLimit configuration entry holds delay in milliseconds between requests, NOT requests\sec rate. |
| 49 | So, in order to mitigate Kraken API "Rate limit exceeded" exception, this configuration should be increased, NOT decreased. |
| 50 | |
| 51 | ## Bittrex |
| 52 | |
| 53 | ### Order types |
| 54 | |
| 55 | Bittrex does not support market orders. If you have a message at the bot startup about this, you should change order type values set in your configuration and/or in the strategy from `"market"` to `"limit"`. See some more details on this [here in the FAQ](faq.md#im-getting-the-exchange-bittrex-does-not-support-market-orders-message-and-cannot-run-my-strategy). |
| 56 | |
| 57 | ### Restricted markets |
| 58 | |
| 59 | Bittrex split its exchange into US and International versions. |
| 60 | The International version has more pairs available, however the API always returns all pairs, so there is currently no automated way to detect if you're affected by the restriction. |
| 61 | |
| 62 | If you have restricted pairs in your whitelist, you'll get a warning message in the log on Freqtrade startup for each restricted pair. |
| 63 | |
| 64 | The warning message will look similar to the following: |
| 65 | |
| 66 | ``` output |
| 67 | [...] Message: bittrex {"success":false,"message":"RESTRICTED_MARKET","result":null,"explanation":null}" |
| 68 | ``` |
| 69 | |
| 70 | If you're an "International" customer on the Bittrex exchange, then this warning will probably not impact you. |
| 71 | If you're a US customer, the bot will fail to create orders for these pairs, and you should remove them from your whitelist. |
| 72 | |
| 73 | You can get a list of restricted markets by using the following snippet: |
| 74 | |
| 75 | ``` python |
| 76 | import ccxt |
| 77 | ct = ccxt.bittrex() |
| 78 | _ = ct.load_markets() |
| 79 | res = [ f"{x['MarketCurrency']}/{x['BaseCurrency']}" for x in ct.publicGetMarkets()['result'] if x['IsRestricted']] |
| 80 | print(res) |
| 81 | ``` |
| 82 | |
| 83 | ## FTX |
| 84 | |
| 85 | !!! Tip "Stoploss on Exchange" |
| 86 | FTX supports `stoploss_on_exchange` and can use both stop-loss-market and stop-loss-limit orders. It provides great advantages, so we recommend to benefit from it. |
| 87 | You can use either `"limit"` or `"market"` in the `order_types.stoploss` configuration setting to decide which type of stoploss shall be used. |
| 88 | |
| 89 | ### Using subaccounts |
| 90 | |
| 91 | To use subaccounts with FTX, you need to edit the configuration and add the following: |
| 92 | |
| 93 | ``` json |
| 94 | "exchange": { |
| 95 | "ccxt_config": { |
| 96 | "headers": { |
| 97 | "FTX-SUBACCOUNT": "name" |
| 98 | } |
| 99 | }, |
| 100 | } |
| 101 | ``` |
| 102 | |
| 103 | ## Kucoin |
| 104 | |
| 105 | Kucoin requries a passphrase for each api key, you will therefore need to add this key into the configuration so your exchange section looks as follows: |
| 106 | |
| 107 | ```json |
| 108 | "exchange": { |
| 109 | "name": "kucoin", |
| 110 | "key": "your_exchange_key", |
| 111 | "secret": "your_exchange_secret", |
| 112 | "password": "your_exchange_api_key_password", |
| 113 | ``` |
| 114 | |
| 115 | ### Kucoin Blacklists |
| 116 | |
| 117 | For Kucoin, please add `"KCS/<STAKE>"` to your blacklist to avoid issues. |
| 118 | Accounts having KCS accounts use this to pay for fees - if your first trade happens to be on `KCS`, further trades will consume this position and make the initial KCS trade unsellable as the expected amount is not there anymore. |
| 119 | |
| 120 | ## All exchanges |
| 121 | |
| 122 | Should you experience constant errors with Nonce (like `InvalidNonce`), it is best to regenerate the API keys. Resetting Nonce is difficult and it's usually easier to regenerate the API keys. |
| 123 | |
| 124 | ## Random notes for other exchanges |
| 125 | |
| 126 | * The Ocean (exchange id: `theocean`) exchange uses Web3 functionality and requires `web3` python package to be installed: |
| 127 | |
| 128 | ```shell |
| 129 | $ pip3 install web3 |
| 130 | ``` |
| 131 | |
| 132 | ### Getting latest price / Incomplete candles |
| 133 | |
| 134 | Most exchanges return current incomplete candle via their OHLCV/klines API interface. |
| 135 | By default, Freqtrade assumes that incomplete candle is fetched from the exchange and removes the last candle assuming it's the incomplete candle. |
| 136 | |
| 137 | Whether your exchange returns incomplete candles or not can be checked using [the helper script](developer.md#Incomplete-candles) from the Contributor documentation. |
| 138 | |
| 139 | Due to the danger of repainting, Freqtrade does not allow you to use this incomplete candle. |
| 140 | |
| 141 | However, if it is based on the need for the latest price for your strategy - then this requirement can be acquired using the [data provider](strategy-customization.md#possible-options-for-dataprovider) from within the strategy. |
| 142 | |
| 143 | ### Advanced Freqtrade Exchange configuration |
| 144 | |
| 145 | Advanced options can be configured using the `_ft_has_params` setting, which will override Defaults and exchange-specific behavior. |
| 146 | |
| 147 | Available options are listed in the exchange-class as `_ft_has_default`. |
| 148 | |
| 149 | For example, to test the order type `FOK` with Kraken, and modify candle limit to 200 (so you only get 200 candles per API call): |
| 150 | |
| 151 | ```json |
| 152 | "exchange": { |
| 153 | "name": "kraken", |
| 154 | "_ft_has_params": { |
| 155 | "order_time_in_force": ["gtc", "fok"], |
| 156 | "ohlcv_candle_limit": 200 |
| 157 | } |
| 158 | ``` |
| 159 | |
| 160 | !!! Warning |
| 161 | Please make sure to fully understand the impacts of these settings before modifying them. |