diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 904387fb2..5c80bc141 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -425,7 +425,7 @@ jobs:
python setup.py sdist bdist_wheel
- name: Publish to PyPI (Test)
- uses: pypa/gh-action-pypi-publish@v1.8.1
+ uses: pypa/gh-action-pypi-publish@v1.8.3
if: (github.event_name == 'release')
with:
user: __token__
@@ -433,7 +433,7 @@ jobs:
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI
- uses: pypa/gh-action-pypi-publish@v1.8.1
+ uses: pypa/gh-action-pypi-publish@v1.8.3
if: (github.event_name == 'release')
with:
user: __token__
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ca3da8e90..4784055a9 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,7 +15,7 @@ repos:
additional_dependencies:
- types-cachetools==5.3.0.4
- types-filelock==3.2.7
- - types-requests==2.28.11.15
+ - types-requests==2.28.11.16
- types-tabulate==0.9.0.1
- types-python-dateutil==2.8.19.10
- SQLAlchemy==2.0.7
diff --git a/build_helpers/install_ta-lib.sh b/build_helpers/install_ta-lib.sh
index 079d578b4..005d9abca 100755
--- a/build_helpers/install_ta-lib.sh
+++ b/build_helpers/install_ta-lib.sh
@@ -8,8 +8,8 @@ if [ -n "$2" ] || [ ! -f "${INSTALL_LOC}/lib/libta_lib.a" ]; then
tar zxvf ta-lib-0.4.0-src.tar.gz
cd ta-lib \
&& sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h \
- && curl 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -o config.guess \
- && curl 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -o config.sub \
+ && curl 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.guess' -o config.guess \
+ && curl 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.sub' -o config.sub \
&& ./configure --prefix=${INSTALL_LOC}/ \
&& make
if [ $? -ne 0 ]; then
diff --git a/docs/bot-basics.md b/docs/bot-basics.md
index 1aa8f3085..ef5e6900b 100644
--- a/docs/bot-basics.md
+++ b/docs/bot-basics.md
@@ -60,10 +60,10 @@ This loop will be repeated again and again until the bot is stopped.
* Load historic data for configured pairlist.
* Calls `bot_start()` once.
-* Calls `bot_loop_start()` once.
* Calculate indicators (calls `populate_indicators()` once per pair).
* Calculate entry / exit signals (calls `populate_entry_trend()` and `populate_exit_trend()` once per pair).
* Loops per candle simulating entry and exit points.
+ * Calls `bot_loop_start()` strategy callback.
* Check for Order timeouts, either via the `unfilledtimeout` configuration, or via `check_entry_timeout()` / `check_exit_timeout()` strategy callbacks.
* Calls `adjust_entry_price()` strategy callback for open entry orders.
* Check for trade entry signals (`enter_long` / `enter_short` columns).
diff --git a/docs/freqai-parameter-table.md b/docs/freqai-parameter-table.md
index f67ea8541..9822a895a 100644
--- a/docs/freqai-parameter-table.md
+++ b/docs/freqai-parameter-table.md
@@ -46,7 +46,7 @@ Mandatory parameters are marked as **Required** and have to be set in one of the
| `outlier_protection_percentage` | Enable to prevent outlier detection methods from discarding too much data. If more than `outlier_protection_percentage` % of points are detected as outliers by the SVM or DBSCAN, FreqAI will log a warning message and ignore outlier detection, i.e., the original dataset will be kept intact. If the outlier protection is triggered, no predictions will be made based on the training dataset.
**Datatype:** Float.
Default: `30`.
| `reverse_train_test_order` | Split the feature dataset (see below) and use the latest data split for training and test on historical split of the data. This allows the model to be trained up to the most recent data point, while avoiding overfitting. However, you should be careful to understand the unorthodox nature of this parameter before employing it.
**Datatype:** Boolean.
Default: `False` (no reversal).
| `shuffle_after_split` | Split the data into train and test sets, and then shuffle both sets individually.
**Datatype:** Boolean.
Default: `False`.
-| `buffer_train_data_candles` | Cut `buffer_train_data_candles` off the beginning and end of the training data *after* the indicators were populated. The main example use is when predicting maxima and minima, the argrelextrema function cannot know the maxima/minima at the edges of the timerange. To improve model accuracy, it is best to compute argrelextrema on the full timerange and then use this function to cut off the edges (buffer) by the kernel. In another case, if the targets are set to a shifted price movement, this buffer is unnecessary because the shifted candles at the end of the timerange will be NaN and FreqAI will automatically cut those off of the training dataset.
**Datatype:** Boolean.
Default: `False`.
+| `buffer_train_data_candles` | Cut `buffer_train_data_candles` off the beginning and end of the training data *after* the indicators were populated. The main example use is when predicting maxima and minima, the argrelextrema function cannot know the maxima/minima at the edges of the timerange. To improve model accuracy, it is best to compute argrelextrema on the full timerange and then use this function to cut off the edges (buffer) by the kernel. In another case, if the targets are set to a shifted price movement, this buffer is unnecessary because the shifted candles at the end of the timerange will be NaN and FreqAI will automatically cut those off of the training dataset.
**Datatype:** Integer.
Default: `0`.
### Data split parameters
diff --git a/docs/freqai-reinforcement-learning.md b/docs/freqai-reinforcement-learning.md
index ed6a41825..f5679a4ba 100644
--- a/docs/freqai-reinforcement-learning.md
+++ b/docs/freqai-reinforcement-learning.md
@@ -55,7 +55,7 @@ where `ReinforcementLearner` will use the templated `ReinforcementLearner` from
dataframe["&-action"] = 0
```
-Most of the function remains the same as for typical Regressors, however, the function above shows how the strategy must pass the raw price data to the agent so that it has access to raw OHLCV in the training environment:
+Most of the function remains the same as for typical Regressors, however, the function below shows how the strategy must pass the raw price data to the agent so that it has access to raw OHLCV in the training environment:
```python
def feature_engineering_standard(self, dataframe, **kwargs):
diff --git a/docs/freqai-running.md b/docs/freqai-running.md
index 1eaee1bf2..f3ccc546f 100644
--- a/docs/freqai-running.md
+++ b/docs/freqai-running.md
@@ -128,6 +128,9 @@ The FreqAI specific parameter `label_period_candles` defines the offset (number
You can choose to adopt a continual learning scheme by setting `"continual_learning": true` in the config. By enabling `continual_learning`, after training an initial model from scratch, subsequent trainings will start from the final model state of the preceding training. This gives the new model a "memory" of the previous state. By default, this is set to `False` which means that all new models are trained from scratch, without input from previous models.
+???+ danger "Continual learning enforces a constant parameter space"
+ Since `continual_learning` means that the model parameter space *cannot* change between trainings, `principal_component_analysis` is automatically disabled when `continual_learning` is enabled. Hint: PCA changes the parameter space and the number of features, learn more about PCA [here](freqai-feature-engineering.md#data-dimensionality-reduction-with-principal-component-analysis).
+
## Hyperopt
You can hyperopt using the same command as for [typical Freqtrade hyperopt](hyperopt.md):
diff --git a/docs/includes/protections.md b/docs/includes/protections.md
index e0ad8189f..12af081c0 100644
--- a/docs/includes/protections.md
+++ b/docs/includes/protections.md
@@ -149,7 +149,7 @@ The below example assumes a timeframe of 1 hour:
* Locks each pair after selling for an additional 5 candles (`CooldownPeriod`), giving other pairs a chance to get filled.
* Stops trading for 4 hours (`4 * 1h candles`) if the last 2 days (`48 * 1h candles`) had 20 trades, which caused a max-drawdown of more than 20%. (`MaxDrawdown`).
* Stops trading if more than 4 stoploss occur for all pairs within a 1 day (`24 * 1h candles`) limit (`StoplossGuard`).
-* Locks all pairs that had 4 Trades within the last 6 hours (`6 * 1h candles`) with a combined profit ratio of below 0.02 (<2%) (`LowProfitPairs`).
+* Locks all pairs that had 2 Trades within the last 6 hours (`6 * 1h candles`) with a combined profit ratio of below 0.02 (<2%) (`LowProfitPairs`).
* Locks all pairs for 2 candles that had a profit of below 0.01 (<1%) within the last 24h (`24 * 1h candles`), a minimum of 4 trades.
``` python
diff --git a/docs/producer-consumer.md b/docs/producer-consumer.md
index 88e34d0d6..c52279f26 100644
--- a/docs/producer-consumer.md
+++ b/docs/producer-consumer.md
@@ -42,14 +42,14 @@ Enable subscribing to an instance by adding the `external_message_consumer` sect
| `producers` | **Required.** List of producers
**Datatype:** Array.
| `producers.name` | **Required.** Name of this producer. This name must be used in calls to `get_producer_pairs()` and `get_producer_df()` if more than one producer is used.
**Datatype:** string
| `producers.host` | **Required.** The hostname or IP address from your producer.
**Datatype:** string
-| `producers.port` | **Required.** The port matching the above host.
**Datatype:** string
+| `producers.port` | **Required.** The port matching the above host.
*Defaults to `8080`.*
**Datatype:** Integer
| `producers.secure` | **Optional.** Use ssl in websockets connection. Default False.
**Datatype:** string
| `producers.ws_token` | **Required.** `ws_token` as configured on the producer.
**Datatype:** string
| | **Optional settings**
| `wait_timeout` | Timeout until we ping again if no message is received.
*Defaults to `300`.*
**Datatype:** Integer - in seconds.
-| `wait_timeout` | Ping timeout
*Defaults to `10`.*
**Datatype:** Integer - in seconds.
+| `ping_timeout` | Ping timeout
*Defaults to `10`.*
**Datatype:** Integer - in seconds.
| `sleep_time` | Sleep time before retrying to connect.
*Defaults to `10`.*
**Datatype:** Integer - in seconds.
-| `remove_entry_exit_signals` | Remove signal columns from the dataframe (set them to 0) on dataframe receipt.
*Defaults to `10`.*
**Datatype:** Integer - in seconds.
+| `remove_entry_exit_signals` | Remove signal columns from the dataframe (set them to 0) on dataframe receipt.
*Defaults to `False`.*
**Datatype:** Boolean.
| `message_size_limit` | Size limit per message
*Defaults to `8`.*
**Datatype:** Integer - Megabytes.
Instead of (or as well as) calculating indicators in `populate_indicators()` the follower instance listens on the connection to a producer instance's messages (or multiple producer instances in advanced configurations) and requests the producer's most recently analyzed dataframes for each pair in the active whitelist.
diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt
index 110373844..7f4215aef 100644
--- a/docs/requirements-docs.txt
+++ b/docs/requirements-docs.txt
@@ -1,6 +1,6 @@
markdown==3.3.7
mkdocs==1.4.2
-mkdocs-material==9.1.3
+mkdocs-material==9.1.4
mdx_truly_sane_lists==1.3
pymdown-extensions==9.10
jinja2==3.1.2
diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md
index f1cdc9f3b..329908527 100644
--- a/docs/strategy-callbacks.md
+++ b/docs/strategy-callbacks.md
@@ -51,7 +51,8 @@ During hyperopt, this runs only once at startup.
## Bot loop start
-A simple callback which is called once at the start of every bot throttling iteration (roughly every 5 seconds, unless configured differently).
+A simple callback which is called once at the start of every bot throttling iteration in dry/live mode (roughly every 5
+seconds, unless configured differently) or once per candle in backtest/hyperopt mode.
This can be used to perform calculations which are pair independent (apply to all pairs), loading of external data, etc.
``` python
@@ -61,11 +62,12 @@ class AwesomeStrategy(IStrategy):
# ... populate_* methods
- def bot_loop_start(self, **kwargs) -> None:
+ def bot_loop_start(self, current_time: datetime, **kwargs) -> None:
"""
Called at the start of the bot iteration (one loop).
Might be used to perform pair-independent tasks
(e.g. gather some remote resource for comparison)
+ :param current_time: datetime object, containing the current datetime
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
"""
if self.config['runmode'].value in ('live', 'dry_run'):
diff --git a/freqtrade/commands/data_commands.py b/freqtrade/commands/data_commands.py
index 1e74e1036..bcef1c252 100644
--- a/freqtrade/commands/data_commands.py
+++ b/freqtrade/commands/data_commands.py
@@ -204,11 +204,14 @@ def start_list_data(args: Dict[str, Any]) -> None:
pair, timeframe, candle_type,
*dhc.ohlcv_data_min_max(pair, timeframe, candle_type)
) for pair, timeframe, candle_type in paircombs]
+
print(tabulate([
(pair, timeframe, candle_type,
start.strftime(DATETIME_PRINT_FORMAT),
end.strftime(DATETIME_PRINT_FORMAT))
- for pair, timeframe, candle_type, start, end in paircombs1
+ for pair, timeframe, candle_type, start, end in sorted(
+ paircombs1,
+ key=lambda x: (x[0], timeframe_to_minutes(x[1]), x[2]))
],
headers=("Pair", "Timeframe", "Type", 'From', 'To'),
tablefmt='psql', stralign='right'))
diff --git a/freqtrade/constants.py b/freqtrade/constants.py
index 46e9b5cd4..ebb946221 100644
--- a/freqtrade/constants.py
+++ b/freqtrade/constants.py
@@ -36,9 +36,10 @@ AVAILABLE_PAIRLISTS = ['StaticPairList', 'VolumePairList', 'ProducerPairList', '
'AgeFilter', 'OffsetFilter', 'PerformanceFilter',
'PrecisionFilter', 'PriceFilter', 'RangeStabilityFilter',
'ShuffleFilter', 'SpreadFilter', 'VolatilityFilter']
-AVAILABLE_PROTECTIONS = ['CooldownPeriod', 'LowProfitPairs', 'MaxDrawdown', 'StoplossGuard']
-AVAILABLE_DATAHANDLERS_TRADES = ['json', 'jsongz', 'hdf5']
-AVAILABLE_DATAHANDLERS = AVAILABLE_DATAHANDLERS_TRADES + ['feather', 'parquet']
+AVAILABLE_PROTECTIONS = ['CooldownPeriod',
+ 'LowProfitPairs', 'MaxDrawdown', 'StoplossGuard']
+AVAILABLE_DATAHANDLERS_TRADES = ['json', 'jsongz', 'hdf5', 'feather']
+AVAILABLE_DATAHANDLERS = AVAILABLE_DATAHANDLERS_TRADES + ['parquet']
BACKTEST_BREAKDOWNS = ['day', 'week', 'month']
BACKTEST_CACHE_AGE = ['none', 'day', 'week', 'month']
BACKTEST_CACHE_DEFAULT = 'day'
diff --git a/freqtrade/data/dataprovider.py b/freqtrade/data/dataprovider.py
index 3991432a4..d05ee5db7 100644
--- a/freqtrade/data/dataprovider.py
+++ b/freqtrade/data/dataprovider.py
@@ -21,6 +21,7 @@ from freqtrade.exchange import Exchange, timeframe_to_seconds
from freqtrade.exchange.types import OrderBook
from freqtrade.misc import append_candles_to_dataframe
from freqtrade.rpc import RPCManager
+from freqtrade.rpc.rpc_types import RPCAnalyzedDFMsg
from freqtrade.util import PeriodicCache
@@ -118,8 +119,7 @@ class DataProvider:
:param new_candle: This is a new candle
"""
if self.__rpc:
- self.__rpc.send_msg(
- {
+ msg: RPCAnalyzedDFMsg = {
'type': RPCMessageType.ANALYZED_DF,
'data': {
'key': pair_key,
@@ -127,7 +127,7 @@ class DataProvider:
'la': datetime.now(timezone.utc)
}
}
- )
+ self.__rpc.send_msg(msg)
if new_candle:
self.__rpc.send_msg({
'type': RPCMessageType.NEW_CANDLE,
diff --git a/freqtrade/data/history/featherdatahandler.py b/freqtrade/data/history/featherdatahandler.py
index 22a6805e7..bb387fc84 100644
--- a/freqtrade/data/history/featherdatahandler.py
+++ b/freqtrade/data/history/featherdatahandler.py
@@ -4,7 +4,7 @@ from typing import Optional
from pandas import DataFrame, read_feather, to_datetime
from freqtrade.configuration import TimeRange
-from freqtrade.constants import DEFAULT_DATAFRAME_COLUMNS, TradeList
+from freqtrade.constants import DEFAULT_DATAFRAME_COLUMNS, DEFAULT_TRADES_COLUMNS, TradeList
from freqtrade.enums import CandleType
from .idatahandler import IDataHandler
@@ -92,12 +92,11 @@ class FeatherDataHandler(IDataHandler):
:param data: List of Lists containing trade data,
column sequence as in DEFAULT_TRADES_COLUMNS
"""
- # filename = self._pair_trades_filename(self._datadir, pair)
+ filename = self._pair_trades_filename(self._datadir, pair)
+ self.create_dir_if_needed(filename)
- raise NotImplementedError()
- # array = pa.array(data)
- # array
- # feather.write_feather(data, filename)
+ tradesdata = DataFrame(data, columns=DEFAULT_TRADES_COLUMNS)
+ tradesdata.to_feather(filename, compression_level=9, compression='lz4')
def trades_append(self, pair: str, data: TradeList):
"""
@@ -116,14 +115,13 @@ class FeatherDataHandler(IDataHandler):
:param timerange: Timerange to load trades for - currently not implemented
:return: List of trades
"""
- raise NotImplementedError()
- # filename = self._pair_trades_filename(self._datadir, pair)
- # tradesdata = misc.file_load_json(filename)
+ filename = self._pair_trades_filename(self._datadir, pair)
+ if not filename.exists():
+ return []
- # if not tradesdata:
- # return []
+ tradesdata = read_feather(filename)
- # return tradesdata
+ return tradesdata.values.tolist()
@classmethod
def _get_file_extension(cls):
diff --git a/freqtrade/exchange/binance.py b/freqtrade/exchange/binance.py
index a89c02631..7ac496f62 100644
--- a/freqtrade/exchange/binance.py
+++ b/freqtrade/exchange/binance.py
@@ -7,7 +7,6 @@ from typing import Dict, List, Optional, Tuple
import arrow
import ccxt
-from freqtrade.constants import BuySell
from freqtrade.enums import CandleType, MarginMode, PriceType, TradingMode
from freqtrade.exceptions import DDosProtection, OperationalException, TemporaryError
from freqtrade.exchange import Exchange
@@ -49,26 +48,6 @@ class Binance(Exchange):
(TradingMode.FUTURES, MarginMode.ISOLATED)
]
- def _get_params(
- self,
- side: BuySell,
- ordertype: str,
- leverage: float,
- reduceOnly: bool,
- time_in_force: str = 'GTC',
- ) -> Dict:
- params = super()._get_params(side, ordertype, leverage, reduceOnly, time_in_force)
- if (
- time_in_force == 'PO'
- and ordertype != 'market'
- and self.trading_mode == TradingMode.SPOT
- # Only spot can do post only orders
- ):
- params.pop('timeInForce')
- params['postOnly'] = True
-
- return params
-
def get_tickers(self, symbols: Optional[List[str]] = None, cached: bool = False) -> Tickers:
tickers = super().get_tickers(symbols=symbols, cached=cached)
if self.trading_mode == TradingMode.FUTURES:
diff --git a/freqtrade/exchange/binance_leverage_tiers.json b/freqtrade/exchange/binance_leverage_tiers.json
index 07fdcb5a4..597db27ff 100644
--- a/freqtrade/exchange/binance_leverage_tiers.json
+++ b/freqtrade/exchange/binance_leverage_tiers.json
@@ -999,15 +999,15 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 10000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "2",
"initialLeverage": "50",
"notionalCap": "10000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0065",
- "cum": "7.5"
+ "maintMarginRatio": "0.006",
+ "cum": "5.0"
}
},
{
@@ -1023,7 +1023,7 @@
"notionalCap": "50000",
"notionalFloor": "10000",
"maintMarginRatio": "0.01",
- "cum": "42.5"
+ "cum": "45.0"
}
},
{
@@ -1039,7 +1039,7 @@
"notionalCap": "250000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
- "cum": "542.5"
+ "cum": "545.0"
}
},
{
@@ -1055,77 +1055,77 @@
"notionalCap": "1000000",
"notionalFloor": "250000",
"maintMarginRatio": "0.05",
- "cum": "8042.5"
+ "cum": "8045.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
+ "notionalCap": "5000000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.1",
- "cum": "58042.5"
+ "cum": "58045.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 5000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "5000000",
"maintMarginRatio": "0.125",
- "cum": "108042.5"
+ "cum": "183045.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
"maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
"maintMarginRatio": "0.15",
- "cum": "233042.5"
+ "cum": "433045.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 20000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "9",
"initialLeverage": "2",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "20000000",
"maintMarginRatio": "0.25",
- "cum": "1233042.5"
+ "cum": "2433045.0"
}
},
{
"tier": 10.0,
"currency": "USDT",
- "minNotional": 20000000.0,
+ "minNotional": 30000000.0,
"maxNotional": 50000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
@@ -1133,9 +1133,9 @@
"bracket": "10",
"initialLeverage": "1",
"notionalCap": "50000000",
- "notionalFloor": "20000000",
+ "notionalFloor": "30000000",
"maintMarginRatio": "0.5",
- "cum": "6233042.5"
+ "cum": "9933045.0"
}
}
],
@@ -1274,13 +1274,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 200000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "3",
"initialLeverage": "10",
- "notionalCap": "200000",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -1289,65 +1289,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 200000.0,
- "maxNotional": 500000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "500000",
- "notionalFloor": "200000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "10650.0"
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 500000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "5",
"initialLeverage": "4",
- "notionalCap": "1000000",
- "notionalFloor": "500000",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "23150.0"
+ "cum": "70650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "6",
"initialLeverage": "2",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
"maintMarginRatio": "0.25",
- "cum": "148150.0"
+ "cum": "320650.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 3000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "7",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "3000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "898150.0"
+ "cum": "1820650.0"
}
}
],
@@ -2304,10 +2304,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -2320,10 +2320,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -2334,13 +2334,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -2349,49 +2349,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "70650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "1820650.0"
}
}
],
@@ -2546,13 +2562,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 300000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.02,
"maxLeverage": 20.0,
"info": {
"bracket": "3",
"initialLeverage": "20",
- "notionalCap": "300000",
+ "notionalCap": "900000",
"notionalFloor": "25000",
"maintMarginRatio": "0.02",
"cum": "150.0"
@@ -2561,39 +2577,39 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 300000.0,
- "maxNotional": 1200000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 1800000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "4",
"initialLeverage": "10",
- "notionalCap": "1200000",
- "notionalFloor": "300000",
+ "notionalCap": "1800000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.05",
- "cum": "9150.0"
+ "cum": "27150.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 1200000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 1800000.0,
+ "maxNotional": 4800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "5",
"initialLeverage": "5",
- "notionalCap": "3000000",
- "notionalFloor": "1200000",
+ "notionalCap": "4800000",
+ "notionalFloor": "1800000",
"maintMarginRatio": "0.1",
- "cum": "69150.0"
+ "cum": "117150.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 3000000.0,
+ "minNotional": 4800000.0,
"maxNotional": 6000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
@@ -2601,9 +2617,9 @@
"bracket": "6",
"initialLeverage": "4",
"notionalCap": "6000000",
- "notionalFloor": "3000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.125",
- "cum": "144150.0"
+ "cum": "237150.0"
}
},
{
@@ -2619,7 +2635,7 @@
"notionalCap": "18000000",
"notionalFloor": "6000000",
"maintMarginRatio": "0.25",
- "cum": "894150.0"
+ "cum": "987150.0"
}
},
{
@@ -2635,7 +2651,7 @@
"notionalCap": "30000000",
"notionalFloor": "18000000",
"maintMarginRatio": "0.5",
- "cum": "5394150.0"
+ "cum": "5487150.0"
}
}
],
@@ -2737,6 +2753,136 @@
}
}
],
+ "ARB/USDT:USDT": [
+ {
+ "tier": 1.0,
+ "currency": "USDT",
+ "minNotional": 0.0,
+ "maxNotional": 5000.0,
+ "maintenanceMarginRate": 0.006,
+ "maxLeverage": 50.0,
+ "info": {
+ "bracket": "1",
+ "initialLeverage": "50",
+ "notionalCap": "5000",
+ "notionalFloor": "0",
+ "maintMarginRatio": "0.006",
+ "cum": "0.0"
+ }
+ },
+ {
+ "tier": 2.0,
+ "currency": "USDT",
+ "minNotional": 5000.0,
+ "maxNotional": 50000.0,
+ "maintenanceMarginRate": 0.01,
+ "maxLeverage": 25.0,
+ "info": {
+ "bracket": "2",
+ "initialLeverage": "25",
+ "notionalCap": "50000",
+ "notionalFloor": "5000",
+ "maintMarginRatio": "0.01",
+ "cum": "20.0"
+ }
+ },
+ {
+ "tier": 3.0,
+ "currency": "USDT",
+ "minNotional": 50000.0,
+ "maxNotional": 400000.0,
+ "maintenanceMarginRate": 0.025,
+ "maxLeverage": 20.0,
+ "info": {
+ "bracket": "3",
+ "initialLeverage": "20",
+ "notionalCap": "400000",
+ "notionalFloor": "50000",
+ "maintMarginRatio": "0.025",
+ "cum": "770.0"
+ }
+ },
+ {
+ "tier": 4.0,
+ "currency": "USDT",
+ "minNotional": 400000.0,
+ "maxNotional": 800000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
+ "info": {
+ "bracket": "4",
+ "initialLeverage": "10",
+ "notionalCap": "800000",
+ "notionalFloor": "400000",
+ "maintMarginRatio": "0.05",
+ "cum": "10770.0"
+ }
+ },
+ {
+ "tier": 5.0,
+ "currency": "USDT",
+ "minNotional": 800000.0,
+ "maxNotional": 2000000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
+ "info": {
+ "bracket": "5",
+ "initialLeverage": "5",
+ "notionalCap": "2000000",
+ "notionalFloor": "800000",
+ "maintMarginRatio": "0.1",
+ "cum": "50770.0"
+ }
+ },
+ {
+ "tier": 6.0,
+ "currency": "USDT",
+ "minNotional": 2000000.0,
+ "maxNotional": 5000000.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "4",
+ "notionalCap": "5000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.125",
+ "cum": "100770.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 5000000.0,
+ "maxNotional": 12000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "7",
+ "initialLeverage": "2",
+ "notionalCap": "12000000",
+ "notionalFloor": "5000000",
+ "maintMarginRatio": "0.25",
+ "cum": "725770.0"
+ }
+ },
+ {
+ "tier": 8.0,
+ "currency": "USDT",
+ "minNotional": 12000000.0,
+ "maxNotional": 20000000.0,
+ "maintenanceMarginRate": 0.5,
+ "maxLeverage": 1.0,
+ "info": {
+ "bracket": "8",
+ "initialLeverage": "1",
+ "notionalCap": "20000000",
+ "notionalFloor": "12000000",
+ "maintMarginRatio": "0.5",
+ "cum": "3725770.0"
+ }
+ }
+ ],
"ARPA/USDT:USDT": [
{
"tier": 1.0,
@@ -2760,10 +2906,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 15.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "15",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -2774,13 +2920,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -2789,49 +2935,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "70650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "1820650.0"
}
}
],
@@ -3639,14 +3801,14 @@
"currency": "USDT",
"minNotional": 0.0,
"maxNotional": 5000.0,
- "maintenanceMarginRate": 0.0065,
- "maxLeverage": 25.0,
+ "maintenanceMarginRate": 0.006,
+ "maxLeverage": 50.0,
"info": {
"bracket": "1",
- "initialLeverage": "25",
+ "initialLeverage": "50",
"notionalCap": "5000",
"notionalFloor": "0",
- "maintMarginRatio": "0.0065",
+ "maintMarginRatio": "0.006",
"cum": "0.0"
}
},
@@ -3655,14 +3817,14 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 25000.0,
- "maintenanceMarginRate": 0.0075,
- "maxLeverage": 20.0,
+ "maintenanceMarginRate": 0.007,
+ "maxLeverage": 30.0,
"info": {
"bracket": "2",
- "initialLeverage": "20",
+ "initialLeverage": "30",
"notionalCap": "25000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0075",
+ "maintMarginRatio": "0.007",
"cum": "5.0"
}
},
@@ -3670,70 +3832,70 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 50000.0,
+ "maxNotional": 400000.0,
"maintenanceMarginRate": 0.01,
- "maxLeverage": 18.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "3",
- "initialLeverage": "18",
- "notionalCap": "50000",
+ "initialLeverage": "25",
+ "notionalCap": "400000",
"notionalFloor": "25000",
"maintMarginRatio": "0.01",
- "cum": "67.5"
+ "cum": "80.0"
}
},
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 50000.0,
- "maxNotional": 250000.0,
+ "minNotional": 400000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 15.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "4",
- "initialLeverage": "15",
- "notionalCap": "250000",
- "notionalFloor": "50000",
+ "initialLeverage": "20",
+ "notionalCap": "600000",
+ "notionalFloor": "400000",
"maintMarginRatio": "0.02",
- "cum": "567.5"
+ "cum": "4080.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1200000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "5",
"initialLeverage": "10",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "notionalCap": "1200000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.05",
- "cum": "8067.5"
+ "cum": "22080.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "minNotional": 1200000.0,
+ "maxNotional": 3200000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
- "notionalFloor": "1000000",
+ "notionalCap": "3200000",
+ "notionalFloor": "1200000",
"maintMarginRatio": "0.1",
- "cum": "58067.5"
+ "cum": "82080.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
+ "minNotional": 3200000.0,
"maxNotional": 5000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
@@ -3741,9 +3903,9 @@
"bracket": "7",
"initialLeverage": "4",
"notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalFloor": "3200000",
"maintMarginRatio": "0.125",
- "cum": "108067.5"
+ "cum": "162080.0"
}
},
{
@@ -3751,15 +3913,15 @@
"currency": "USDT",
"minNotional": 5000000.0,
"maxNotional": 10000000.0,
- "maintenanceMarginRate": 0.1665,
+ "maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
"notionalCap": "10000000",
"notionalFloor": "5000000",
- "maintMarginRatio": "0.1665",
- "cum": "315567.5"
+ "maintMarginRatio": "0.15",
+ "cum": "287080.0"
}
},
{
@@ -3775,7 +3937,7 @@
"notionalCap": "15000000",
"notionalFloor": "10000000",
"maintMarginRatio": "0.25",
- "cum": "1150567.5"
+ "cum": "1287080.0"
}
},
{
@@ -3791,7 +3953,7 @@
"notionalCap": "20000000",
"notionalFloor": "15000000",
"maintMarginRatio": "0.5",
- "cum": "4900567.5"
+ "cum": "5037080.0"
}
}
],
@@ -4763,15 +4925,15 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 10000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "2",
"initialLeverage": "50",
"notionalCap": "10000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0065",
- "cum": "7.5"
+ "maintMarginRatio": "0.006",
+ "cum": "5.0"
}
},
{
@@ -4787,7 +4949,7 @@
"notionalCap": "50000",
"notionalFloor": "10000",
"maintMarginRatio": "0.01",
- "cum": "42.5"
+ "cum": "45.0"
}
},
{
@@ -4803,7 +4965,7 @@
"notionalCap": "250000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
- "cum": "542.5"
+ "cum": "545.0"
}
},
{
@@ -4819,77 +4981,77 @@
"notionalCap": "1000000",
"notionalFloor": "250000",
"maintMarginRatio": "0.05",
- "cum": "8042.5"
+ "cum": "8045.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
+ "notionalCap": "5000000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.1",
- "cum": "58042.5"
+ "cum": "58045.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 5000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "5000000",
"maintMarginRatio": "0.125",
- "cum": "108042.5"
+ "cum": "183045.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
"maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
"maintMarginRatio": "0.15",
- "cum": "233042.5"
+ "cum": "433045.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 20000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "9",
"initialLeverage": "2",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "20000000",
"maintMarginRatio": "0.25",
- "cum": "1233042.5"
+ "cum": "2433045.0"
}
},
{
"tier": 10.0,
"currency": "USDT",
- "minNotional": 20000000.0,
+ "minNotional": 30000000.0,
"maxNotional": 50000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
@@ -4897,9 +5059,9 @@
"bracket": "10",
"initialLeverage": "1",
"notionalCap": "50000000",
- "notionalFloor": "20000000",
+ "notionalFloor": "30000000",
"maintMarginRatio": "0.5",
- "cum": "6233042.5"
+ "cum": "9933045.0"
}
}
],
@@ -5439,6 +5601,120 @@
}
}
],
+ "BTC/USDT:USDT-230630": [
+ {
+ "tier": 1.0,
+ "currency": "USDT",
+ "minNotional": 0.0,
+ "maxNotional": 375000.0,
+ "maintenanceMarginRate": 0.02,
+ "maxLeverage": 25.0,
+ "info": {
+ "bracket": "1",
+ "initialLeverage": "25",
+ "notionalCap": "375000",
+ "notionalFloor": "0",
+ "maintMarginRatio": "0.02",
+ "cum": "0.0"
+ }
+ },
+ {
+ "tier": 2.0,
+ "currency": "USDT",
+ "minNotional": 375000.0,
+ "maxNotional": 2000000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
+ "info": {
+ "bracket": "2",
+ "initialLeverage": "10",
+ "notionalCap": "2000000",
+ "notionalFloor": "375000",
+ "maintMarginRatio": "0.05",
+ "cum": "11250.0"
+ }
+ },
+ {
+ "tier": 3.0,
+ "currency": "USDT",
+ "minNotional": 2000000.0,
+ "maxNotional": 4000000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
+ "info": {
+ "bracket": "3",
+ "initialLeverage": "5",
+ "notionalCap": "4000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.1",
+ "cum": "111250.0"
+ }
+ },
+ {
+ "tier": 4.0,
+ "currency": "USDT",
+ "minNotional": 4000000.0,
+ "maxNotional": 10000000.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
+ "info": {
+ "bracket": "4",
+ "initialLeverage": "4",
+ "notionalCap": "10000000",
+ "notionalFloor": "4000000",
+ "maintMarginRatio": "0.125",
+ "cum": "211250.0"
+ }
+ },
+ {
+ "tier": 5.0,
+ "currency": "USDT",
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
+ "maintenanceMarginRate": 0.15,
+ "maxLeverage": 3.0,
+ "info": {
+ "bracket": "5",
+ "initialLeverage": "3",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
+ "maintMarginRatio": "0.15",
+ "cum": "461250.0"
+ }
+ },
+ {
+ "tier": 6.0,
+ "currency": "USDT",
+ "minNotional": 20000000.0,
+ "maxNotional": 40000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "40000000",
+ "notionalFloor": "20000000",
+ "maintMarginRatio": "0.25",
+ "cum": "2461250.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 40000000.0,
+ "maxNotional": 400000000.0,
+ "maintenanceMarginRate": 0.5,
+ "maxLeverage": 1.0,
+ "info": {
+ "bracket": "7",
+ "initialLeverage": "1",
+ "notionalCap": "400000000",
+ "notionalFloor": "40000000",
+ "maintMarginRatio": "0.5",
+ "cum": "1.246125E7"
+ }
+ }
+ ],
"BTCDOM/USDT:USDT": [
{
"tier": 1.0,
@@ -5936,10 +6212,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -5952,10 +6228,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -5966,13 +6242,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -5981,49 +6257,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "70650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "1820650.0"
}
}
],
@@ -6980,10 +7272,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -6996,10 +7288,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -7010,13 +7302,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 300000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "300000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -7025,33 +7317,33 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 300000.0,
+ "maxNotional": 800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "800000",
+ "notionalFloor": "300000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "15650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
+ "minNotional": 800000.0,
"maxNotional": 1000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
+ "initialLeverage": "4",
"notionalCap": "1000000",
- "notionalFloor": "250000",
+ "notionalFloor": "800000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "35650.0"
}
},
{
@@ -7059,15 +7351,31 @@
"currency": "USDT",
"minNotional": 1000000.0,
"maxNotional": 3000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "3000000",
+ "notionalFloor": "1000000",
+ "maintMarginRatio": "0.25",
+ "cum": "160650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 3000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "5000000",
+ "notionalFloor": "3000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "910650.0"
}
}
],
@@ -7160,10 +7468,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "10",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -7176,10 +7484,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 8.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "8",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -7192,10 +7500,10 @@
"minNotional": 25000.0,
"maxNotional": 100000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 6.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
+ "initialLeverage": "6",
"notionalCap": "100000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
@@ -7222,13 +7530,13 @@
"tier": 5.0,
"currency": "BUSD",
"minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "maxNotional": 500000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 2.0,
"info": {
"bracket": "5",
"initialLeverage": "2",
- "notionalCap": "1000000",
+ "notionalCap": "500000",
"notionalFloor": "250000",
"maintMarginRatio": "0.125",
"cum": "11900.0"
@@ -7237,17 +7545,17 @@
{
"tier": 6.0,
"currency": "BUSD",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 500000.0,
+ "maxNotional": 1000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "6",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalCap": "1000000",
+ "notionalFloor": "500000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "199400.0"
}
}
],
@@ -7340,10 +7648,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -7356,10 +7664,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -7370,13 +7678,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -7385,49 +7693,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "70650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "1820650.0"
}
}
],
@@ -7634,10 +7958,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 15.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "15",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -7650,10 +7974,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -7664,13 +7988,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 200000.0,
+ "maxNotional": 300000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "200000",
+ "initialLeverage": "10",
+ "notionalCap": "300000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -7679,49 +8003,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 200000.0,
- "maxNotional": 500000.0,
+ "minNotional": 300000.0,
+ "maxNotional": 800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "500000",
- "notionalFloor": "200000",
+ "notionalCap": "800000",
+ "notionalFloor": "300000",
"maintMarginRatio": "0.1",
- "cum": "10650.0"
+ "cum": "15650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 500000.0,
+ "minNotional": 800000.0,
"maxNotional": 1000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
+ "initialLeverage": "4",
"notionalCap": "1000000",
- "notionalFloor": "500000",
+ "notionalFloor": "800000",
"maintMarginRatio": "0.125",
- "cum": "23150.0"
+ "cum": "35650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
+ "maxNotional": 3000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "3000000",
+ "notionalFloor": "1000000",
+ "maintMarginRatio": "0.25",
+ "cum": "160650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 3000000.0,
"maxNotional": 5000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
"notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalFloor": "3000000",
"maintMarginRatio": "0.5",
- "cum": "398150.0"
+ "cum": "910650.0"
}
}
],
@@ -8025,14 +8365,14 @@
"currency": "USDT",
"minNotional": 0.0,
"maxNotional": 5000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "1",
"initialLeverage": "50",
"notionalCap": "5000",
"notionalFloor": "0",
- "maintMarginRatio": "0.0065",
+ "maintMarginRatio": "0.006",
"cum": "0.0"
}
},
@@ -8041,14 +8381,14 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 25000.0,
- "maintenanceMarginRate": 0.0075,
+ "maintenanceMarginRate": 0.007,
"maxLeverage": 40.0,
"info": {
"bracket": "2",
"initialLeverage": "40",
"notionalCap": "25000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0075",
+ "maintMarginRatio": "0.007",
"cum": "5.0"
}
},
@@ -8056,112 +8396,112 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 50000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.01,
"maxLeverage": 25.0,
"info": {
"bracket": "3",
"initialLeverage": "25",
- "notionalCap": "50000",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.01",
- "cum": "67.5"
+ "cum": "80.0"
}
},
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 50000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.025,
"maxLeverage": 20.0,
"info": {
"bracket": "4",
"initialLeverage": "20",
- "notionalCap": "250000",
- "notionalFloor": "50000",
+ "notionalCap": "900000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.025",
- "cum": "817.5"
+ "cum": "9080.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 1800000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "5",
"initialLeverage": "10",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "notionalCap": "1800000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.05",
- "cum": "7067.5"
+ "cum": "31580.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "minNotional": 1800000.0,
+ "maxNotional": 4800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
- "notionalFloor": "1000000",
+ "notionalCap": "4800000",
+ "notionalFloor": "1800000",
"maintMarginRatio": "0.1",
- "cum": "57067.5"
+ "cum": "121580.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 4800000.0,
+ "maxNotional": 6000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "6000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.125",
- "cum": "107067.5"
+ "cum": "241580.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 6000000.0,
+ "maxNotional": 18000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "8",
"initialLeverage": "2",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "18000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.25",
- "cum": "732067.5"
+ "cum": "991580.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 18000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "9",
"initialLeverage": "1",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "18000000",
"maintMarginRatio": "0.5",
- "cum": "3232067.5"
+ "cum": "5491580.0"
}
}
],
@@ -8706,13 +9046,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "3",
"initialLeverage": "10",
- "notionalCap": "100000",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "700.0"
@@ -8721,49 +9061,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5700.0"
+ "cum": "30700.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11950.0"
+ "cum": "70700.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 50000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320700.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "50000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386950.0"
+ "cum": "1820700.0"
}
}
],
@@ -9017,15 +9373,15 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 10000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "2",
"initialLeverage": "50",
"notionalCap": "10000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0065",
- "cum": "7.5"
+ "maintMarginRatio": "0.006",
+ "cum": "5.0"
}
},
{
@@ -9041,7 +9397,7 @@
"notionalCap": "50000",
"notionalFloor": "10000",
"maintMarginRatio": "0.01",
- "cum": "42.5"
+ "cum": "45.0"
}
},
{
@@ -9057,7 +9413,7 @@
"notionalCap": "250000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
- "cum": "542.5"
+ "cum": "545.0"
}
},
{
@@ -9073,77 +9429,77 @@
"notionalCap": "1000000",
"notionalFloor": "250000",
"maintMarginRatio": "0.05",
- "cum": "8042.5"
+ "cum": "8045.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
+ "notionalCap": "5000000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.1",
- "cum": "58042.5"
+ "cum": "58045.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 5000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "5000000",
"maintMarginRatio": "0.125",
- "cum": "108042.5"
+ "cum": "183045.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
"maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
"maintMarginRatio": "0.15",
- "cum": "233042.5"
+ "cum": "433045.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 20000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "9",
"initialLeverage": "2",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "20000000",
"maintMarginRatio": "0.25",
- "cum": "1233042.5"
+ "cum": "2433045.0"
}
},
{
"tier": 10.0,
"currency": "USDT",
- "minNotional": 20000000.0,
+ "minNotional": 30000000.0,
"maxNotional": 50000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
@@ -9151,9 +9507,9 @@
"bracket": "10",
"initialLeverage": "1",
"notionalCap": "50000000",
- "notionalFloor": "20000000",
+ "notionalFloor": "30000000",
"maintMarginRatio": "0.5",
- "cum": "6233042.5"
+ "cum": "9933045.0"
}
}
],
@@ -9277,15 +9633,15 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 10000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "2",
"initialLeverage": "50",
"notionalCap": "10000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0065",
- "cum": "7.5"
+ "maintMarginRatio": "0.006",
+ "cum": "5.0"
}
},
{
@@ -9301,7 +9657,7 @@
"notionalCap": "50000",
"notionalFloor": "10000",
"maintMarginRatio": "0.01",
- "cum": "42.5"
+ "cum": "45.0"
}
},
{
@@ -9317,7 +9673,7 @@
"notionalCap": "250000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
- "cum": "542.5"
+ "cum": "545.0"
}
},
{
@@ -9333,77 +9689,77 @@
"notionalCap": "1000000",
"notionalFloor": "250000",
"maintMarginRatio": "0.05",
- "cum": "8042.5"
+ "cum": "8045.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
+ "notionalCap": "5000000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.1",
- "cum": "58042.5"
+ "cum": "58045.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 5000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "5000000",
"maintMarginRatio": "0.125",
- "cum": "108042.5"
+ "cum": "183045.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
"maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
"maintMarginRatio": "0.15",
- "cum": "233042.5"
+ "cum": "433045.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 20000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "9",
"initialLeverage": "2",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "20000000",
"maintMarginRatio": "0.25",
- "cum": "1233042.5"
+ "cum": "2433045.0"
}
},
{
"tier": 10.0,
"currency": "USDT",
- "minNotional": 20000000.0,
+ "minNotional": 30000000.0,
"maxNotional": 50000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
@@ -9411,9 +9767,9 @@
"bracket": "10",
"initialLeverage": "1",
"notionalCap": "50000000",
- "notionalFloor": "20000000",
+ "notionalFloor": "30000000",
"maintMarginRatio": "0.5",
- "cum": "6233042.5"
+ "cum": "9933045.0"
}
}
],
@@ -9855,6 +10211,120 @@
}
}
],
+ "ETH/USDT:USDT-230630": [
+ {
+ "tier": 1.0,
+ "currency": "USDT",
+ "minNotional": 0.0,
+ "maxNotional": 375000.0,
+ "maintenanceMarginRate": 0.02,
+ "maxLeverage": 25.0,
+ "info": {
+ "bracket": "1",
+ "initialLeverage": "25",
+ "notionalCap": "375000",
+ "notionalFloor": "0",
+ "maintMarginRatio": "0.02",
+ "cum": "0.0"
+ }
+ },
+ {
+ "tier": 2.0,
+ "currency": "USDT",
+ "minNotional": 375000.0,
+ "maxNotional": 2000000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
+ "info": {
+ "bracket": "2",
+ "initialLeverage": "10",
+ "notionalCap": "2000000",
+ "notionalFloor": "375000",
+ "maintMarginRatio": "0.05",
+ "cum": "11250.0"
+ }
+ },
+ {
+ "tier": 3.0,
+ "currency": "USDT",
+ "minNotional": 2000000.0,
+ "maxNotional": 4000000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
+ "info": {
+ "bracket": "3",
+ "initialLeverage": "5",
+ "notionalCap": "4000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.1",
+ "cum": "111250.0"
+ }
+ },
+ {
+ "tier": 4.0,
+ "currency": "USDT",
+ "minNotional": 4000000.0,
+ "maxNotional": 10000000.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
+ "info": {
+ "bracket": "4",
+ "initialLeverage": "4",
+ "notionalCap": "10000000",
+ "notionalFloor": "4000000",
+ "maintMarginRatio": "0.125",
+ "cum": "211250.0"
+ }
+ },
+ {
+ "tier": 5.0,
+ "currency": "USDT",
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
+ "maintenanceMarginRate": 0.15,
+ "maxLeverage": 3.0,
+ "info": {
+ "bracket": "5",
+ "initialLeverage": "3",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
+ "maintMarginRatio": "0.15",
+ "cum": "461250.0"
+ }
+ },
+ {
+ "tier": 6.0,
+ "currency": "USDT",
+ "minNotional": 20000000.0,
+ "maxNotional": 40000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "40000000",
+ "notionalFloor": "20000000",
+ "maintMarginRatio": "0.25",
+ "cum": "2461250.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 40000000.0,
+ "maxNotional": 400000000.0,
+ "maintenanceMarginRate": 0.5,
+ "maxLeverage": 1.0,
+ "info": {
+ "bracket": "7",
+ "initialLeverage": "1",
+ "notionalCap": "400000000",
+ "notionalFloor": "40000000",
+ "maintMarginRatio": "0.5",
+ "cum": "1.246125E7"
+ }
+ }
+ ],
"FET/USDT:USDT": [
{
"tier": 1.0,
@@ -11036,10 +11506,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "10",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -11052,10 +11522,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 8.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "8",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -11068,10 +11538,10 @@
"minNotional": 25000.0,
"maxNotional": 100000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 6.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
+ "initialLeverage": "6",
"notionalCap": "100000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
@@ -11098,13 +11568,13 @@
"tier": 5.0,
"currency": "BUSD",
"minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "maxNotional": 500000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 2.0,
"info": {
"bracket": "5",
"initialLeverage": "2",
- "notionalCap": "1000000",
+ "notionalCap": "500000",
"notionalFloor": "250000",
"maintMarginRatio": "0.125",
"cum": "11900.0"
@@ -11113,17 +11583,17 @@
{
"tier": 6.0,
"currency": "BUSD",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 500000.0,
+ "maxNotional": 1000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "6",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "1000000",
+ "notionalFloor": "500000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "199400.0"
}
}
],
@@ -11329,14 +11799,14 @@
"currency": "USDT",
"minNotional": 0.0,
"maxNotional": 5000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "1",
"initialLeverage": "50",
"notionalCap": "5000",
"notionalFloor": "0",
- "maintMarginRatio": "0.0065",
+ "maintMarginRatio": "0.006",
"cum": "0.0"
}
},
@@ -11353,103 +11823,103 @@
"notionalCap": "50000",
"notionalFloor": "5000",
"maintMarginRatio": "0.01",
- "cum": "17.5"
+ "cum": "20.0"
}
},
{
"tier": 3.0,
"currency": "USDT",
"minNotional": 50000.0,
- "maxNotional": 200000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.025,
"maxLeverage": 20.0,
"info": {
"bracket": "3",
"initialLeverage": "20",
- "notionalCap": "200000",
+ "notionalCap": "900000",
"notionalFloor": "50000",
"maintMarginRatio": "0.025",
- "cum": "767.5"
+ "cum": "770.0"
}
},
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 200000.0,
- "maxNotional": 400000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 1800000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "4",
"initialLeverage": "10",
- "notionalCap": "400000",
- "notionalFloor": "200000",
+ "notionalCap": "1800000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.05",
- "cum": "5767.5"
+ "cum": "23270.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 400000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1800000.0,
+ "maxNotional": 4800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "5",
"initialLeverage": "5",
- "notionalCap": "1000000",
- "notionalFloor": "400000",
+ "notionalCap": "4800000",
+ "notionalFloor": "1800000",
"maintMarginRatio": "0.1",
- "cum": "25767.5"
+ "cum": "113270.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 4800000.0,
+ "maxNotional": 6000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "6",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalCap": "6000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.125",
- "cum": "50767.5"
+ "cum": "233270.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 6000000.0,
+ "minNotional": 6000000.0,
+ "maxNotional": 18000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "7",
"initialLeverage": "2",
- "notionalCap": "6000000",
- "notionalFloor": "5000000",
+ "notionalCap": "18000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.25",
- "cum": "675767.5"
+ "cum": "983270.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 6000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 18000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "8",
"initialLeverage": "1",
- "notionalCap": "10000000",
- "notionalFloor": "6000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "18000000",
"maintMarginRatio": "0.5",
- "cum": "2175767.5"
+ "cum": "5483270.0"
}
}
],
@@ -11672,10 +12142,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -11688,10 +12158,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 15.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "15",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -11702,13 +12172,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 480000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "3",
"initialLeverage": "10",
- "notionalCap": "100000",
+ "notionalCap": "480000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -11717,49 +12187,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 480000.0,
+ "maxNotional": 1280000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1280000",
+ "notionalFloor": "480000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "24650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1280000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "1600000",
+ "notionalFloor": "1280000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "56650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 4800000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "4800000",
+ "notionalFloor": "1600000",
+ "maintMarginRatio": "0.25",
+ "cum": "256650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 4800000.0,
+ "maxNotional": 8000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalCap": "8000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "1456650.0"
}
}
],
@@ -12194,10 +12680,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 15.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "1",
- "initialLeverage": "15",
+ "initialLeverage": "10",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -12210,10 +12696,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 8.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "8",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -12224,13 +12710,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 120000.0,
+ "maxNotional": 300000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 6.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "120000",
+ "initialLeverage": "6",
+ "notionalCap": "300000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -12239,49 +12725,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 120000.0,
- "maxNotional": 300000.0,
+ "minNotional": 300000.0,
+ "maxNotional": 800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "300000",
- "notionalFloor": "120000",
+ "notionalCap": "800000",
+ "notionalFloor": "300000",
"maintMarginRatio": "0.1",
- "cum": "6650.0"
+ "cum": "15650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 300000.0,
+ "minNotional": 800000.0,
"maxNotional": 1000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
+ "initialLeverage": "4",
"notionalCap": "1000000",
- "notionalFloor": "300000",
+ "notionalFloor": "800000",
"maintMarginRatio": "0.125",
- "cum": "14150.0"
+ "cum": "35650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "maxNotional": 1500000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "1500000",
+ "notionalFloor": "1000000",
+ "maintMarginRatio": "0.25",
+ "cum": "160650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 1500000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "2000000",
+ "notionalFloor": "1500000",
"maintMarginRatio": "0.5",
- "cum": "389150.0"
+ "cum": "535650.0"
}
}
],
@@ -12481,104 +12983,6 @@
}
}
],
- "ICP/BUSD:BUSD": [
- {
- "tier": 1.0,
- "currency": "BUSD",
- "minNotional": 0.0,
- "maxNotional": 5000.0,
- "maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
- "info": {
- "bracket": "1",
- "initialLeverage": "20",
- "notionalCap": "5000",
- "notionalFloor": "0",
- "maintMarginRatio": "0.02",
- "cum": "0.0"
- }
- },
- {
- "tier": 2.0,
- "currency": "BUSD",
- "minNotional": 5000.0,
- "maxNotional": 25000.0,
- "maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
- "info": {
- "bracket": "2",
- "initialLeverage": "10",
- "notionalCap": "25000",
- "notionalFloor": "5000",
- "maintMarginRatio": "0.025",
- "cum": "25.0"
- }
- },
- {
- "tier": 3.0,
- "currency": "BUSD",
- "minNotional": 25000.0,
- "maxNotional": 100000.0,
- "maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
- "info": {
- "bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
- "notionalFloor": "25000",
- "maintMarginRatio": "0.05",
- "cum": "650.0"
- }
- },
- {
- "tier": 4.0,
- "currency": "BUSD",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
- "maintenanceMarginRate": 0.1,
- "maxLeverage": 5.0,
- "info": {
- "bracket": "4",
- "initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
- "maintMarginRatio": "0.1",
- "cum": "5650.0"
- }
- },
- {
- "tier": 5.0,
- "currency": "BUSD",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
- "maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
- "info": {
- "bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
- "maintMarginRatio": "0.125",
- "cum": "11900.0"
- }
- },
- {
- "tier": 6.0,
- "currency": "BUSD",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
- "maintenanceMarginRate": 0.5,
- "maxLeverage": 1.0,
- "info": {
- "bracket": "6",
- "initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
- "maintMarginRatio": "0.5",
- "cum": "386900.0"
- }
- }
- ],
"ICP/USDT:USDT": [
{
"tier": 1.0,
@@ -12586,10 +12990,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.01,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.01",
@@ -12602,10 +13006,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -12616,13 +13020,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "700.0"
@@ -12631,49 +13035,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5700.0"
+ "cum": "30700.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11950.0"
+ "cum": "70700.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 30000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320700.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "30000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386950.0"
+ "cum": "1820700.0"
}
}
],
@@ -12775,105 +13195,7 @@
}
}
],
- "IMX/USDT:USDT": [
- {
- "tier": 1.0,
- "currency": "USDT",
- "minNotional": 0.0,
- "maxNotional": 5000.0,
- "maintenanceMarginRate": 0.01,
- "maxLeverage": 20.0,
- "info": {
- "bracket": "1",
- "initialLeverage": "20",
- "notionalCap": "5000",
- "notionalFloor": "0",
- "maintMarginRatio": "0.01",
- "cum": "0.0"
- }
- },
- {
- "tier": 2.0,
- "currency": "USDT",
- "minNotional": 5000.0,
- "maxNotional": 25000.0,
- "maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
- "info": {
- "bracket": "2",
- "initialLeverage": "10",
- "notionalCap": "25000",
- "notionalFloor": "5000",
- "maintMarginRatio": "0.025",
- "cum": "75.0"
- }
- },
- {
- "tier": 3.0,
- "currency": "USDT",
- "minNotional": 25000.0,
- "maxNotional": 100000.0,
- "maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
- "info": {
- "bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
- "notionalFloor": "25000",
- "maintMarginRatio": "0.05",
- "cum": "700.0"
- }
- },
- {
- "tier": 4.0,
- "currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
- "maintenanceMarginRate": 0.1,
- "maxLeverage": 5.0,
- "info": {
- "bracket": "4",
- "initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
- "maintMarginRatio": "0.1",
- "cum": "5700.0"
- }
- },
- {
- "tier": 5.0,
- "currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
- "maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
- "info": {
- "bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
- "maintMarginRatio": "0.125",
- "cum": "11950.0"
- }
- },
- {
- "tier": 6.0,
- "currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
- "maintenanceMarginRate": 0.5,
- "maxLeverage": 1.0,
- "info": {
- "bracket": "6",
- "initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
- "maintMarginRatio": "0.5",
- "cum": "386950.0"
- }
- }
- ],
- "INJ/USDT:USDT": [
+ "ID/USDT:USDT": [
{
"tier": 1.0,
"currency": "USDT",
@@ -12896,10 +13218,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 15.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "15",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -12910,13 +13232,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 200000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "200000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -12925,33 +13247,33 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 200000.0,
+ "maxNotional": 500000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "500000",
+ "notionalFloor": "200000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "10650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
+ "minNotional": 500000.0,
"maxNotional": 1000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
+ "initialLeverage": "4",
"notionalCap": "1000000",
- "notionalFloor": "250000",
+ "notionalFloor": "500000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "23150.0"
}
},
{
@@ -12959,15 +13281,259 @@
"currency": "USDT",
"minNotional": 1000000.0,
"maxNotional": 3000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "3000000",
+ "notionalFloor": "1000000",
+ "maintMarginRatio": "0.25",
+ "cum": "148150.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 3000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "5000000",
+ "notionalFloor": "3000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "898150.0"
+ }
+ }
+ ],
+ "IMX/USDT:USDT": [
+ {
+ "tier": 1.0,
+ "currency": "USDT",
+ "minNotional": 0.0,
+ "maxNotional": 5000.0,
+ "maintenanceMarginRate": 0.01,
+ "maxLeverage": 25.0,
+ "info": {
+ "bracket": "1",
+ "initialLeverage": "25",
+ "notionalCap": "5000",
+ "notionalFloor": "0",
+ "maintMarginRatio": "0.01",
+ "cum": "0.0"
+ }
+ },
+ {
+ "tier": 2.0,
+ "currency": "USDT",
+ "minNotional": 5000.0,
+ "maxNotional": 25000.0,
+ "maintenanceMarginRate": 0.025,
+ "maxLeverage": 20.0,
+ "info": {
+ "bracket": "2",
+ "initialLeverage": "20",
+ "notionalCap": "25000",
+ "notionalFloor": "5000",
+ "maintMarginRatio": "0.025",
+ "cum": "75.0"
+ }
+ },
+ {
+ "tier": 3.0,
+ "currency": "USDT",
+ "minNotional": 25000.0,
+ "maxNotional": 600000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
+ "info": {
+ "bracket": "3",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
+ "notionalFloor": "25000",
+ "maintMarginRatio": "0.05",
+ "cum": "700.0"
+ }
+ },
+ {
+ "tier": 4.0,
+ "currency": "USDT",
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
+ "info": {
+ "bracket": "4",
+ "initialLeverage": "5",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
+ "maintMarginRatio": "0.1",
+ "cum": "30700.0"
+ }
+ },
+ {
+ "tier": 5.0,
+ "currency": "USDT",
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
+ "info": {
+ "bracket": "5",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
+ "maintMarginRatio": "0.125",
+ "cum": "70700.0"
+ }
+ },
+ {
+ "tier": 6.0,
+ "currency": "USDT",
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320700.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
+ "maintenanceMarginRate": 0.5,
+ "maxLeverage": 1.0,
+ "info": {
+ "bracket": "7",
+ "initialLeverage": "1",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
+ "maintMarginRatio": "0.5",
+ "cum": "1820700.0"
+ }
+ }
+ ],
+ "INJ/USDT:USDT": [
+ {
+ "tier": 1.0,
+ "currency": "USDT",
+ "minNotional": 0.0,
+ "maxNotional": 5000.0,
+ "maintenanceMarginRate": 0.02,
+ "maxLeverage": 25.0,
+ "info": {
+ "bracket": "1",
+ "initialLeverage": "25",
+ "notionalCap": "5000",
+ "notionalFloor": "0",
+ "maintMarginRatio": "0.02",
+ "cum": "0.0"
+ }
+ },
+ {
+ "tier": 2.0,
+ "currency": "USDT",
+ "minNotional": 5000.0,
+ "maxNotional": 25000.0,
+ "maintenanceMarginRate": 0.025,
+ "maxLeverage": 20.0,
+ "info": {
+ "bracket": "2",
+ "initialLeverage": "20",
+ "notionalCap": "25000",
+ "notionalFloor": "5000",
+ "maintMarginRatio": "0.025",
+ "cum": "25.0"
+ }
+ },
+ {
+ "tier": 3.0,
+ "currency": "USDT",
+ "minNotional": 25000.0,
+ "maxNotional": 600000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
+ "info": {
+ "bracket": "3",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
+ "notionalFloor": "25000",
+ "maintMarginRatio": "0.05",
+ "cum": "650.0"
+ }
+ },
+ {
+ "tier": 4.0,
+ "currency": "USDT",
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
+ "info": {
+ "bracket": "4",
+ "initialLeverage": "5",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
+ "maintMarginRatio": "0.1",
+ "cum": "30650.0"
+ }
+ },
+ {
+ "tier": 5.0,
+ "currency": "USDT",
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
+ "info": {
+ "bracket": "5",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
+ "maintMarginRatio": "0.125",
+ "cum": "70650.0"
+ }
+ },
+ {
+ "tier": 6.0,
+ "currency": "USDT",
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
+ "maintenanceMarginRate": 0.5,
+ "maxLeverage": 1.0,
+ "info": {
+ "bracket": "7",
+ "initialLeverage": "1",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
+ "maintMarginRatio": "0.5",
+ "cum": "1820650.0"
}
}
],
@@ -14136,10 +14702,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -14152,10 +14718,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -14166,13 +14732,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "900000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -14181,49 +14747,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 2400000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "2400000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "45650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 2400000.0,
+ "maxNotional": 3000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "3000000",
+ "notionalFloor": "2400000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "105650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 3000000.0,
+ "maxNotional": 9000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "9000000",
+ "notionalFloor": "3000000",
+ "maintMarginRatio": "0.25",
+ "cum": "480650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 9000000.0,
+ "maxNotional": 15000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "15000000",
+ "notionalFloor": "9000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "2730650.0"
}
}
],
@@ -14363,15 +14945,15 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 10000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "2",
"initialLeverage": "50",
"notionalCap": "10000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0065",
- "cum": "7.5"
+ "maintMarginRatio": "0.006",
+ "cum": "5.0"
}
},
{
@@ -14387,7 +14969,7 @@
"notionalCap": "50000",
"notionalFloor": "10000",
"maintMarginRatio": "0.01",
- "cum": "42.5"
+ "cum": "45.0"
}
},
{
@@ -14403,7 +14985,7 @@
"notionalCap": "250000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
- "cum": "542.5"
+ "cum": "545.0"
}
},
{
@@ -14419,77 +15001,77 @@
"notionalCap": "1000000",
"notionalFloor": "250000",
"maintMarginRatio": "0.05",
- "cum": "8042.5"
+ "cum": "8045.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
+ "notionalCap": "5000000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.1",
- "cum": "58042.5"
+ "cum": "58045.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 5000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "5000000",
"maintMarginRatio": "0.125",
- "cum": "108042.5"
+ "cum": "183045.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
"maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
"maintMarginRatio": "0.15",
- "cum": "233042.5"
+ "cum": "433045.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 20000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "9",
"initialLeverage": "2",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "20000000",
"maintMarginRatio": "0.25",
- "cum": "1233042.5"
+ "cum": "2433045.0"
}
},
{
"tier": 10.0,
"currency": "USDT",
- "minNotional": 20000000.0,
+ "minNotional": 30000000.0,
"maxNotional": 50000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
@@ -14497,9 +15079,9 @@
"bracket": "10",
"initialLeverage": "1",
"notionalCap": "50000000",
- "notionalFloor": "20000000",
+ "notionalFloor": "30000000",
"maintMarginRatio": "0.5",
- "cum": "6233042.5"
+ "cum": "9933045.0"
}
}
],
@@ -15031,15 +15613,15 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 10000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "2",
"initialLeverage": "50",
"notionalCap": "10000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0065",
- "cum": "7.5"
+ "maintMarginRatio": "0.006",
+ "cum": "5.0"
}
},
{
@@ -15055,7 +15637,7 @@
"notionalCap": "50000",
"notionalFloor": "10000",
"maintMarginRatio": "0.01",
- "cum": "42.5"
+ "cum": "45.0"
}
},
{
@@ -15071,7 +15653,7 @@
"notionalCap": "250000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
- "cum": "542.5"
+ "cum": "545.0"
}
},
{
@@ -15087,77 +15669,77 @@
"notionalCap": "1000000",
"notionalFloor": "250000",
"maintMarginRatio": "0.05",
- "cum": "8042.5"
+ "cum": "8045.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
+ "notionalCap": "5000000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.1",
- "cum": "58042.5"
+ "cum": "58045.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 5000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "5000000",
"maintMarginRatio": "0.125",
- "cum": "108042.5"
+ "cum": "183045.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
"maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
"maintMarginRatio": "0.15",
- "cum": "233042.5"
+ "cum": "433045.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 20000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "9",
"initialLeverage": "2",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "20000000",
"maintMarginRatio": "0.25",
- "cum": "1233042.5"
+ "cum": "2433045.0"
}
},
{
"tier": 10.0,
"currency": "USDT",
- "minNotional": 20000000.0,
+ "minNotional": 30000000.0,
"maxNotional": 50000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
@@ -15165,107 +15747,9 @@
"bracket": "10",
"initialLeverage": "1",
"notionalCap": "50000000",
- "notionalFloor": "20000000",
+ "notionalFloor": "30000000",
"maintMarginRatio": "0.5",
- "cum": "6233042.5"
- }
- }
- ],
- "LUNA2/BUSD:BUSD": [
- {
- "tier": 1.0,
- "currency": "BUSD",
- "minNotional": 0.0,
- "maxNotional": 5000.0,
- "maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
- "info": {
- "bracket": "1",
- "initialLeverage": "20",
- "notionalCap": "5000",
- "notionalFloor": "0",
- "maintMarginRatio": "0.02",
- "cum": "0.0"
- }
- },
- {
- "tier": 2.0,
- "currency": "BUSD",
- "minNotional": 5000.0,
- "maxNotional": 25000.0,
- "maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
- "info": {
- "bracket": "2",
- "initialLeverage": "10",
- "notionalCap": "25000",
- "notionalFloor": "5000",
- "maintMarginRatio": "0.025",
- "cum": "25.0"
- }
- },
- {
- "tier": 3.0,
- "currency": "BUSD",
- "minNotional": 25000.0,
- "maxNotional": 100000.0,
- "maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
- "info": {
- "bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
- "notionalFloor": "25000",
- "maintMarginRatio": "0.05",
- "cum": "650.0"
- }
- },
- {
- "tier": 4.0,
- "currency": "BUSD",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
- "maintenanceMarginRate": 0.1,
- "maxLeverage": 5.0,
- "info": {
- "bracket": "4",
- "initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
- "maintMarginRatio": "0.1",
- "cum": "5650.0"
- }
- },
- {
- "tier": 5.0,
- "currency": "BUSD",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
- "maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
- "info": {
- "bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
- "maintMarginRatio": "0.125",
- "cum": "11900.0"
- }
- },
- {
- "tier": 6.0,
- "currency": "BUSD",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
- "maintenanceMarginRate": 0.5,
- "maxLeverage": 1.0,
- "info": {
- "bracket": "6",
- "initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
- "maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "9933045.0"
}
}
],
@@ -15617,14 +16101,14 @@
"currency": "USDT",
"minNotional": 0.0,
"maxNotional": 5000.0,
- "maintenanceMarginRate": 0.02,
- "maxLeverage": 25.0,
+ "maintenanceMarginRate": 0.01,
+ "maxLeverage": 50.0,
"info": {
"bracket": "1",
- "initialLeverage": "25",
+ "initialLeverage": "50",
"notionalCap": "5000",
"notionalFloor": "0",
- "maintMarginRatio": "0.02",
+ "maintMarginRatio": "0.01",
"cum": "0.0"
}
},
@@ -15633,95 +16117,111 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 25000.0,
- "maintenanceMarginRate": 0.025,
- "maxLeverage": 20.0,
+ "maintenanceMarginRate": 0.02,
+ "maxLeverage": 25.0,
"info": {
"bracket": "2",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "25000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.025",
- "cum": "25.0"
+ "maintMarginRatio": "0.02",
+ "cum": "50.0"
}
},
{
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 600000.0,
- "maintenanceMarginRate": 0.05,
- "maxLeverage": 10.0,
+ "maxNotional": 900000.0,
+ "maintenanceMarginRate": 0.025,
+ "maxLeverage": 20.0,
"info": {
"bracket": "3",
- "initialLeverage": "10",
- "notionalCap": "600000",
+ "initialLeverage": "20",
+ "notionalCap": "900000",
"notionalFloor": "25000",
- "maintMarginRatio": "0.05",
- "cum": "650.0"
+ "maintMarginRatio": "0.025",
+ "cum": "175.0"
}
},
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 600000.0,
- "maxNotional": 1600000.0,
- "maintenanceMarginRate": 0.1,
- "maxLeverage": 5.0,
+ "minNotional": 900000.0,
+ "maxNotional": 1800000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
"info": {
"bracket": "4",
- "initialLeverage": "5",
- "notionalCap": "1600000",
- "notionalFloor": "600000",
- "maintMarginRatio": "0.1",
- "cum": "30650.0"
+ "initialLeverage": "10",
+ "notionalCap": "1800000",
+ "notionalFloor": "900000",
+ "maintMarginRatio": "0.05",
+ "cum": "22675.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 1600000.0,
- "maxNotional": 3000000.0,
- "maintenanceMarginRate": 0.125,
- "maxLeverage": 4.0,
+ "minNotional": 1800000.0,
+ "maxNotional": 4800000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
"info": {
"bracket": "5",
- "initialLeverage": "4",
- "notionalCap": "3000000",
- "notionalFloor": "1600000",
- "maintMarginRatio": "0.125",
- "cum": "70650.0"
+ "initialLeverage": "5",
+ "notionalCap": "4800000",
+ "notionalFloor": "1800000",
+ "maintMarginRatio": "0.1",
+ "cum": "112675.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 3000000.0,
+ "minNotional": 4800000.0,
"maxNotional": 6000000.0,
- "maintenanceMarginRate": 0.25,
- "maxLeverage": 2.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
"info": {
"bracket": "6",
- "initialLeverage": "2",
+ "initialLeverage": "4",
"notionalCap": "6000000",
- "notionalFloor": "3000000",
- "maintMarginRatio": "0.25",
- "cum": "445650.0"
+ "notionalFloor": "4800000",
+ "maintMarginRatio": "0.125",
+ "cum": "232675.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
"minNotional": 6000000.0,
- "maxNotional": 10000000.0,
+ "maxNotional": 18000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "7",
+ "initialLeverage": "2",
+ "notionalCap": "18000000",
+ "notionalFloor": "6000000",
+ "maintMarginRatio": "0.25",
+ "cum": "982675.0"
+ }
+ },
+ {
+ "tier": 8.0,
+ "currency": "USDT",
+ "minNotional": 18000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "7",
+ "bracket": "8",
"initialLeverage": "1",
- "notionalCap": "10000000",
- "notionalFloor": "6000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "18000000",
"maintMarginRatio": "0.5",
- "cum": "1945650.0"
+ "cum": "5482675.0"
}
}
],
@@ -15876,13 +16376,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 50000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.01,
"maxLeverage": 25.0,
"info": {
"bracket": "3",
"initialLeverage": "25",
- "notionalCap": "50000",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.01",
"cum": "80.0"
@@ -15891,97 +16391,97 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 50000.0,
- "maxNotional": 400000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.025,
"maxLeverage": 20.0,
"info": {
"bracket": "4",
"initialLeverage": "20",
- "notionalCap": "400000",
- "notionalFloor": "50000",
+ "notionalCap": "900000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.025",
- "cum": "830.0"
+ "cum": "9080.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 400000.0,
- "maxNotional": 800000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 1800000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "5",
"initialLeverage": "10",
- "notionalCap": "800000",
- "notionalFloor": "400000",
+ "notionalCap": "1800000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.05",
- "cum": "10830.0"
+ "cum": "31580.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 800000.0,
- "maxNotional": 2000000.0,
+ "minNotional": 1800000.0,
+ "maxNotional": 4800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
- "notionalFloor": "800000",
+ "notionalCap": "4800000",
+ "notionalFloor": "1800000",
"maintMarginRatio": "0.1",
- "cum": "50830.0"
+ "cum": "121580.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 4800000.0,
+ "maxNotional": 6000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "6000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.125",
- "cum": "100830.0"
+ "cum": "241580.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 12000000.0,
+ "minNotional": 6000000.0,
+ "maxNotional": 18000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "8",
"initialLeverage": "2",
- "notionalCap": "12000000",
- "notionalFloor": "5000000",
+ "notionalCap": "18000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.25",
- "cum": "725830.0"
+ "cum": "991580.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 12000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 18000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "9",
"initialLeverage": "1",
- "notionalCap": "20000000",
- "notionalFloor": "12000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "18000000",
"maintMarginRatio": "0.5",
- "cum": "3725830.0"
+ "cum": "5491580.0"
}
}
],
@@ -16105,14 +16605,14 @@
"currency": "USDT",
"minNotional": 0.0,
"maxNotional": 5000.0,
- "maintenanceMarginRate": 0.01,
- "maxLeverage": 25.0,
+ "maintenanceMarginRate": 0.006,
+ "maxLeverage": 50.0,
"info": {
"bracket": "1",
- "initialLeverage": "25",
+ "initialLeverage": "50",
"notionalCap": "5000",
"notionalFloor": "0",
- "maintMarginRatio": "0.01",
+ "maintMarginRatio": "0.006",
"cum": "0.0"
}
},
@@ -16121,79 +16621,111 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 25000.0,
- "maintenanceMarginRate": 0.025,
- "maxLeverage": 20.0,
+ "maintenanceMarginRate": 0.01,
+ "maxLeverage": 25.0,
"info": {
"bracket": "2",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "25000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.025",
- "cum": "75.0"
+ "maintMarginRatio": "0.01",
+ "cum": "20.0"
}
},
{
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
- "maintenanceMarginRate": 0.05,
- "maxLeverage": 10.0,
+ "maxNotional": 450000.0,
+ "maintenanceMarginRate": 0.025,
+ "maxLeverage": 20.0,
"info": {
"bracket": "3",
- "initialLeverage": "10",
- "notionalCap": "100000",
+ "initialLeverage": "20",
+ "notionalCap": "450000",
"notionalFloor": "25000",
- "maintMarginRatio": "0.05",
- "cum": "700.0"
+ "maintMarginRatio": "0.025",
+ "cum": "395.0"
}
},
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
- "maintenanceMarginRate": 0.1,
- "maxLeverage": 5.0,
+ "minNotional": 450000.0,
+ "maxNotional": 900000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
"info": {
"bracket": "4",
- "initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
- "maintMarginRatio": "0.1",
- "cum": "5700.0"
+ "initialLeverage": "10",
+ "notionalCap": "900000",
+ "notionalFloor": "450000",
+ "maintMarginRatio": "0.05",
+ "cum": "11645.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
- "maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "minNotional": 900000.0,
+ "maxNotional": 2400000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
- "maintMarginRatio": "0.125",
- "cum": "11950.0"
+ "initialLeverage": "5",
+ "notionalCap": "2400000",
+ "notionalFloor": "900000",
+ "maintMarginRatio": "0.1",
+ "cum": "56645.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 2400000.0,
+ "maxNotional": 3000000.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "4",
+ "notionalCap": "3000000",
+ "notionalFloor": "2400000",
+ "maintMarginRatio": "0.125",
+ "cum": "116645.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 3000000.0,
+ "maxNotional": 9000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "7",
+ "initialLeverage": "2",
+ "notionalCap": "9000000",
+ "notionalFloor": "3000000",
+ "maintMarginRatio": "0.25",
+ "cum": "491645.0"
+ }
+ },
+ {
+ "tier": 8.0,
+ "currency": "USDT",
+ "minNotional": 9000000.0,
+ "maxNotional": 15000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "8",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalCap": "15000000",
+ "notionalFloor": "9000000",
"maintMarginRatio": "0.5",
- "cum": "386950.0"
+ "cum": "2741645.0"
}
}
],
@@ -16204,10 +16736,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -16220,10 +16752,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -16234,13 +16766,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -16249,49 +16781,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "70650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "1820650.0"
}
}
],
@@ -16968,13 +17516,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 8.0,
"info": {
"bracket": "3",
"initialLeverage": "8",
- "notionalCap": "100000",
+ "notionalCap": "900000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -16983,49 +17531,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 2400000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "2400000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "45650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 2400000.0,
+ "maxNotional": 3000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "3000000",
+ "notionalFloor": "2400000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "105650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 3000000.0,
+ "maxNotional": 9000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "9000000",
+ "notionalFloor": "3000000",
+ "maintMarginRatio": "0.25",
+ "cum": "480650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 9000000.0,
+ "maxNotional": 15000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "15000000",
+ "notionalFloor": "9000000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "2730650.0"
}
}
],
@@ -17164,13 +17728,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "3",
"initialLeverage": "10",
- "notionalCap": "100000",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "700.0"
@@ -17179,49 +17743,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5700.0"
+ "cum": "30700.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11950.0"
+ "cum": "70700.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320700.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386950.0"
+ "cum": "1820700.0"
}
}
],
@@ -18208,13 +18788,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 200000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "3",
"initialLeverage": "10",
- "notionalCap": "200000",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -18223,65 +18803,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 200000.0,
- "maxNotional": 500000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "500000",
- "notionalFloor": "200000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "10650.0"
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 500000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "5",
"initialLeverage": "4",
- "notionalCap": "1000000",
- "notionalFloor": "500000",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "23150.0"
+ "cum": "70650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "6",
"initialLeverage": "2",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
"maintMarginRatio": "0.25",
- "cum": "148150.0"
+ "cum": "320650.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 3000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "7",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "3000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "898150.0"
+ "cum": "1820650.0"
}
}
],
@@ -18290,80 +18870,112 @@
"tier": 1.0,
"currency": "USDT",
"minNotional": 0.0,
- "maxNotional": 25000.0,
- "maintenanceMarginRate": 0.03,
- "maxLeverage": 20.0,
+ "maxNotional": 5000.0,
+ "maintenanceMarginRate": 0.02,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
- "notionalCap": "25000",
+ "initialLeverage": "25",
+ "notionalCap": "5000",
"notionalFloor": "0",
- "maintMarginRatio": "0.03",
+ "maintMarginRatio": "0.02",
"cum": "0.0"
}
},
{
"tier": 2.0,
"currency": "USDT",
- "minNotional": 25000.0,
- "maxNotional": 100000.0,
- "maintenanceMarginRate": 0.05,
- "maxLeverage": 10.0,
+ "minNotional": 5000.0,
+ "maxNotional": 25000.0,
+ "maintenanceMarginRate": 0.025,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
- "notionalCap": "100000",
- "notionalFloor": "25000",
- "maintMarginRatio": "0.05",
- "cum": "500.0"
+ "initialLeverage": "20",
+ "notionalCap": "25000",
+ "notionalFloor": "5000",
+ "maintMarginRatio": "0.025",
+ "cum": "25.0"
}
},
{
"tier": 3.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
- "maintenanceMarginRate": 0.1,
- "maxLeverage": 5.0,
+ "minNotional": 25000.0,
+ "maxNotional": 600000.0,
+ "maintenanceMarginRate": 0.05,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
- "maintMarginRatio": "0.1",
- "cum": "5500.0"
+ "initialLeverage": "10",
+ "notionalCap": "600000",
+ "notionalFloor": "25000",
+ "maintMarginRatio": "0.05",
+ "cum": "650.0"
}
},
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
- "maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
+ "maintenanceMarginRate": 0.1,
+ "maxLeverage": 5.0,
"info": {
"bracket": "4",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
- "maintMarginRatio": "0.125",
- "cum": "11750.0"
+ "initialLeverage": "5",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
+ "maintMarginRatio": "0.1",
+ "cum": "30650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
+ "maintenanceMarginRate": 0.125,
+ "maxLeverage": 4.0,
+ "info": {
+ "bracket": "5",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
+ "maintMarginRatio": "0.125",
+ "cum": "70650.0"
+ }
+ },
+ {
+ "tier": 6.0,
+ "currency": "USDT",
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "5",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386750.0"
+ "cum": "1820650.0"
}
}
],
@@ -19678,10 +20290,10 @@
"minNotional": 50000.0,
"maxNotional": 150000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "2",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "150000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
@@ -19692,13 +20304,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 150000.0,
- "maxNotional": 250000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 15.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "3",
- "initialLeverage": "15",
- "notionalCap": "250000",
+ "initialLeverage": "20",
+ "notionalCap": "900000",
"notionalFloor": "150000",
"maintMarginRatio": "0.025",
"cum": "1250.0"
@@ -19707,81 +20319,81 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 1800000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "4",
"initialLeverage": "10",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "notionalCap": "1800000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.05",
- "cum": "7500.0"
+ "cum": "23750.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "minNotional": 1800000.0,
+ "maxNotional": 4800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "5",
"initialLeverage": "5",
- "notionalCap": "2000000",
- "notionalFloor": "1000000",
+ "notionalCap": "4800000",
+ "notionalFloor": "1800000",
"maintMarginRatio": "0.1",
- "cum": "57500.0"
+ "cum": "113750.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 4800000.0,
+ "maxNotional": 6000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "6",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "6000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.125",
- "cum": "107500.0"
+ "cum": "233750.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 6000000.0,
+ "maxNotional": 18000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "7",
"initialLeverage": "2",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "18000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.25",
- "cum": "732500.0"
+ "cum": "983750.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 18000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "8",
"initialLeverage": "1",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "18000000",
"maintMarginRatio": "0.5",
- "cum": "3232500.0"
+ "cum": "5483750.0"
}
}
],
@@ -20200,10 +20812,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "10",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -20216,10 +20828,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 8.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "8",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -20232,10 +20844,10 @@
"minNotional": 25000.0,
"maxNotional": 100000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 6.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
+ "initialLeverage": "6",
"notionalCap": "100000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
@@ -20278,13 +20890,13 @@
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "maxNotional": 1500000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "6",
"initialLeverage": "1",
- "notionalCap": "3000000",
+ "notionalCap": "1500000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.5",
"cum": "386900.0"
@@ -20526,10 +21138,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.01,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.01",
@@ -20542,10 +21154,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -20556,13 +21168,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 600000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "600000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "700.0"
@@ -20571,49 +21183,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 600000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1600000",
+ "notionalFloor": "600000",
"maintMarginRatio": "0.1",
- "cum": "5700.0"
+ "cum": "30700.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 2000000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "2000000",
+ "notionalFloor": "1600000",
"maintMarginRatio": "0.125",
- "cum": "11950.0"
+ "cum": "70700.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 2000000.0,
+ "maxNotional": 6000000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "6000000",
+ "notionalFloor": "2000000",
+ "maintMarginRatio": "0.25",
+ "cum": "320700.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 6000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "5000000",
- "notionalFloor": "1000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.5",
- "cum": "386950.0"
+ "cum": "1820700.0"
}
}
],
@@ -21146,10 +21774,10 @@
"minNotional": 0.0,
"maxNotional": 5000.0,
"maintenanceMarginRate": 0.02,
- "maxLeverage": 20.0,
+ "maxLeverage": 25.0,
"info": {
"bracket": "1",
- "initialLeverage": "20",
+ "initialLeverage": "25",
"notionalCap": "5000",
"notionalFloor": "0",
"maintMarginRatio": "0.02",
@@ -21162,10 +21790,10 @@
"minNotional": 5000.0,
"maxNotional": 25000.0,
"maintenanceMarginRate": 0.025,
- "maxLeverage": 10.0,
+ "maxLeverage": 20.0,
"info": {
"bracket": "2",
- "initialLeverage": "10",
+ "initialLeverage": "20",
"notionalCap": "25000",
"notionalFloor": "5000",
"maintMarginRatio": "0.025",
@@ -21176,13 +21804,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 25000.0,
- "maxNotional": 100000.0,
+ "maxNotional": 480000.0,
"maintenanceMarginRate": 0.05,
- "maxLeverage": 8.0,
+ "maxLeverage": 10.0,
"info": {
"bracket": "3",
- "initialLeverage": "8",
- "notionalCap": "100000",
+ "initialLeverage": "10",
+ "notionalCap": "480000",
"notionalFloor": "25000",
"maintMarginRatio": "0.05",
"cum": "650.0"
@@ -21191,49 +21819,65 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 100000.0,
- "maxNotional": 250000.0,
+ "minNotional": 480000.0,
+ "maxNotional": 1280000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "4",
"initialLeverage": "5",
- "notionalCap": "250000",
- "notionalFloor": "100000",
+ "notionalCap": "1280000",
+ "notionalFloor": "480000",
"maintMarginRatio": "0.1",
- "cum": "5650.0"
+ "cum": "24650.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "minNotional": 1280000.0,
+ "maxNotional": 1600000.0,
"maintenanceMarginRate": 0.125,
- "maxLeverage": 2.0,
+ "maxLeverage": 4.0,
"info": {
"bracket": "5",
- "initialLeverage": "2",
- "notionalCap": "1000000",
- "notionalFloor": "250000",
+ "initialLeverage": "4",
+ "notionalCap": "1600000",
+ "notionalFloor": "1280000",
"maintMarginRatio": "0.125",
- "cum": "11900.0"
+ "cum": "56650.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 1600000.0,
+ "maxNotional": 4800000.0,
+ "maintenanceMarginRate": 0.25,
+ "maxLeverage": 2.0,
+ "info": {
+ "bracket": "6",
+ "initialLeverage": "2",
+ "notionalCap": "4800000",
+ "notionalFloor": "1600000",
+ "maintMarginRatio": "0.25",
+ "cum": "256650.0"
+ }
+ },
+ {
+ "tier": 7.0,
+ "currency": "USDT",
+ "minNotional": 4800000.0,
+ "maxNotional": 8000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
- "bracket": "6",
+ "bracket": "7",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "8000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "1456650.0"
}
}
],
@@ -21942,13 +22586,13 @@
"tier": 3.0,
"currency": "USDT",
"minNotional": 50000.0,
- "maxNotional": 400000.0,
+ "maxNotional": 900000.0,
"maintenanceMarginRate": 0.025,
"maxLeverage": 20.0,
"info": {
"bracket": "3",
"initialLeverage": "20",
- "notionalCap": "400000",
+ "notionalCap": "900000",
"notionalFloor": "50000",
"maintMarginRatio": "0.025",
"cum": "770.0"
@@ -21957,81 +22601,81 @@
{
"tier": 4.0,
"currency": "USDT",
- "minNotional": 400000.0,
- "maxNotional": 800000.0,
+ "minNotional": 900000.0,
+ "maxNotional": 1800000.0,
"maintenanceMarginRate": 0.05,
"maxLeverage": 10.0,
"info": {
"bracket": "4",
"initialLeverage": "10",
- "notionalCap": "800000",
- "notionalFloor": "400000",
+ "notionalCap": "1800000",
+ "notionalFloor": "900000",
"maintMarginRatio": "0.05",
- "cum": "10770.0"
+ "cum": "23270.0"
}
},
{
"tier": 5.0,
"currency": "USDT",
- "minNotional": 800000.0,
- "maxNotional": 2000000.0,
+ "minNotional": 1800000.0,
+ "maxNotional": 4800000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "5",
"initialLeverage": "5",
- "notionalCap": "2000000",
- "notionalFloor": "800000",
+ "notionalCap": "4800000",
+ "notionalFloor": "1800000",
"maintMarginRatio": "0.1",
- "cum": "50770.0"
+ "cum": "113270.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 4800000.0,
+ "maxNotional": 6000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "6",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "6000000",
+ "notionalFloor": "4800000",
"maintMarginRatio": "0.125",
- "cum": "100770.0"
+ "cum": "233270.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 12000000.0,
+ "minNotional": 6000000.0,
+ "maxNotional": 18000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "7",
"initialLeverage": "2",
- "notionalCap": "12000000",
- "notionalFloor": "5000000",
+ "notionalCap": "18000000",
+ "notionalFloor": "6000000",
"maintMarginRatio": "0.25",
- "cum": "725770.0"
+ "cum": "983270.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 12000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 18000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "8",
"initialLeverage": "1",
- "notionalCap": "20000000",
- "notionalFloor": "12000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "18000000",
"maintMarginRatio": "0.5",
- "cum": "3725770.0"
+ "cum": "5483270.0"
}
}
],
@@ -22364,13 +23008,13 @@
"tier": 5.0,
"currency": "BUSD",
"minNotional": 250000.0,
- "maxNotional": 1000000.0,
+ "maxNotional": 500000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 2.0,
"info": {
"bracket": "5",
"initialLeverage": "2",
- "notionalCap": "1000000",
+ "notionalCap": "500000",
"notionalFloor": "250000",
"maintMarginRatio": "0.125",
"cum": "11900.0"
@@ -22379,17 +23023,17 @@
{
"tier": 6.0,
"currency": "BUSD",
- "minNotional": 1000000.0,
- "maxNotional": 3000000.0,
+ "minNotional": 500000.0,
+ "maxNotional": 1000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
"info": {
"bracket": "6",
"initialLeverage": "1",
- "notionalCap": "3000000",
- "notionalFloor": "1000000",
+ "notionalCap": "1000000",
+ "notionalFloor": "500000",
"maintMarginRatio": "0.5",
- "cum": "386900.0"
+ "cum": "199400.0"
}
}
],
@@ -23067,15 +23711,15 @@
"currency": "USDT",
"minNotional": 5000.0,
"maxNotional": 10000.0,
- "maintenanceMarginRate": 0.0065,
+ "maintenanceMarginRate": 0.006,
"maxLeverage": 50.0,
"info": {
"bracket": "2",
"initialLeverage": "50",
"notionalCap": "10000",
"notionalFloor": "5000",
- "maintMarginRatio": "0.0065",
- "cum": "7.5"
+ "maintMarginRatio": "0.006",
+ "cum": "5.0"
}
},
{
@@ -23091,7 +23735,7 @@
"notionalCap": "50000",
"notionalFloor": "10000",
"maintMarginRatio": "0.01",
- "cum": "42.5"
+ "cum": "45.0"
}
},
{
@@ -23107,7 +23751,7 @@
"notionalCap": "250000",
"notionalFloor": "50000",
"maintMarginRatio": "0.02",
- "cum": "542.5"
+ "cum": "545.0"
}
},
{
@@ -23123,77 +23767,77 @@
"notionalCap": "1000000",
"notionalFloor": "250000",
"maintMarginRatio": "0.05",
- "cum": "8042.5"
+ "cum": "8045.0"
}
},
{
"tier": 6.0,
"currency": "USDT",
"minNotional": 1000000.0,
- "maxNotional": 2000000.0,
+ "maxNotional": 5000000.0,
"maintenanceMarginRate": 0.1,
"maxLeverage": 5.0,
"info": {
"bracket": "6",
"initialLeverage": "5",
- "notionalCap": "2000000",
+ "notionalCap": "5000000",
"notionalFloor": "1000000",
"maintMarginRatio": "0.1",
- "cum": "58042.5"
+ "cum": "58045.0"
}
},
{
"tier": 7.0,
"currency": "USDT",
- "minNotional": 2000000.0,
- "maxNotional": 5000000.0,
+ "minNotional": 5000000.0,
+ "maxNotional": 10000000.0,
"maintenanceMarginRate": 0.125,
"maxLeverage": 4.0,
"info": {
"bracket": "7",
"initialLeverage": "4",
- "notionalCap": "5000000",
- "notionalFloor": "2000000",
+ "notionalCap": "10000000",
+ "notionalFloor": "5000000",
"maintMarginRatio": "0.125",
- "cum": "108042.5"
+ "cum": "183045.0"
}
},
{
"tier": 8.0,
"currency": "USDT",
- "minNotional": 5000000.0,
- "maxNotional": 10000000.0,
+ "minNotional": 10000000.0,
+ "maxNotional": 20000000.0,
"maintenanceMarginRate": 0.15,
"maxLeverage": 3.0,
"info": {
"bracket": "8",
"initialLeverage": "3",
- "notionalCap": "10000000",
- "notionalFloor": "5000000",
+ "notionalCap": "20000000",
+ "notionalFloor": "10000000",
"maintMarginRatio": "0.15",
- "cum": "233042.5"
+ "cum": "433045.0"
}
},
{
"tier": 9.0,
"currency": "USDT",
- "minNotional": 10000000.0,
- "maxNotional": 20000000.0,
+ "minNotional": 20000000.0,
+ "maxNotional": 30000000.0,
"maintenanceMarginRate": 0.25,
"maxLeverage": 2.0,
"info": {
"bracket": "9",
"initialLeverage": "2",
- "notionalCap": "20000000",
- "notionalFloor": "10000000",
+ "notionalCap": "30000000",
+ "notionalFloor": "20000000",
"maintMarginRatio": "0.25",
- "cum": "1233042.5"
+ "cum": "2433045.0"
}
},
{
"tier": 10.0,
"currency": "USDT",
- "minNotional": 20000000.0,
+ "minNotional": 30000000.0,
"maxNotional": 50000000.0,
"maintenanceMarginRate": 0.5,
"maxLeverage": 1.0,
@@ -23201,9 +23845,9 @@
"bracket": "10",
"initialLeverage": "1",
"notionalCap": "50000000",
- "notionalFloor": "20000000",
+ "notionalFloor": "30000000",
"maintMarginRatio": "0.5",
- "cum": "6233042.5"
+ "cum": "9933045.0"
}
}
],
diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py
index 104eaa221..bbe9585ae 100644
--- a/freqtrade/exchange/exchange.py
+++ b/freqtrade/exchange/exchange.py
@@ -80,6 +80,8 @@ class Exchange:
"fee_cost_in_contracts": False, # Fee cost needs contract conversion
"needs_trading_fees": False, # use fetch_trading_fees to cache fees
"order_props_in_contracts": ['amount', 'cost', 'filled', 'remaining'],
+ # Override createMarketBuyOrderRequiresPrice where ccxt has it wrong
+ "marketOrderRequiresPrice": False,
}
_ft_has: Dict = {}
_ft_has_futures: Dict = {}
@@ -205,6 +207,8 @@ class Exchange:
and self._api_async.session):
logger.debug("Closing async ccxt session.")
self.loop.run_until_complete(self._api_async.close())
+ if self.loop and not self.loop.is_closed():
+ self.loop.close()
def validate_config(self, config):
# Check if timeframe is available
@@ -1038,6 +1042,13 @@ class Exchange:
params.update({'reduceOnly': True})
return params
+ def _order_needs_price(self, ordertype: str) -> bool:
+ return (
+ ordertype != 'market'
+ or self._api.options.get("createMarketBuyOrderRequiresPrice", False)
+ or self._ft_has.get('marketOrderRequiresPrice', False)
+ )
+
def create_order(
self,
*,
@@ -1060,8 +1071,7 @@ class Exchange:
try:
# Set the precision for amount and price(rate) as accepted by the exchange
amount = self.amount_to_precision(pair, self._amount_to_contracts(pair, amount))
- needs_price = (ordertype != 'market'
- or self._api.options.get("createMarketBuyOrderRequiresPrice", False))
+ needs_price = self._order_needs_price(ordertype)
rate_for_order = self.price_to_precision(pair, rate) if needs_price else None
if not reduceOnly:
diff --git a/freqtrade/exchange/gate.py b/freqtrade/exchange/gate.py
index bf6d5b59c..2ac135fc1 100644
--- a/freqtrade/exchange/gate.py
+++ b/freqtrade/exchange/gate.py
@@ -5,7 +5,6 @@ from typing import Any, Dict, List, Optional, Tuple
from freqtrade.constants import BuySell
from freqtrade.enums import MarginMode, PriceType, TradingMode
-from freqtrade.exceptions import OperationalException
from freqtrade.exchange import Exchange
from freqtrade.misc import safe_value_fallback2
@@ -28,10 +27,12 @@ class Gate(Exchange):
"order_time_in_force": ['GTC', 'IOC'],
"stoploss_order_types": {"limit": "limit"},
"stoploss_on_exchange": True,
+ "marketOrderRequiresPrice": True,
}
_ft_has_futures: Dict = {
"needs_trading_fees": True,
+ "marketOrderRequiresPrice": False,
"tickers_have_bid_ask": False,
"fee_cost_in_contracts": False, # Set explicitly to false for clarity
"order_props_in_contracts": ['amount', 'filled', 'remaining'],
@@ -50,14 +51,6 @@ class Gate(Exchange):
(TradingMode.FUTURES, MarginMode.ISOLATED)
]
- def validate_ordertypes(self, order_types: Dict) -> None:
-
- if self.trading_mode != TradingMode.FUTURES:
- if any(v == 'market' for k, v in order_types.items()):
- raise OperationalException(
- f'Exchange {self.name} does not support market orders.')
- super().validate_stop_ordertypes(order_types)
-
def _get_params(
self,
side: BuySell,
diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py
index 07c357de3..b657bd811 100644
--- a/freqtrade/freqai/freqai_interface.py
+++ b/freqtrade/freqai/freqai_interface.py
@@ -105,6 +105,9 @@ class IFreqaiModel(ABC):
self.max_system_threads = max(int(psutil.cpu_count() * 2 - 2), 1)
self.can_short = True # overridden in start() with strategy.can_short
self.model: Any = None
+ if self.ft_params.get('principal_component_analysis', False) and self.continual_learning:
+ self.ft_params.update({'principal_component_analysis': False})
+ logger.warning('User tried to use PCA with continual learning. Deactivating PCA.')
record_params(config, self.full_path)
@@ -154,8 +157,7 @@ class IFreqaiModel(ABC):
dk = self.start_backtesting(dataframe, metadata, self.dk, strategy)
dataframe = dk.remove_features_from_df(dk.return_dataframe)
else:
- logger.info(
- "Backtesting using historic predictions (live models)")
+ logger.info("Backtesting using historic predictions (live models)")
dk = self.start_backtesting_from_historic_predictions(
dataframe, metadata, self.dk)
dataframe = dk.return_dataframe
diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py
index 623d39c09..9746ac3d8 100644
--- a/freqtrade/freqtradebot.py
+++ b/freqtrade/freqtradebot.py
@@ -30,6 +30,8 @@ from freqtrade.plugins.protectionmanager import ProtectionManager
from freqtrade.resolvers import ExchangeResolver, StrategyResolver
from freqtrade.rpc import RPCManager
from freqtrade.rpc.external_message_consumer import ExternalMessageConsumer
+from freqtrade.rpc.rpc_types import (RPCBuyMsg, RPCCancelMsg, RPCProtectionMsg, RPCSellCancelMsg,
+ RPCSellMsg)
from freqtrade.strategy.interface import IStrategy
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
from freqtrade.util import FtPrecise
@@ -212,7 +214,8 @@ class FreqtradeBot(LoggingMixin):
self.dataprovider.refresh(self.pairlists.create_pair_list(self.active_pair_whitelist),
self.strategy.gather_informative_pairs())
- strategy_safe_wrapper(self.strategy.bot_loop_start, supress_error=True)()
+ strategy_safe_wrapper(self.strategy.bot_loop_start, supress_error=True)(
+ current_time=datetime.now(timezone.utc))
self.strategy.analyze(self.active_pair_whitelist)
@@ -854,7 +857,8 @@ class FreqtradeBot(LoggingMixin):
# Reset stoploss order id.
trade.stoploss_order_id = None
except InvalidOrderException:
- logger.exception(f"Could not cancel stoploss order {trade.stoploss_order_id}")
+ logger.exception(f"Could not cancel stoploss order {trade.stoploss_order_id} "
+ f"for pair {trade.pair}")
return trade
def get_valid_enter_price_and_stake(
@@ -946,7 +950,6 @@ class FreqtradeBot(LoggingMixin):
"""
Sends rpc notification when a entry order occurred.
"""
- msg_type = RPCMessageType.ENTRY_FILL if fill else RPCMessageType.ENTRY
open_rate = order.safe_price
if open_rate is None:
@@ -957,9 +960,9 @@ class FreqtradeBot(LoggingMixin):
current_rate = self.exchange.get_rate(
trade.pair, side='entry', is_short=trade.is_short, refresh=False)
- msg = {
+ msg: RPCBuyMsg = {
'trade_id': trade.id,
- 'type': msg_type,
+ 'type': RPCMessageType.ENTRY_FILL if fill else RPCMessageType.ENTRY,
'buy_tag': trade.enter_tag,
'enter_tag': trade.enter_tag,
'exchange': trade.exchange.capitalize(),
@@ -971,6 +974,7 @@ class FreqtradeBot(LoggingMixin):
'order_type': order_type,
'stake_amount': trade.stake_amount,
'stake_currency': self.config['stake_currency'],
+ 'base_currency': self.exchange.get_pair_base_currency(trade.pair),
'fiat_currency': self.config.get('fiat_display_currency', None),
'amount': order.safe_amount_after_fee if fill else (order.amount or trade.amount),
'open_date': trade.open_date or datetime.utcnow(),
@@ -989,7 +993,7 @@ class FreqtradeBot(LoggingMixin):
current_rate = self.exchange.get_rate(
trade.pair, side='entry', is_short=trade.is_short, refresh=False)
- msg = {
+ msg: RPCCancelMsg = {
'trade_id': trade.id,
'type': RPCMessageType.ENTRY_CANCEL,
'buy_tag': trade.enter_tag,
@@ -1001,7 +1005,9 @@ class FreqtradeBot(LoggingMixin):
'limit': trade.open_rate,
'order_type': order_type,
'stake_amount': trade.stake_amount,
+ 'open_rate': trade.open_rate,
'stake_currency': self.config['stake_currency'],
+ 'base_currency': self.exchange.get_pair_base_currency(trade.pair),
'fiat_currency': self.config.get('fiat_display_currency', None),
'amount': trade.amount,
'open_date': trade.open_date,
@@ -1239,13 +1245,8 @@ class FreqtradeBot(LoggingMixin):
# cancelling the current stoploss on exchange first
logger.info(f"Cancelling current stoploss on exchange for pair {trade.pair} "
f"(orderid:{order['id']}) in order to add another one ...")
- try:
- co = self.exchange.cancel_stoploss_order_with_result(order['id'], trade.pair,
- trade.amount)
- trade.update_order(co)
- except InvalidOrderException:
- logger.exception(f"Could not cancel stoploss order {order['id']} "
- f"for pair {trade.pair}")
+
+ self.cancel_stoploss_on_exchange(trade)
# Create new stoploss order
if not self.create_stoploss_order(trade=trade, stop_price=stoploss_norm):
@@ -1666,7 +1667,7 @@ class FreqtradeBot(LoggingMixin):
amount = trade.amount
gain = "profit" if profit_ratio > 0 else "loss"
- msg = {
+ msg: RPCSellMsg = {
'type': (RPCMessageType.EXIT_FILL if fill
else RPCMessageType.EXIT),
'trade_id': trade.id,
@@ -1692,6 +1693,7 @@ class FreqtradeBot(LoggingMixin):
'close_date': trade.close_date or datetime.utcnow(),
'stake_amount': trade.stake_amount,
'stake_currency': self.config['stake_currency'],
+ 'base_currency': self.exchange.get_pair_base_currency(trade.pair),
'fiat_currency': self.config.get('fiat_display_currency'),
'sub_trade': sub_trade,
'cumulative_profit': trade.realized_profit,
@@ -1722,7 +1724,7 @@ class FreqtradeBot(LoggingMixin):
profit_ratio = trade.calc_profit_ratio(profit_rate)
gain = "profit" if profit_ratio > 0 else "loss"
- msg = {
+ msg: RPCSellCancelMsg = {
'type': RPCMessageType.EXIT_CANCEL,
'trade_id': trade.id,
'exchange': trade.exchange.capitalize(),
@@ -1744,6 +1746,7 @@ class FreqtradeBot(LoggingMixin):
'open_date': trade.open_date,
'close_date': trade.close_date or datetime.now(timezone.utc),
'stake_currency': self.config['stake_currency'],
+ 'base_currency': self.exchange.get_pair_base_currency(trade.pair),
'fiat_currency': self.config.get('fiat_display_currency', None),
'reason': reason,
'sub_trade': sub_trade,
@@ -1808,7 +1811,7 @@ class FreqtradeBot(LoggingMixin):
# TODO: should shorting/leverage be supported by Edge,
# then this will need to be fixed.
trade.adjust_stop_loss(trade.open_rate, self.strategy.stoploss, initial=True)
- if order.get('side') == trade.entry_side or trade.amount > 0:
+ if order.get('side') == trade.entry_side or (trade.amount > 0 and trade.is_open):
# Must also run for partial exits
# TODO: Margin will need to use interest_rate as well.
# interest_rate = self.exchange.get_interest_rate()
@@ -1851,14 +1854,20 @@ class FreqtradeBot(LoggingMixin):
self.strategy.lock_pair(pair, datetime.now(timezone.utc), reason='Auto lock')
prot_trig = self.protections.stop_per_pair(pair, side=side)
if prot_trig:
- msg = {'type': RPCMessageType.PROTECTION_TRIGGER, }
- msg.update(prot_trig.to_json())
+ msg: RPCProtectionMsg = {
+ 'type': RPCMessageType.PROTECTION_TRIGGER,
+ 'base_currency': self.exchange.get_pair_base_currency(prot_trig.pair),
+ **prot_trig.to_json() # type: ignore
+ }
self.rpc.send_msg(msg)
prot_trig_glb = self.protections.global_stop(side=side)
if prot_trig_glb:
- msg = {'type': RPCMessageType.PROTECTION_TRIGGER_GLOBAL, }
- msg.update(prot_trig_glb.to_json())
+ msg = {
+ 'type': RPCMessageType.PROTECTION_TRIGGER_GLOBAL,
+ 'base_currency': self.exchange.get_pair_base_currency(prot_trig_glb.pair),
+ **prot_trig_glb.to_json() # type: ignore
+ }
self.rpc.send_msg(msg)
def apply_fee_conditional(self, trade: Trade, trade_base_currency: str,
diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py
index fe6667ad9..c7b2a0d3c 100644
--- a/freqtrade/optimize/backtesting.py
+++ b/freqtrade/optimize/backtesting.py
@@ -203,9 +203,10 @@ class Backtesting:
# since a "perfect" stoploss-exit is assumed anyway
# And the regular "stoploss" function would not apply to that case
self.strategy.order_types['stoploss_on_exchange'] = False
+ # Update can_short flag
+ self._can_short = self.trading_mode != TradingMode.SPOT and strategy.can_short
self.strategy.ft_bot_start()
- strategy_safe_wrapper(self.strategy.bot_loop_start, supress_error=True)()
def _load_protections(self, strategy: IStrategy):
if self.config.get('enable_protections', False):
@@ -740,7 +741,7 @@ class Backtesting:
proposed_leverage=1.0,
max_leverage=max_leverage,
side=direction, entry_tag=entry_tag,
- ) if self._can_short else 1.0
+ ) if self.trading_mode != TradingMode.SPOT else 1.0
# Cap leverage between 1.0 and max_leverage.
leverage = min(max(leverage, 1.0), max_leverage)
@@ -1030,6 +1031,9 @@ class Backtesting:
requested_stake=(
order.safe_remaining * order.ft_price / trade.leverage),
direction='short' if trade.is_short else 'long')
+ # Delete trade if no successful entries happened (if placing the new order failed)
+ if trade.open_order_id is None and trade.nr_of_successful_entries == 0:
+ return True
self.replaced_entry_orders += 1
else:
# assumption: there can't be multiple open entry orders at any given time
@@ -1155,6 +1159,8 @@ class Backtesting:
while current_time <= end_date:
open_trade_count_start = LocalTrade.bt_open_open_trade_count
self.check_abort()
+ strategy_safe_wrapper(self.strategy.bot_loop_start, supress_error=True)(
+ current_time=current_time)
for i, pair in enumerate(data):
row_index = indexes[pair]
row = self.validate_row(data, pair, row_index, current_time)
diff --git a/freqtrade/persistence/trade_model.py b/freqtrade/persistence/trade_model.py
index 27be0d726..17117d436 100644
--- a/freqtrade/persistence/trade_model.py
+++ b/freqtrade/persistence/trade_model.py
@@ -560,6 +560,9 @@ class LocalTrade():
'trading_mode': self.trading_mode,
'funding_fees': self.funding_fees,
'open_order_id': self.open_order_id,
+ 'amount_precision': self.amount_precision,
+ 'price_precision': self.price_precision,
+ 'precision_mode': self.precision_mode,
'orders': orders,
}
@@ -1660,8 +1663,10 @@ class Trade(ModelBase, LocalTrade):
stop_loss=data["stop_loss_abs"],
stop_loss_pct=data["stop_loss_ratio"],
stoploss_order_id=data["stoploss_order_id"],
- stoploss_last_update=(datetime.fromtimestamp(data["stoploss_last_update"] // 1000,
- tz=timezone.utc) if data["stoploss_last_update"] else None),
+ stoploss_last_update=(
+ datetime.fromtimestamp(data["stoploss_last_update_timestamp"] // 1000,
+ tz=timezone.utc)
+ if data["stoploss_last_update_timestamp"] else None),
initial_stop_loss=data["initial_stop_loss_abs"],
initial_stop_loss_pct=data["initial_stop_loss_ratio"],
min_rate=data["min_rate"],
diff --git a/freqtrade/plot/plotting.py b/freqtrade/plot/plotting.py
index 1b2ee44da..e415c4911 100644
--- a/freqtrade/plot/plotting.py
+++ b/freqtrade/plot/plotting.py
@@ -1,4 +1,5 @@
import logging
+from datetime import datetime, timezone
from pathlib import Path
from typing import Dict, List, Optional
@@ -635,7 +636,7 @@ def load_and_plot_trades(config: Config):
exchange = ExchangeResolver.load_exchange(config['exchange']['name'], config)
IStrategy.dp = DataProvider(config, exchange)
strategy.ft_bot_start()
- strategy.bot_loop_start()
+ strategy.bot_loop_start(datetime.now(timezone.utc))
plot_elements = init_plotscript(config, list(exchange.markets), strategy.startup_candle_count)
timerange = plot_elements['timerange']
trades = plot_elements['trades']
diff --git a/freqtrade/rpc/api_server/api_schemas.py b/freqtrade/rpc/api_server/api_schemas.py
index 18621ccbd..7497b27f1 100644
--- a/freqtrade/rpc/api_server/api_schemas.py
+++ b/freqtrade/rpc/api_server/api_schemas.py
@@ -276,6 +276,10 @@ class TradeSchema(BaseModel):
funding_fees: Optional[float]
trading_mode: Optional[TradingMode]
+ amount_precision: Optional[float]
+ price_precision: Optional[float]
+ precision_mode: Optional[int]
+
class OpenTradeSchema(TradeSchema):
stoploss_current_dist: Optional[float]
diff --git a/freqtrade/rpc/api_server/webserver.py b/freqtrade/rpc/api_server/webserver.py
index b53662451..8030e303b 100644
--- a/freqtrade/rpc/api_server/webserver.py
+++ b/freqtrade/rpc/api_server/webserver.py
@@ -13,6 +13,7 @@ from freqtrade.exceptions import OperationalException
from freqtrade.rpc.api_server.uvicorn_threaded import UvicornServer
from freqtrade.rpc.api_server.ws.message_stream import MessageStream
from freqtrade.rpc.rpc import RPC, RPCException, RPCHandler
+from freqtrade.rpc.rpc_types import RPCSendMsg
logger = logging.getLogger(__name__)
@@ -108,7 +109,7 @@ class ApiServer(RPCHandler):
cls._has_rpc = False
cls._rpc = None
- def send_msg(self, msg: Dict[str, Any]) -> None:
+ def send_msg(self, msg: RPCSendMsg) -> None:
"""
Publish the message to the message stream
"""
diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py
index c6a6f5cae..2b5eb107c 100644
--- a/freqtrade/rpc/rpc.py
+++ b/freqtrade/rpc/rpc.py
@@ -30,6 +30,7 @@ from freqtrade.persistence import Order, PairLocks, Trade
from freqtrade.persistence.models import PairLock
from freqtrade.plugins.pairlist.pairlist_helpers import expand_pairlist
from freqtrade.rpc.fiat_convert import CryptoToFiatConverter
+from freqtrade.rpc.rpc_types import RPCSendMsg
from freqtrade.wallets import PositionWallet, Wallet
@@ -79,7 +80,7 @@ class RPCHandler:
""" Cleanup pending module resources """
@abstractmethod
- def send_msg(self, msg: Dict[str, str]) -> None:
+ def send_msg(self, msg: RPCSendMsg) -> None:
""" Sends a message to all registered rpc modules """
diff --git a/freqtrade/rpc/rpc_manager.py b/freqtrade/rpc/rpc_manager.py
index c4d4fa2dd..1972ad6e5 100644
--- a/freqtrade/rpc/rpc_manager.py
+++ b/freqtrade/rpc/rpc_manager.py
@@ -3,11 +3,12 @@ This module contains class to manage RPC communications (Telegram, API, ...)
"""
import logging
from collections import deque
-from typing import Any, Dict, List
+from typing import List
from freqtrade.constants import Config
from freqtrade.enums import NO_ECHO_MESSAGES, RPCMessageType
from freqtrade.rpc import RPC, RPCHandler
+from freqtrade.rpc.rpc_types import RPCSendMsg
logger = logging.getLogger(__name__)
@@ -58,7 +59,7 @@ class RPCManager:
mod.cleanup()
del mod
- def send_msg(self, msg: Dict[str, Any]) -> None:
+ def send_msg(self, msg: RPCSendMsg) -> None:
"""
Send given message to all registered rpc modules.
A message consists of one or more key value pairs of strings.
@@ -69,10 +70,6 @@ class RPCManager:
"""
if msg.get('type') not in NO_ECHO_MESSAGES:
logger.info('Sending rpc message: %s', msg)
- if 'pair' in msg:
- msg.update({
- 'base_currency': self._rpc._freqtrade.exchange.get_pair_base_currency(msg['pair'])
- })
for mod in self.registered_modules:
logger.debug('Forwarding message to rpc.%s', mod.name)
try:
diff --git a/freqtrade/rpc/rpc_types.py b/freqtrade/rpc/rpc_types.py
new file mode 100644
index 000000000..3277a2d6e
--- /dev/null
+++ b/freqtrade/rpc/rpc_types.py
@@ -0,0 +1,128 @@
+from datetime import datetime
+from typing import Any, List, Literal, Optional, TypedDict, Union
+
+from freqtrade.constants import PairWithTimeframe
+from freqtrade.enums import RPCMessageType
+
+
+class RPCSendMsgBase(TypedDict):
+ pass
+ # ty1pe: Literal[RPCMessageType]
+
+
+class RPCStatusMsg(RPCSendMsgBase):
+ """Used for Status, Startup and Warning messages"""
+ type: Literal[RPCMessageType.STATUS, RPCMessageType.STARTUP, RPCMessageType.WARNING]
+ status: str
+
+
+class RPCStrategyMsg(RPCSendMsgBase):
+ """Used for Status, Startup and Warning messages"""
+ type: Literal[RPCMessageType.STRATEGY_MSG]
+ msg: str
+
+
+class RPCProtectionMsg(RPCSendMsgBase):
+ type: Literal[RPCMessageType.PROTECTION_TRIGGER, RPCMessageType.PROTECTION_TRIGGER_GLOBAL]
+ id: int
+ pair: str
+ base_currency: Optional[str]
+ lock_time: str
+ lock_timestamp: int
+ lock_end_time: str
+ lock_end_timestamp: int
+ reason: str
+ side: str
+ active: bool
+
+
+class RPCWhitelistMsg(RPCSendMsgBase):
+ type: Literal[RPCMessageType.WHITELIST]
+ data: List[str]
+
+
+class __RPCBuyMsgBase(RPCSendMsgBase):
+ trade_id: int
+ buy_tag: Optional[str]
+ enter_tag: Optional[str]
+ exchange: str
+ pair: str
+ base_currency: str
+ leverage: Optional[float]
+ direction: str
+ limit: float
+ open_rate: float
+ order_type: Optional[str] # TODO: why optional??
+ stake_amount: float
+ stake_currency: str
+ fiat_currency: Optional[str]
+ amount: float
+ open_date: datetime
+ current_rate: Optional[float]
+ sub_trade: bool
+
+
+class RPCBuyMsg(__RPCBuyMsgBase):
+ type: Literal[RPCMessageType.ENTRY, RPCMessageType.ENTRY_FILL]
+
+
+class RPCCancelMsg(__RPCBuyMsgBase):
+ type: Literal[RPCMessageType.ENTRY_CANCEL]
+ reason: str
+
+
+class RPCSellMsg(__RPCBuyMsgBase):
+ type: Literal[RPCMessageType.EXIT, RPCMessageType.EXIT_FILL]
+ cumulative_profit: float
+ gain: str # Literal["profit", "loss"]
+ close_rate: float
+ profit_amount: float
+ profit_ratio: float
+ sell_reason: Optional[str]
+ exit_reason: Optional[str]
+ close_date: datetime
+ # current_rate: Optional[float]
+ order_rate: Optional[float]
+
+
+class RPCSellCancelMsg(__RPCBuyMsgBase):
+ type: Literal[RPCMessageType.EXIT_CANCEL]
+ reason: str
+ gain: str # Literal["profit", "loss"]
+ profit_amount: float
+ profit_ratio: float
+ sell_reason: Optional[str]
+ exit_reason: Optional[str]
+ close_date: datetime
+
+
+class _AnalyzedDFData(TypedDict):
+ key: PairWithTimeframe
+ df: Any
+ la: datetime
+
+
+class RPCAnalyzedDFMsg(RPCSendMsgBase):
+ """New Analyzed dataframe message"""
+ type: Literal[RPCMessageType.ANALYZED_DF]
+ data: _AnalyzedDFData
+
+
+class RPCNewCandleMsg(RPCSendMsgBase):
+ """New candle ping message, issued once per new candle/pair"""
+ type: Literal[RPCMessageType.NEW_CANDLE]
+ data: PairWithTimeframe
+
+
+RPCSendMsg = Union[
+ RPCStatusMsg,
+ RPCStrategyMsg,
+ RPCProtectionMsg,
+ RPCWhitelistMsg,
+ RPCBuyMsg,
+ RPCCancelMsg,
+ RPCSellMsg,
+ RPCSellCancelMsg,
+ RPCAnalyzedDFMsg,
+ RPCNewCandleMsg
+ ]
diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py
index 962c5e058..d79d8ea76 100644
--- a/freqtrade/rpc/telegram.py
+++ b/freqtrade/rpc/telegram.py
@@ -30,6 +30,7 @@ from freqtrade.exceptions import OperationalException
from freqtrade.misc import chunks, plural, round_coin_value
from freqtrade.persistence import Trade
from freqtrade.rpc import RPC, RPCException, RPCHandler
+from freqtrade.rpc.rpc_types import RPCSendMsg
logger = logging.getLogger(__name__)
@@ -429,14 +430,14 @@ class Telegram(RPCHandler):
return None
return message
- def send_msg(self, msg: Dict[str, Any]) -> None:
+ def send_msg(self, msg: RPCSendMsg) -> None:
""" Send a message to telegram channel """
default_noti = 'on'
msg_type = msg['type']
noti = ''
- if msg_type == RPCMessageType.EXIT:
+ if msg['type'] == RPCMessageType.EXIT:
sell_noti = self._config['telegram'] \
.get('notification_settings', {}).get(str(msg_type), {})
# For backward compatibility sell still can be string
@@ -453,7 +454,7 @@ class Telegram(RPCHandler):
# Notification disabled
return
- message = self.compose_message(deepcopy(msg), msg_type)
+ message = self.compose_message(deepcopy(msg), msg_type) # type: ignore
if message:
self._send_msg(message, disable_notification=(noti == 'silent'))
diff --git a/freqtrade/rpc/webhook.py b/freqtrade/rpc/webhook.py
index 118ebed88..14b881126 100644
--- a/freqtrade/rpc/webhook.py
+++ b/freqtrade/rpc/webhook.py
@@ -10,6 +10,7 @@ from requests import RequestException, post
from freqtrade.constants import Config
from freqtrade.enums import RPCMessageType
from freqtrade.rpc import RPC, RPCHandler
+from freqtrade.rpc.rpc_types import RPCSendMsg
logger = logging.getLogger(__name__)
@@ -41,7 +42,7 @@ class Webhook(RPCHandler):
"""
pass
- def _get_value_dict(self, msg: Dict[str, Any]) -> Optional[Dict[str, Any]]:
+ def _get_value_dict(self, msg: RPCSendMsg) -> Optional[Dict[str, Any]]:
whconfig = self._config['webhook']
# Deprecated 2022.10 - only keep generic method.
if msg['type'] in [RPCMessageType.ENTRY]:
@@ -75,7 +76,7 @@ class Webhook(RPCHandler):
return None
return valuedict
- def send_msg(self, msg: Dict[str, Any]) -> None:
+ def send_msg(self, msg: RPCSendMsg) -> None:
""" Send a message to telegram channel """
try:
diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py
index 96b2ac8ce..6d4a3036f 100644
--- a/freqtrade/strategy/interface.py
+++ b/freqtrade/strategy/interface.py
@@ -251,11 +251,12 @@ class IStrategy(ABC, HyperStrategyMixin):
"""
pass
- def bot_loop_start(self, **kwargs) -> None:
+ def bot_loop_start(self, current_time: datetime, **kwargs) -> None:
"""
Called at the start of the bot iteration (one loop).
Might be used to perform pair-independent tasks
(e.g. gather some remote resource for comparison)
+ :param current_time: datetime object, containing the current datetime
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
"""
pass
diff --git a/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 b/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2
index 488ca2fd7..bfbb20ec1 100644
--- a/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2
+++ b/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2
@@ -1,5 +1,5 @@
-def bot_loop_start(self, **kwargs) -> None:
+def bot_loop_start(self, current_time: datetime, **kwargs) -> None:
"""
Called at the start of the bot iteration (one loop).
Might be used to perform pair-independent tasks
@@ -8,6 +8,7 @@ def bot_loop_start(self, **kwargs) -> None:
For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/
When not implemented by a strategy, this simply does nothing.
+ :param current_time: datetime object, containing the current datetime
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
"""
pass
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 8312e2820..3324c11e9 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -7,9 +7,9 @@
-r docs/requirements-docs.txt
coveralls==3.3.1
-ruff==0.0.257
+ruff==0.0.259
mypy==1.1.1
-pre-commit==3.2.0
+pre-commit==3.2.1
pytest==7.2.2
pytest-asyncio==0.21.0
pytest-cov==4.0.0
@@ -27,6 +27,6 @@ nbconvert==7.2.10
# mypy types
types-cachetools==5.3.0.4
types-filelock==3.2.7
-types-requests==2.28.11.15
+types-requests==2.28.11.16
types-tabulate==0.9.0.1
types-python-dateutil==2.8.19.10
diff --git a/requirements-freqai.txt b/requirements-freqai.txt
index bc0be85e5..e6eae667c 100644
--- a/requirements-freqai.txt
+++ b/requirements-freqai.txt
@@ -5,7 +5,7 @@
# Required for freqai
scikit-learn==1.1.3
joblib==1.2.0
-catboost==1.1.1; platform_machine != 'aarch64' and python_version < '3.11'
+catboost==1.1.1; platform_machine != 'aarch64' and 'arm' not in platform_machine and python_version < '3.11'
lightgbm==3.3.5
xgboost==1.7.4
tensorboard==2.12.0
diff --git a/requirements-hyperopt.txt b/requirements-hyperopt.txt
index 4d86da2b6..2c7c27d98 100644
--- a/requirements-hyperopt.txt
+++ b/requirements-hyperopt.txt
@@ -5,5 +5,5 @@
scipy==1.10.1
scikit-learn==1.1.3
scikit-optimize==0.9.0
-filelock==3.10.0
+filelock==3.10.6
progressbar2==4.2.0
diff --git a/requirements.txt b/requirements.txt
index ad34883ae..b888d9f6e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,8 +2,8 @@ numpy==1.24.2
pandas==1.5.3
pandas-ta==0.3.14b
-ccxt==3.0.23
-cryptography==39.0.2
+ccxt==3.0.37
+cryptography==40.0.1
aiohttp==3.8.4
SQLAlchemy==2.0.7
python-telegram-bot==13.15
@@ -28,14 +28,14 @@ py_find_1st==1.1.5
# Load ticker files 30% faster
python-rapidjson==1.10
# Properly format api responses
-orjson==3.8.7
+orjson==3.8.8
# Notify systemd
sdnotify==0.3.2
# API Server
fastapi==0.95.0
-pydantic==1.10.6
+pydantic==1.10.7
uvicorn==0.21.1
pyjwt==2.6.0
aiofiles==23.1.0
diff --git a/tests/data/test_datahandler.py b/tests/data/test_datahandler.py
index f673ede6e..f19b15455 100644
--- a/tests/data/test_datahandler.py
+++ b/tests/data/test_datahandler.py
@@ -252,7 +252,7 @@ def test_datahandler__check_empty_df(testdatadir, caplog):
assert log_has_re(expected_text, caplog)
-@pytest.mark.parametrize('datahandler', ['feather', 'parquet'])
+@pytest.mark.parametrize('datahandler', ['parquet'])
def test_datahandler_trades_not_supported(datahandler, testdatadir, ):
dh = get_datahandler(testdatadir, datahandler)
with pytest.raises(NotImplementedError):
@@ -496,6 +496,58 @@ def test_hdf5datahandler_ohlcv_purge(mocker, testdatadir):
assert unlinkmock.call_count == 2
+def test_featherdatahandler_trades_load(testdatadir):
+ dh = get_datahandler(testdatadir, 'feather')
+ trades = dh.trades_load('XRP/ETH')
+ assert isinstance(trades, list)
+ assert trades[0][0] == 1570752011620
+ assert trades[-1][-1] == 0.1986231
+
+ trades1 = dh.trades_load('UNITTEST/NONEXIST')
+ assert trades1 == []
+
+
+def test_featherdatahandler_trades_store(testdatadir, tmpdir):
+ tmpdir1 = Path(tmpdir)
+ dh = get_datahandler(testdatadir, 'feather')
+ trades = dh.trades_load('XRP/ETH')
+
+ dh1 = get_datahandler(tmpdir1, 'feather')
+ dh1.trades_store('XRP/NEW', trades)
+ file = tmpdir1 / 'XRP_NEW-trades.feather'
+ assert file.is_file()
+ # Load trades back
+ trades_new = dh1.trades_load('XRP/NEW')
+
+ assert len(trades_new) == len(trades)
+ assert trades[0][0] == trades_new[0][0]
+ assert trades[0][1] == trades_new[0][1]
+ # assert trades[0][2] == trades_new[0][2] # This is nan - so comparison does not make sense
+ assert trades[0][3] == trades_new[0][3]
+ assert trades[0][4] == trades_new[0][4]
+ assert trades[0][5] == trades_new[0][5]
+ assert trades[0][6] == trades_new[0][6]
+ assert trades[-1][0] == trades_new[-1][0]
+ assert trades[-1][1] == trades_new[-1][1]
+ # assert trades[-1][2] == trades_new[-1][2] # This is nan - so comparison does not make sense
+ assert trades[-1][3] == trades_new[-1][3]
+ assert trades[-1][4] == trades_new[-1][4]
+ assert trades[-1][5] == trades_new[-1][5]
+ assert trades[-1][6] == trades_new[-1][6]
+
+
+def test_featherdatahandler_trades_purge(mocker, testdatadir):
+ mocker.patch.object(Path, "exists", MagicMock(return_value=False))
+ unlinkmock = mocker.patch.object(Path, "unlink", MagicMock())
+ dh = get_datahandler(testdatadir, 'feather')
+ assert not dh.trades_purge('UNITTEST/NONEXIST')
+ assert unlinkmock.call_count == 0
+
+ mocker.patch.object(Path, "exists", MagicMock(return_value=True))
+ assert dh.trades_purge('UNITTEST/NONEXIST')
+ assert unlinkmock.call_count == 1
+
+
def test_gethandlerclass():
cl = get_datahandlerclass('json')
assert cl == JsonDataHandler
diff --git a/tests/exchange/test_binance.py b/tests/exchange/test_binance.py
index 273860e15..fda33b859 100644
--- a/tests/exchange/test_binance.py
+++ b/tests/exchange/test_binance.py
@@ -15,8 +15,8 @@ from tests.exchange.test_exchange import ccxt_exceptionhandlers
('buy', 'limit', 'gtc', {'timeInForce': 'GTC'}),
('buy', 'limit', 'IOC', {'timeInForce': 'IOC'}),
('buy', 'market', 'IOC', {}),
- ('buy', 'limit', 'PO', {'postOnly': True}),
- ('sell', 'limit', 'PO', {'postOnly': True}),
+ ('buy', 'limit', 'PO', {'timeInForce': 'PO'}),
+ ('sell', 'limit', 'PO', {'timeInForce': 'PO'}),
('sell', 'market', 'PO', {}),
])
def test__get_params_binance(default_conf, mocker, side, type, time_in_force, expected):
diff --git a/tests/exchange/test_ccxt_compat.py b/tests/exchange/test_ccxt_compat.py
index 872cf5059..4a65b16d7 100644
--- a/tests/exchange/test_ccxt_compat.py
+++ b/tests/exchange/test_ccxt_compat.py
@@ -37,7 +37,7 @@ EXCHANGES = {
'stake_currency': 'USDT',
'use_ci_proxy': True,
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'futures': True,
'futures_pair': 'BTC/USDT:USDT',
'hasQuoteVolumeFutures': True,
@@ -66,7 +66,7 @@ EXCHANGES = {
'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'futures': False,
'sample_order': [{
"symbol": "SOLUSDT",
@@ -91,7 +91,7 @@ EXCHANGES = {
'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'leverage_tiers_public': False,
'leverage_in_spot_market': True,
},
@@ -99,7 +99,7 @@ EXCHANGES = {
'pair': 'XRP/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'leverage_tiers_public': False,
'leverage_in_spot_market': True,
'sample_order': [
@@ -141,7 +141,7 @@ EXCHANGES = {
'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'futures': True,
'futures_pair': 'BTC/USDT:USDT',
'hasQuoteVolumeFutures': True,
@@ -215,7 +215,7 @@ EXCHANGES = {
'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'futures': True,
'futures_pair': 'BTC/USDT:USDT',
'hasQuoteVolumeFutures': False,
@@ -226,7 +226,7 @@ EXCHANGES = {
'pair': 'BTC/USDT',
'stake_currency': 'USDT',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'futures_pair': 'BTC/USDT:USDT',
'futures': True,
'leverage_tiers_public': True,
@@ -253,14 +253,14 @@ EXCHANGES = {
'pair': 'ETH/BTC',
'stake_currency': 'BTC',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'futures': False,
},
'bitvavo': {
'pair': 'BTC/EUR',
'stake_currency': 'EUR',
'hasQuoteVolume': True,
- 'timeframe': '5m',
+ 'timeframe': '1h',
'leverage_tiers_public': False,
'leverage_in_spot_market': False,
},
diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py
index 586f023b4..e08815e61 100644
--- a/tests/exchange/test_exchange.py
+++ b/tests/exchange/test_exchange.py
@@ -113,18 +113,21 @@ async def async_ccxt_exception(mocker, default_conf, api_mock, fun, mock_ccxt_fu
exchange = get_patched_exchange(mocker, default_conf, api_mock)
await getattr(exchange, fun)(**kwargs)
assert api_mock.__dict__[mock_ccxt_fun].call_count == retries
+ exchange.close()
with pytest.raises(TemporaryError):
api_mock.__dict__[mock_ccxt_fun] = MagicMock(side_effect=ccxt.NetworkError("DeadBeef"))
exchange = get_patched_exchange(mocker, default_conf, api_mock)
await getattr(exchange, fun)(**kwargs)
assert api_mock.__dict__[mock_ccxt_fun].call_count == retries
+ exchange.close()
with pytest.raises(OperationalException):
api_mock.__dict__[mock_ccxt_fun] = MagicMock(side_effect=ccxt.BaseError("DeadBeef"))
exchange = get_patched_exchange(mocker, default_conf, api_mock)
await getattr(exchange, fun)(**kwargs)
assert api_mock.__dict__[mock_ccxt_fun].call_count == 1
+ exchange.close()
def test_init(default_conf, mocker, caplog):
@@ -1436,7 +1439,10 @@ def test_buy_prod(default_conf, mocker, exchange_name):
assert api_mock.create_order.call_args[0][1] == order_type
assert api_mock.create_order.call_args[0][2] == 'buy'
assert api_mock.create_order.call_args[0][3] == 1
- assert api_mock.create_order.call_args[0][4] is None
+ if exchange._order_needs_price(order_type):
+ assert api_mock.create_order.call_args[0][4] == 200
+ else:
+ assert api_mock.create_order.call_args[0][4] is None
api_mock.create_order.reset_mock()
order_type = 'limit'
@@ -1541,7 +1547,10 @@ def test_buy_considers_time_in_force(default_conf, mocker, exchange_name):
assert api_mock.create_order.call_args[0][1] == order_type
assert api_mock.create_order.call_args[0][2] == 'buy'
assert api_mock.create_order.call_args[0][3] == 1
- assert api_mock.create_order.call_args[0][4] is None
+ if exchange._order_needs_price(order_type):
+ assert api_mock.create_order.call_args[0][4] == 200
+ else:
+ assert api_mock.create_order.call_args[0][4] is None
# Market orders should not send timeInForce!!
assert "timeInForce" not in api_mock.create_order.call_args[0][5]
@@ -1585,7 +1594,10 @@ def test_sell_prod(default_conf, mocker, exchange_name):
assert api_mock.create_order.call_args[0][1] == order_type
assert api_mock.create_order.call_args[0][2] == 'sell'
assert api_mock.create_order.call_args[0][3] == 1
- assert api_mock.create_order.call_args[0][4] is None
+ if exchange._order_needs_price(order_type):
+ assert api_mock.create_order.call_args[0][4] == 200
+ else:
+ assert api_mock.create_order.call_args[0][4] is None
api_mock.create_order.reset_mock()
order_type = 'limit'
@@ -1679,7 +1691,10 @@ def test_sell_considers_time_in_force(default_conf, mocker, exchange_name):
assert api_mock.create_order.call_args[0][1] == order_type
assert api_mock.create_order.call_args[0][2] == 'sell'
assert api_mock.create_order.call_args[0][3] == 1
- assert api_mock.create_order.call_args[0][4] is None
+ if exchange._order_needs_price(order_type):
+ assert api_mock.create_order.call_args[0][4] == 200
+ else:
+ assert api_mock.create_order.call_args[0][4] is None
# Market orders should not send timeInForce!!
assert "timeInForce" not in api_mock.create_order.call_args[0][5]
@@ -2248,7 +2263,6 @@ def test_refresh_latest_ohlcv_cache(mocker, default_conf, candle_type, time_mach
assert res[pair2].at[0, 'open']
-@pytest.mark.asyncio
@pytest.mark.parametrize("exchange_name", EXCHANGES)
async def test__async_get_candle_history(default_conf, mocker, caplog, exchange_name):
ohlcv = [
@@ -2277,7 +2291,7 @@ async def test__async_get_candle_history(default_conf, mocker, caplog, exchange_
assert res[3] == ohlcv
assert exchange._api_async.fetch_ohlcv.call_count == 1
assert not log_has(f"Using cached candle (OHLCV) data for {pair} ...", caplog)
-
+ exchange.close()
# exchange = Exchange(default_conf)
await async_ccxt_exception(mocker, default_conf, MagicMock(),
"_async_get_candle_history", "fetch_ohlcv",
@@ -2292,15 +2306,17 @@ async def test__async_get_candle_history(default_conf, mocker, caplog, exchange_
await exchange._async_get_candle_history(pair, "5m", CandleType.SPOT,
(arrow.utcnow().int_timestamp - 2000) * 1000)
+ exchange.close()
+
with pytest.raises(OperationalException, match=r'Exchange.* does not support fetching '
r'historical candle \(OHLCV\) data\..*'):
api_mock.fetch_ohlcv = MagicMock(side_effect=ccxt.NotSupported("Not supported"))
exchange = get_patched_exchange(mocker, default_conf, api_mock, id=exchange_name)
await exchange._async_get_candle_history(pair, "5m", CandleType.SPOT,
(arrow.utcnow().int_timestamp - 2000) * 1000)
+ exchange.close()
-@pytest.mark.asyncio
async def test__async_kucoin_get_candle_history(default_conf, mocker, caplog):
from freqtrade.exchange.common import _reset_logging_mixin
_reset_logging_mixin()
@@ -2341,9 +2357,9 @@ async def test__async_kucoin_get_candle_history(default_conf, mocker, caplog):
# Expect the "returned exception" message 12 times (4 retries * 3 (loop))
assert num_log_has_re(msg, caplog) == 12
assert num_log_has_re(msg2, caplog) == 9
+ exchange.close()
-@pytest.mark.asyncio
async def test__async_get_candle_history_empty(default_conf, mocker, caplog):
""" Test empty exchange result """
ohlcv = []
@@ -2363,6 +2379,7 @@ async def test__async_get_candle_history_empty(default_conf, mocker, caplog):
assert res[2] == CandleType.SPOT
assert res[3] == ohlcv
assert exchange._api_async.fetch_ohlcv.call_count == 1
+ exchange.close()
def test_refresh_latest_ohlcv_inv_result(default_conf, mocker, caplog):
@@ -2757,7 +2774,6 @@ async def test___async_get_candle_history_sort(default_conf, mocker, exchange_na
assert res_ohlcv[9][5] == 2.31452783
-@pytest.mark.asyncio
@pytest.mark.parametrize("exchange_name", EXCHANGES)
async def test__async_fetch_trades(default_conf, mocker, caplog, exchange_name,
fetch_trades_result):
@@ -2785,8 +2801,8 @@ async def test__async_fetch_trades(default_conf, mocker, caplog, exchange_name,
assert exchange._api_async.fetch_trades.call_args[1]['limit'] == 1000
assert exchange._api_async.fetch_trades.call_args[1]['params'] == {'from': '123'}
assert log_has_re(f"Fetching trades for pair {pair}, params: .*", caplog)
+ exchange.close()
- exchange = Exchange(default_conf)
await async_ccxt_exception(mocker, default_conf, MagicMock(),
"_async_fetch_trades", "fetch_trades",
pair='ABCD/BTC', since=None)
@@ -2796,15 +2812,16 @@ async def test__async_fetch_trades(default_conf, mocker, caplog, exchange_name,
api_mock.fetch_trades = MagicMock(side_effect=ccxt.BaseError("Unknown error"))
exchange = get_patched_exchange(mocker, default_conf, api_mock, id=exchange_name)
await exchange._async_fetch_trades(pair, since=(arrow.utcnow().int_timestamp - 2000) * 1000)
+ exchange.close()
with pytest.raises(OperationalException, match=r'Exchange.* does not support fetching '
r'historical trade data\..*'):
api_mock.fetch_trades = MagicMock(side_effect=ccxt.NotSupported("Not supported"))
exchange = get_patched_exchange(mocker, default_conf, api_mock, id=exchange_name)
await exchange._async_fetch_trades(pair, since=(arrow.utcnow().int_timestamp - 2000) * 1000)
+ exchange.close()
-@pytest.mark.asyncio
@pytest.mark.parametrize("exchange_name", EXCHANGES)
async def test__async_fetch_trades_contract_size(default_conf, mocker, caplog, exchange_name,
fetch_trades_result):
@@ -2839,6 +2856,7 @@ async def test__async_fetch_trades_contract_size(default_conf, mocker, caplog, e
pair = 'ETH/USDT:USDT'
res = await exchange._async_fetch_trades(pair, since=None, params=None)
assert res[0][5] == 300
+ exchange.close()
@pytest.mark.asyncio
@@ -4807,7 +4825,6 @@ def test_load_leverage_tiers(mocker, default_conf, leverage_tiers, exchange_name
)
-@pytest.mark.asyncio
@pytest.mark.parametrize('exchange_name', EXCHANGES)
async def test_get_market_leverage_tiers(mocker, default_conf, exchange_name):
default_conf['exchange']['name'] = exchange_name
diff --git a/tests/exchange/test_gate.py b/tests/exchange/test_gate.py
index db7591a40..3cb5a9a3e 100644
--- a/tests/exchange/test_gate.py
+++ b/tests/exchange/test_gate.py
@@ -4,42 +4,9 @@ from unittest.mock import MagicMock
import pytest
from freqtrade.enums import MarginMode, TradingMode
-from freqtrade.exceptions import OperationalException
-from freqtrade.exchange import Gate
-from freqtrade.resolvers.exchange_resolver import ExchangeResolver
from tests.conftest import EXMS, get_patched_exchange
-def test_validate_order_types_gate(default_conf, mocker):
- default_conf['exchange']['name'] = 'gate'
- mocker.patch(f'{EXMS}._init_ccxt')
- mocker.patch(f'{EXMS}._load_markets', return_value={})
- mocker.patch(f'{EXMS}.validate_pairs')
- mocker.patch(f'{EXMS}.validate_timeframes')
- mocker.patch(f'{EXMS}.validate_stakecurrency')
- mocker.patch(f'{EXMS}.validate_pricing')
- mocker.patch(f'{EXMS}.name', 'Gate')
- exch = ExchangeResolver.load_exchange('gate', default_conf, True)
- assert isinstance(exch, Gate)
-
- default_conf['order_types'] = {
- 'entry': 'market',
- 'exit': 'limit',
- 'stoploss': 'market',
- 'stoploss_on_exchange': False
- }
-
- with pytest.raises(OperationalException,
- match=r'Exchange .* does not support market orders.'):
- ExchangeResolver.load_exchange('gate', default_conf, True)
-
- # market-orders supported on futures markets.
- default_conf['trading_mode'] = 'futures'
- default_conf['margin_mode'] = 'isolated'
- ex = ExchangeResolver.load_exchange('gate', default_conf, True)
- assert ex
-
-
@pytest.mark.usefixtures("init_persistence")
def test_fetch_stoploss_order_gate(default_conf, mocker):
exchange = get_patched_exchange(mocker, default_conf, id='gate')
diff --git a/tests/optimize/test_backtest_detail.py b/tests/optimize/test_backtest_detail.py
index 2cb42c003..158dd04dc 100644
--- a/tests/optimize/test_backtest_detail.py
+++ b/tests/optimize/test_backtest_detail.py
@@ -5,7 +5,7 @@ from unittest.mock import MagicMock
import pytest
from freqtrade.data.history import get_timerange
-from freqtrade.enums import ExitType
+from freqtrade.enums import ExitType, TradingMode
from freqtrade.optimize.backtesting import Backtesting
from freqtrade.persistence.trade_model import LocalTrade
from tests.conftest import EXMS, patch_exchange
@@ -925,12 +925,14 @@ def test_backtest_results(default_conf, fee, mocker, caplog, data: BTContainer)
mocker.patch(f"{EXMS}.get_min_pair_stake_amount", return_value=0.00001)
mocker.patch(f"{EXMS}.get_max_pair_stake_amount", return_value=float('inf'))
mocker.patch(f"{EXMS}.get_max_leverage", return_value=100)
+ mocker.patch(f"{EXMS}.calculate_funding_fees", return_value=0)
patch_exchange(mocker)
frame = _build_backtest_dataframe(data.data)
backtesting = Backtesting(default_conf)
# TODO: Should we initialize this properly??
- backtesting._can_short = True
+ backtesting.trading_mode = TradingMode.MARGIN
backtesting._set_strategy(backtesting.strategylist[0])
+ backtesting._can_short = True
backtesting.required_startup = 0
backtesting.strategy.advise_entry = lambda a, m: frame
backtesting.strategy.advise_exit = lambda a, m: frame
diff --git a/tests/optimize/test_backtesting.py b/tests/optimize/test_backtesting.py
index 8dee45b6d..9dbda51b0 100644
--- a/tests/optimize/test_backtesting.py
+++ b/tests/optimize/test_backtesting.py
@@ -344,7 +344,7 @@ def test_backtest_abort(default_conf, mocker, testdatadir) -> None:
assert backtesting.progress.progress == 0
-def test_backtesting_start(default_conf, mocker, testdatadir, caplog) -> None:
+def test_backtesting_start(default_conf, mocker, caplog) -> None:
def get_timerange(input1):
return Arrow(2017, 11, 14, 21, 17), Arrow(2017, 11, 14, 22, 59)
@@ -367,6 +367,7 @@ def test_backtesting_start(default_conf, mocker, testdatadir, caplog) -> None:
backtesting = Backtesting(default_conf)
backtesting._set_strategy(backtesting.strategylist[0])
backtesting.strategy.bot_loop_start = MagicMock()
+ backtesting.strategy.bot_start = MagicMock()
backtesting.start()
# check the logs, that will contain the backtest result
exists = [
@@ -376,7 +377,8 @@ def test_backtesting_start(default_conf, mocker, testdatadir, caplog) -> None:
for line in exists:
assert log_has(line, caplog)
assert backtesting.strategy.dp._pairlists is not None
- assert backtesting.strategy.bot_loop_start.call_count == 1
+ assert backtesting.strategy.bot_start.call_count == 1
+ assert backtesting.strategy.bot_loop_start.call_count == 0
assert sbs.call_count == 1
assert sbc.call_count == 1
diff --git a/tests/optimize/test_backtesting_adjust_position.py b/tests/optimize/test_backtesting_adjust_position.py
index 9fc726bd1..0d57ff89a 100644
--- a/tests/optimize/test_backtesting_adjust_position.py
+++ b/tests/optimize/test_backtesting_adjust_position.py
@@ -10,7 +10,7 @@ from arrow import Arrow
from freqtrade.configuration import TimeRange
from freqtrade.data import history
from freqtrade.data.history import get_timerange
-from freqtrade.enums import ExitType
+from freqtrade.enums import ExitType, TradingMode
from freqtrade.optimize.backtesting import Backtesting
from tests.conftest import EXMS, patch_exchange
@@ -108,9 +108,10 @@ def test_backtest_position_adjustment_detailed(default_conf, fee, mocker, levera
default_conf.update({
"stake_amount": 100.0,
"dry_run_wallet": 1000.0,
- "strategy": "StrategyTestV3"
+ "strategy": "StrategyTestV3",
})
backtesting = Backtesting(default_conf)
+ backtesting.trading_mode = TradingMode.FUTURES
backtesting._can_short = True
backtesting._set_strategy(backtesting.strategylist[0])
pair = 'XRP/USDT'
diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py
index 998798580..786720030 100644
--- a/tests/optimize/test_hyperopt.py
+++ b/tests/optimize/test_hyperopt.py
@@ -872,7 +872,8 @@ def test_in_strategy_auto_hyperopt(mocker, hyperopt_conf, tmpdir, fee) -> None:
hyperopt.backtesting.exchange.get_max_leverage = MagicMock(return_value=1.0)
assert isinstance(hyperopt.custom_hyperopt, HyperOptAuto)
assert isinstance(hyperopt.backtesting.strategy.buy_rsi, IntParameter)
- assert hyperopt.backtesting.strategy.bot_loop_started is True
+ assert hyperopt.backtesting.strategy.bot_started is True
+ assert hyperopt.backtesting.strategy.bot_loop_started is False
assert hyperopt.backtesting.strategy.buy_rsi.in_space is True
assert hyperopt.backtesting.strategy.buy_rsi.value == 35
@@ -922,7 +923,8 @@ def test_in_strategy_auto_hyperopt_with_parallel(mocker, hyperopt_conf, tmpdir,
assert isinstance(hyperopt.custom_hyperopt, HyperOptAuto)
assert isinstance(hyperopt.backtesting.strategy.buy_rsi, IntParameter)
- assert hyperopt.backtesting.strategy.bot_loop_started is True
+ assert hyperopt.backtesting.strategy.bot_started is True
+ assert hyperopt.backtesting.strategy.bot_loop_started is False
assert hyperopt.backtesting.strategy.buy_rsi.in_space is True
assert hyperopt.backtesting.strategy.buy_rsi.value == 35
@@ -959,7 +961,8 @@ def test_in_strategy_auto_hyperopt_per_epoch(mocker, hyperopt_conf, tmpdir, fee)
hyperopt.backtesting.exchange.get_max_leverage = MagicMock(return_value=1.0)
assert isinstance(hyperopt.custom_hyperopt, HyperOptAuto)
assert isinstance(hyperopt.backtesting.strategy.buy_rsi, IntParameter)
- assert hyperopt.backtesting.strategy.bot_loop_started is True
+ assert hyperopt.backtesting.strategy.bot_loop_started is False
+ assert hyperopt.backtesting.strategy.bot_started is True
assert hyperopt.backtesting.strategy.buy_rsi.in_space is True
assert hyperopt.backtesting.strategy.buy_rsi.value == 35
diff --git a/tests/persistence/test_persistence.py b/tests/persistence/test_persistence.py
index db882d56d..23ec6d4fb 100644
--- a/tests/persistence/test_persistence.py
+++ b/tests/persistence/test_persistence.py
@@ -1330,71 +1330,78 @@ def test_to_json(fee):
open_rate=0.123,
exchange='binance',
enter_tag=None,
- open_order_id='dry_run_buy_12345'
+ open_order_id='dry_run_buy_12345',
+ precision_mode=1,
+ amount_precision=8.0,
+ price_precision=7.0,
)
result = trade.to_json()
assert isinstance(result, dict)
- assert result == {'trade_id': None,
- 'pair': 'ADA/USDT',
- 'base_currency': 'ADA',
- 'quote_currency': 'USDT',
- 'is_open': None,
- 'open_date': trade.open_date.strftime(DATETIME_PRINT_FORMAT),
- 'open_timestamp': int(trade.open_date.timestamp() * 1000),
- 'open_order_id': 'dry_run_buy_12345',
- 'close_date': None,
- 'close_timestamp': None,
- 'open_rate': 0.123,
- 'open_rate_requested': None,
- 'open_trade_value': 15.1668225,
- 'fee_close': 0.0025,
- 'fee_close_cost': None,
- 'fee_close_currency': None,
- 'fee_open': 0.0025,
- 'fee_open_cost': None,
- 'fee_open_currency': None,
- 'close_rate': None,
- 'close_rate_requested': None,
- 'amount': 123.0,
- 'amount_requested': 123.0,
- 'stake_amount': 0.001,
- 'max_stake_amount': None,
- 'trade_duration': None,
- 'trade_duration_s': None,
- 'realized_profit': 0.0,
- 'realized_profit_ratio': None,
- 'close_profit': None,
- 'close_profit_pct': None,
- 'close_profit_abs': None,
- 'profit_ratio': None,
- 'profit_pct': None,
- 'profit_abs': None,
- 'exit_reason': None,
- 'exit_order_status': None,
- 'stop_loss_abs': None,
- 'stop_loss_ratio': None,
- 'stop_loss_pct': None,
- 'stoploss_order_id': None,
- 'stoploss_last_update': None,
- 'stoploss_last_update_timestamp': None,
- 'initial_stop_loss_abs': None,
- 'initial_stop_loss_pct': None,
- 'initial_stop_loss_ratio': None,
- 'min_rate': None,
- 'max_rate': None,
- 'strategy': None,
- 'enter_tag': None,
- 'timeframe': None,
- 'exchange': 'binance',
- 'leverage': None,
- 'interest_rate': None,
- 'liquidation_price': None,
- 'is_short': None,
- 'trading_mode': None,
- 'funding_fees': None,
- 'orders': [],
- }
+ assert result == {
+ 'trade_id': None,
+ 'pair': 'ADA/USDT',
+ 'base_currency': 'ADA',
+ 'quote_currency': 'USDT',
+ 'is_open': None,
+ 'open_date': trade.open_date.strftime(DATETIME_PRINT_FORMAT),
+ 'open_timestamp': int(trade.open_date.timestamp() * 1000),
+ 'open_order_id': 'dry_run_buy_12345',
+ 'close_date': None,
+ 'close_timestamp': None,
+ 'open_rate': 0.123,
+ 'open_rate_requested': None,
+ 'open_trade_value': 15.1668225,
+ 'fee_close': 0.0025,
+ 'fee_close_cost': None,
+ 'fee_close_currency': None,
+ 'fee_open': 0.0025,
+ 'fee_open_cost': None,
+ 'fee_open_currency': None,
+ 'close_rate': None,
+ 'close_rate_requested': None,
+ 'amount': 123.0,
+ 'amount_requested': 123.0,
+ 'stake_amount': 0.001,
+ 'max_stake_amount': None,
+ 'trade_duration': None,
+ 'trade_duration_s': None,
+ 'realized_profit': 0.0,
+ 'realized_profit_ratio': None,
+ 'close_profit': None,
+ 'close_profit_pct': None,
+ 'close_profit_abs': None,
+ 'profit_ratio': None,
+ 'profit_pct': None,
+ 'profit_abs': None,
+ 'exit_reason': None,
+ 'exit_order_status': None,
+ 'stop_loss_abs': None,
+ 'stop_loss_ratio': None,
+ 'stop_loss_pct': None,
+ 'stoploss_order_id': None,
+ 'stoploss_last_update': None,
+ 'stoploss_last_update_timestamp': None,
+ 'initial_stop_loss_abs': None,
+ 'initial_stop_loss_pct': None,
+ 'initial_stop_loss_ratio': None,
+ 'min_rate': None,
+ 'max_rate': None,
+ 'strategy': None,
+ 'enter_tag': None,
+ 'timeframe': None,
+ 'exchange': 'binance',
+ 'leverage': None,
+ 'interest_rate': None,
+ 'liquidation_price': None,
+ 'is_short': None,
+ 'trading_mode': None,
+ 'funding_fees': None,
+ 'amount_precision': 8.0,
+ 'price_precision': 7.0,
+ 'precision_mode': 1,
+ 'orders': [],
+ }
# Simulate dry_run entries
trade = Trade(
@@ -1410,70 +1417,77 @@ def test_to_json(fee):
close_rate=0.125,
enter_tag='buys_signal_001',
exchange='binance',
+ precision_mode=2,
+ amount_precision=7.0,
+ price_precision=8.0,
)
result = trade.to_json()
assert isinstance(result, dict)
- assert result == {'trade_id': None,
- 'pair': 'XRP/BTC',
- 'base_currency': 'XRP',
- 'quote_currency': 'BTC',
- 'open_date': trade.open_date.strftime(DATETIME_PRINT_FORMAT),
- 'open_timestamp': int(trade.open_date.timestamp() * 1000),
- 'close_date': trade.close_date.strftime(DATETIME_PRINT_FORMAT),
- 'close_timestamp': int(trade.close_date.timestamp() * 1000),
- 'open_rate': 0.123,
- 'close_rate': 0.125,
- 'amount': 100.0,
- 'amount_requested': 101.0,
- 'stake_amount': 0.001,
- 'max_stake_amount': None,
- 'trade_duration': 60,
- 'trade_duration_s': 3600,
- 'stop_loss_abs': None,
- 'stop_loss_pct': None,
- 'stop_loss_ratio': None,
- 'stoploss_order_id': None,
- 'stoploss_last_update': None,
- 'stoploss_last_update_timestamp': None,
- 'initial_stop_loss_abs': None,
- 'initial_stop_loss_pct': None,
- 'initial_stop_loss_ratio': None,
- 'realized_profit': 0.0,
- 'realized_profit_ratio': None,
- 'close_profit': None,
- 'close_profit_pct': None,
- 'close_profit_abs': None,
- 'profit_ratio': None,
- 'profit_pct': None,
- 'profit_abs': None,
- 'close_rate_requested': None,
- 'fee_close': 0.0025,
- 'fee_close_cost': None,
- 'fee_close_currency': None,
- 'fee_open': 0.0025,
- 'fee_open_cost': None,
- 'fee_open_currency': None,
- 'is_open': None,
- 'max_rate': None,
- 'min_rate': None,
- 'open_order_id': None,
- 'open_rate_requested': None,
- 'open_trade_value': 12.33075,
- 'exit_reason': None,
- 'exit_order_status': None,
- 'strategy': None,
- 'enter_tag': 'buys_signal_001',
- 'timeframe': None,
- 'exchange': 'binance',
- 'leverage': None,
- 'interest_rate': None,
- 'liquidation_price': None,
- 'is_short': None,
- 'trading_mode': None,
- 'funding_fees': None,
- 'orders': [],
- }
+ assert result == {
+ 'trade_id': None,
+ 'pair': 'XRP/BTC',
+ 'base_currency': 'XRP',
+ 'quote_currency': 'BTC',
+ 'open_date': trade.open_date.strftime(DATETIME_PRINT_FORMAT),
+ 'open_timestamp': int(trade.open_date.timestamp() * 1000),
+ 'close_date': trade.close_date.strftime(DATETIME_PRINT_FORMAT),
+ 'close_timestamp': int(trade.close_date.timestamp() * 1000),
+ 'open_rate': 0.123,
+ 'close_rate': 0.125,
+ 'amount': 100.0,
+ 'amount_requested': 101.0,
+ 'stake_amount': 0.001,
+ 'max_stake_amount': None,
+ 'trade_duration': 60,
+ 'trade_duration_s': 3600,
+ 'stop_loss_abs': None,
+ 'stop_loss_pct': None,
+ 'stop_loss_ratio': None,
+ 'stoploss_order_id': None,
+ 'stoploss_last_update': None,
+ 'stoploss_last_update_timestamp': None,
+ 'initial_stop_loss_abs': None,
+ 'initial_stop_loss_pct': None,
+ 'initial_stop_loss_ratio': None,
+ 'realized_profit': 0.0,
+ 'realized_profit_ratio': None,
+ 'close_profit': None,
+ 'close_profit_pct': None,
+ 'close_profit_abs': None,
+ 'profit_ratio': None,
+ 'profit_pct': None,
+ 'profit_abs': None,
+ 'close_rate_requested': None,
+ 'fee_close': 0.0025,
+ 'fee_close_cost': None,
+ 'fee_close_currency': None,
+ 'fee_open': 0.0025,
+ 'fee_open_cost': None,
+ 'fee_open_currency': None,
+ 'is_open': None,
+ 'max_rate': None,
+ 'min_rate': None,
+ 'open_order_id': None,
+ 'open_rate_requested': None,
+ 'open_trade_value': 12.33075,
+ 'exit_reason': None,
+ 'exit_order_status': None,
+ 'strategy': None,
+ 'enter_tag': 'buys_signal_001',
+ 'timeframe': None,
+ 'exchange': 'binance',
+ 'leverage': None,
+ 'interest_rate': None,
+ 'liquidation_price': None,
+ 'is_short': None,
+ 'trading_mode': None,
+ 'funding_fees': None,
+ 'amount_precision': 7.0,
+ 'price_precision': 8.0,
+ 'precision_mode': 2,
+ 'orders': [],
+ }
def test_stoploss_reinitialization(default_conf, fee):
diff --git a/tests/persistence/test_trade_fromjson.py b/tests/persistence/test_trade_fromjson.py
index 529008e02..22053463d 100644
--- a/tests/persistence/test_trade_fromjson.py
+++ b/tests/persistence/test_trade_fromjson.py
@@ -50,8 +50,8 @@ def test_trade_fromjson():
"stop_loss_ratio": -0.216,
"stop_loss_pct": -21.6,
"stoploss_order_id": null,
- "stoploss_last_update": null,
- "stoploss_last_update_timestamp": null,
+ "stoploss_last_update": "2022-10-18 09:13:42",
+ "stoploss_last_update_timestamp": 1666077222000,
"initial_stop_loss_abs": 0.1981,
"initial_stop_loss_ratio": -0.216,
"initial_stop_loss_pct": -21.6,
diff --git a/tests/rpc/test_rpc.py b/tests/rpc/test_rpc.py
index 4e2dc94ae..ff08a0564 100644
--- a/tests/rpc/test_rpc.py
+++ b/tests/rpc/test_rpc.py
@@ -88,6 +88,9 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'is_short': False,
'funding_fees': 0.0,
'trading_mode': TradingMode.SPOT,
+ 'amount_precision': 8.0,
+ 'price_precision': 8.0,
+ 'precision_mode': 2,
'orders': [{
'amount': 91.07468123, 'average': 1.098e-05, 'safe_price': 1.098e-05,
'cost': 0.0009999999999054, 'filled': 91.07468123, 'ft_order_side': 'buy',
diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py
index 97319b78b..31075e514 100644
--- a/tests/rpc/test_rpc_apiserver.py
+++ b/tests/rpc/test_rpc_apiserver.py
@@ -1,6 +1,7 @@
"""
Unit test file for rpc/api_server.py
"""
+import asyncio
import logging
import time
from datetime import datetime, timedelta, timezone
@@ -299,10 +300,6 @@ def test_api_UvicornServer(mocker):
s = UvicornServer(uvicorn.Config(MagicMock(), port=8080, host='127.0.0.1'))
assert thread_mock.call_count == 0
- s.install_signal_handlers()
- # Original implementation starts a thread - make sure that's not the case
- assert thread_mock.call_count == 0
-
# Fake started to avoid sleeping forever
s.started = True
s.run_in_thread()
@@ -318,10 +315,6 @@ def test_api_UvicornServer_run(mocker):
s = UvicornServer(uvicorn.Config(MagicMock(), port=8080, host='127.0.0.1'))
assert serve_mock.call_count == 0
- s.install_signal_handlers()
- # Original implementation starts a thread - make sure that's not the case
- assert serve_mock.call_count == 0
-
# Fake started to avoid sleeping forever
s.started = True
s.run()
@@ -331,13 +324,10 @@ def test_api_UvicornServer_run(mocker):
def test_api_UvicornServer_run_no_uvloop(mocker, import_fails):
serve_mock = mocker.patch('freqtrade.rpc.api_server.uvicorn_threaded.UvicornServer.serve',
get_mock_coro(None))
+ asyncio.set_event_loop(asyncio.new_event_loop())
s = UvicornServer(uvicorn.Config(MagicMock(), port=8080, host='127.0.0.1'))
assert serve_mock.call_count == 0
- s.install_signal_handlers()
- # Original implementation starts a thread - make sure that's not the case
- assert serve_mock.call_count == 0
-
# Fake started to avoid sleeping forever
s.started = True
s.run()
@@ -1066,6 +1056,9 @@ def test_api_status(botclient, mocker, ticker, fee, markets, is_short,
'liquidation_price': None,
'funding_fees': None,
'trading_mode': ANY,
+ 'amount_precision': None,
+ 'price_precision': None,
+ 'precision_mode': None,
'orders': [ANY],
}
@@ -1271,6 +1264,9 @@ def test_api_force_entry(botclient, mocker, fee, endpoint):
'liquidation_price': None,
'funding_fees': None,
'trading_mode': 'spot',
+ 'amount_precision': None,
+ 'price_precision': None,
+ 'precision_mode': None,
'orders': [],
}
diff --git a/tests/strategy/strats/hyperoptable_strategy.py b/tests/strategy/strats/hyperoptable_strategy.py
index eadbc533f..d05e8ead2 100644
--- a/tests/strategy/strats/hyperoptable_strategy.py
+++ b/tests/strategy/strats/hyperoptable_strategy.py
@@ -50,6 +50,7 @@ class HyperoptableStrategy(StrategyTestV3):
return prot
bot_loop_started = False
+ bot_started = False
def bot_loop_start(self):
self.bot_loop_started = True
@@ -58,6 +59,7 @@ class HyperoptableStrategy(StrategyTestV3):
"""
Parameters can also be defined here ...
"""
+ self.bot_started = True
self.buy_rsi = IntParameter([0, 50], default=30, space='buy')
def informative_pairs(self):
diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py
index cea70ec48..01aa730cb 100644
--- a/tests/test_freqtradebot.py
+++ b/tests/test_freqtradebot.py
@@ -1060,9 +1060,19 @@ def test_execute_entry_min_leverage(mocker, default_conf_usdt, fee, limit_order,
@pytest.mark.parametrize("is_short", [False, True])
-def test_add_stoploss_on_exchange(mocker, default_conf_usdt, limit_order, is_short) -> None:
+def test_add_stoploss_on_exchange(mocker, default_conf_usdt, limit_order, is_short, fee) -> None:
patch_RPCManager(mocker)
patch_exchange(mocker)
+ mocker.patch.multiple(
+ EXMS,
+ fetch_ticker=MagicMock(return_value={
+ 'bid': 1.9,
+ 'ask': 2.2,
+ 'last': 1.9
+ }),
+ create_order=MagicMock(return_value=limit_order[entry_side(is_short)]),
+ get_fee=fee,
+ )
order = limit_order[entry_side(is_short)]
mocker.patch('freqtrade.freqtradebot.FreqtradeBot.handle_trade', MagicMock(return_value=True))
mocker.patch(f'{EXMS}.fetch_order', return_value=order)
@@ -1074,8 +1084,10 @@ def test_add_stoploss_on_exchange(mocker, default_conf_usdt, limit_order, is_sho
freqtrade = FreqtradeBot(default_conf_usdt)
freqtrade.strategy.order_types['stoploss_on_exchange'] = True
- # TODO: should not be magicmock
- trade = MagicMock()
+ patch_get_signal(freqtrade, enter_short=is_short, enter_long=not is_short)
+
+ freqtrade.enter_positions()
+ trade = Trade.session.scalars(select(Trade)).first()
trade.is_short = is_short
trade.open_order_id = None
trade.stoploss_order_id = None
@@ -1091,7 +1103,8 @@ def test_add_stoploss_on_exchange(mocker, default_conf_usdt, limit_order, is_sho
@pytest.mark.parametrize("is_short", [False, True])
def test_handle_stoploss_on_exchange(mocker, default_conf_usdt, fee, caplog, is_short,
limit_order) -> None:
- stoploss = MagicMock(return_value={'id': 13434334})
+ stop_order_dict = {'id': "13434334"}
+ stoploss = MagicMock(return_value=stop_order_dict)
enter_order = limit_order[entry_side(is_short)]
exit_order = limit_order[exit_side(is_short)]
patch_RPCManager(mocker)
@@ -1116,8 +1129,9 @@ def test_handle_stoploss_on_exchange(mocker, default_conf_usdt, fee, caplog, is_
# First case: when stoploss is not yet set but the order is open
# should get the stoploss order id immediately
# and should return false as no trade actually happened
- # TODO: should not be magicmock
- trade = MagicMock()
+
+ freqtrade.enter_positions()
+ trade = Trade.session.scalars(select(Trade)).first()
trade.is_short = is_short
trade.is_open = True
trade.open_order_id = None
@@ -1129,44 +1143,62 @@ def test_handle_stoploss_on_exchange(mocker, default_conf_usdt, fee, caplog, is_
# Second case: when stoploss is set but it is not yet hit
# should do nothing and return false
+ stop_order_dict.update({'id': "102"})
trade.is_open = True
trade.open_order_id = None
- trade.stoploss_order_id = "100"
+ trade.stoploss_order_id = "102"
+ trade.orders.append(
+ Order(
+ ft_order_side='stoploss',
+ ft_pair=trade.pair,
+ ft_is_open=True,
+ ft_amount=trade.amount,
+ ft_price=trade.stop_loss,
+ order_id='102',
+ status='open',
+ )
+ )
hanging_stoploss_order = MagicMock(return_value={'status': 'open'})
mocker.patch(f'{EXMS}.fetch_stoploss_order', hanging_stoploss_order)
assert freqtrade.handle_stoploss_on_exchange(trade) is False
- assert trade.stoploss_order_id == "100"
+ assert trade.stoploss_order_id == "102"
# Third case: when stoploss was set but it was canceled for some reason
# should set a stoploss immediately and return False
caplog.clear()
trade.is_open = True
trade.open_order_id = None
- trade.stoploss_order_id = "100"
+ trade.stoploss_order_id = "102"
- canceled_stoploss_order = MagicMock(return_value={'status': 'canceled'})
+ canceled_stoploss_order = MagicMock(return_value={'id': '103_1', 'status': 'canceled'})
mocker.patch(f'{EXMS}.fetch_stoploss_order', canceled_stoploss_order)
stoploss.reset_mock()
+ amount_before = trade.amount
+
+ stop_order_dict.update({'id': "103_1"})
assert freqtrade.handle_stoploss_on_exchange(trade) is False
assert stoploss.call_count == 1
- assert trade.stoploss_order_id == "13434334"
+ assert trade.stoploss_order_id == "103_1"
+ assert trade.amount == amount_before
# Fourth case: when stoploss is set and it is hit
# should unset stoploss_order_id and return true
# as a trade actually happened
caplog.clear()
freqtrade.enter_positions()
+ stop_order_dict.update({'id': "104"})
+
trade = Trade.session.scalars(select(Trade)).first()
trade.is_short = is_short
trade.is_open = True
trade.open_order_id = None
- trade.stoploss_order_id = "100"
+ trade.stoploss_order_id = "104"
trade.orders.append(Order(
ft_order_side='stoploss',
- order_id='100',
+ order_id='104',
ft_pair=trade.pair,
ft_is_open=True,
ft_amount=trade.amount,
@@ -1175,7 +1207,7 @@ def test_handle_stoploss_on_exchange(mocker, default_conf_usdt, fee, caplog, is_
assert trade
stoploss_order_hit = MagicMock(return_value={
- 'id': "100",
+ 'id': "104",
'status': 'closed',
'type': 'stop_loss_limit',
'price': 3,
@@ -1197,7 +1229,8 @@ def test_handle_stoploss_on_exchange(mocker, default_conf_usdt, fee, caplog, is_
# Fifth case: fetch_order returns InvalidOrder
# It should try to add stoploss order
- trade.stoploss_order_id = 100
+ stop_order_dict.update({'id': "105"})
+ trade.stoploss_order_id = "105"
stoploss.reset_mock()
mocker.patch(f'{EXMS}.fetch_stoploss_order', side_effect=InvalidOrderException())
mocker.patch(f'{EXMS}.create_stoploss', stoploss)
@@ -1217,21 +1250,36 @@ def test_handle_stoploss_on_exchange(mocker, default_conf_usdt, fee, caplog, is_
# Seventh case: emergency exit triggered
# Trailing stop should not act anymore
stoploss_order_cancelled = MagicMock(side_effect=[{
- 'id': "100",
+ 'id': "107",
'status': 'canceled',
'type': 'stop_loss_limit',
'price': 3,
'average': 2,
'amount': enter_order['amount'],
+ 'filled': 0,
+ 'remaining': enter_order['amount'],
'info': {'stopPrice': 22},
}])
- trade.stoploss_order_id = 100
+ trade.stoploss_order_id = "107"
trade.is_open = True
trade.stoploss_last_update = arrow.utcnow().shift(hours=-1).datetime
trade.stop_loss = 24
+ trade.exit_reason = None
+ trade.orders.append(
+ Order(
+ ft_order_side='stoploss',
+ ft_pair=trade.pair,
+ ft_is_open=True,
+ ft_amount=trade.amount,
+ ft_price=trade.stop_loss,
+ order_id='107',
+ status='open',
+ )
+ )
freqtrade.config['trailing_stop'] = True
stoploss = MagicMock(side_effect=InvalidOrderException())
+ Trade.commit()
mocker.patch(f'{EXMS}.cancel_stoploss_order_with_result',
side_effect=InvalidOrderException())
mocker.patch(f'{EXMS}.fetch_stoploss_order', stoploss_order_cancelled)
@@ -1273,10 +1321,21 @@ def test_handle_sle_cancel_cant_recreate(mocker, default_conf_usdt, fee, caplog,
freqtrade.enter_positions()
trade = Trade.session.scalars(select(Trade)).first()
- trade.is_short = is_short
+ assert trade.is_short == is_short
trade.is_open = True
trade.open_order_id = None
- trade.stoploss_order_id = 100
+ trade.stoploss_order_id = "100"
+ trade.orders.append(
+ Order(
+ ft_order_side='stoploss',
+ ft_pair=trade.pair,
+ ft_is_open=True,
+ ft_amount=trade.amount,
+ ft_price=trade.stop_loss,
+ order_id='100',
+ status='open',
+ )
+ )
assert trade
assert freqtrade.handle_stoploss_on_exchange(trade) is False
@@ -1395,7 +1454,7 @@ def test_handle_stoploss_on_exchange_trailing(
# When trailing stoploss is set
enter_order = limit_order[entry_side(is_short)]
exit_order = limit_order[exit_side(is_short)]
- stoploss = MagicMock(return_value={'id': 13434334})
+ stoploss = MagicMock(return_value={'id': 13434334, 'status': 'open'})
patch_RPCManager(mocker)
mocker.patch.multiple(
EXMS,
@@ -1440,11 +1499,21 @@ def test_handle_stoploss_on_exchange_trailing(
trade.is_short = is_short
trade.is_open = True
trade.open_order_id = None
- trade.stoploss_order_id = 100
+ trade.stoploss_order_id = '100'
trade.stoploss_last_update = arrow.utcnow().shift(minutes=-20).datetime
+ trade.orders.append(
+ Order(
+ ft_order_side='stoploss',
+ ft_pair=trade.pair,
+ ft_is_open=True,
+ ft_amount=trade.amount,
+ ft_price=trade.stop_loss,
+ order_id='100',
+ )
+ )
stoploss_order_hanging = MagicMock(return_value={
- 'id': 100,
+ 'id': '100',
'status': 'open',
'type': 'stop_loss_limit',
'price': hang_price,
@@ -1471,7 +1540,7 @@ def test_handle_stoploss_on_exchange_trailing(
)
cancel_order_mock = MagicMock()
- stoploss_order_mock = MagicMock(return_value={'id': 'so1'})
+ stoploss_order_mock = MagicMock(return_value={'id': 'so1', 'status': 'open'})
mocker.patch(f'{EXMS}.cancel_stoploss_order', cancel_order_mock)
mocker.patch(f'{EXMS}.create_stoploss', stoploss_order_mock)
@@ -1483,13 +1552,14 @@ def test_handle_stoploss_on_exchange_trailing(
assert freqtrade.handle_trade(trade) is False
assert trade.stop_loss == stop_price[1]
+ trade.stoploss_order_id = '100'
# setting stoploss_on_exchange_interval to 0 seconds
freqtrade.strategy.order_types['stoploss_on_exchange_interval'] = 0
assert freqtrade.handle_stoploss_on_exchange(trade) is False
- cancel_order_mock.assert_called_once_with(100, 'ETH/USDT')
+ cancel_order_mock.assert_called_once_with('100', 'ETH/USDT')
stoploss_order_mock.assert_called_once_with(
amount=pytest.approx(amt),
pair='ETH/USDT',
@@ -1519,7 +1589,7 @@ def test_handle_stoploss_on_exchange_trailing_error(
enter_order = limit_order[entry_side(is_short)]
exit_order = limit_order[exit_side(is_short)]
# When trailing stoploss is set
- stoploss = MagicMock(return_value={'id': 13434334})
+ stoploss = MagicMock(return_value={'id': '13434334', 'status': 'open'})
patch_exchange(mocker)
mocker.patch.multiple(
@@ -1628,7 +1698,7 @@ def test_handle_stoploss_on_exchange_custom_stop(
enter_order = limit_order[entry_side(is_short)]
exit_order = limit_order[exit_side(is_short)]
# When trailing stoploss is set
- stoploss = MagicMock(return_value={'id': 13434334})
+ stoploss = MagicMock(return_value={'id': 13434334, 'status': 'open'})
patch_RPCManager(mocker)
mocker.patch.multiple(
EXMS,
@@ -1673,11 +1743,21 @@ def test_handle_stoploss_on_exchange_custom_stop(
trade.is_short = is_short
trade.is_open = True
trade.open_order_id = None
- trade.stoploss_order_id = 100
+ trade.stoploss_order_id = '100'
trade.stoploss_last_update = arrow.utcnow().shift(minutes=-601).datetime
+ trade.orders.append(
+ Order(
+ ft_order_side='stoploss',
+ ft_pair=trade.pair,
+ ft_is_open=True,
+ ft_amount=trade.amount,
+ ft_price=trade.stop_loss,
+ order_id='100',
+ )
+ )
stoploss_order_hanging = MagicMock(return_value={
- 'id': 100,
+ 'id': '100',
'status': 'open',
'type': 'stop_loss_limit',
'price': 3,
@@ -1703,9 +1783,10 @@ def test_handle_stoploss_on_exchange_custom_stop(
)
cancel_order_mock = MagicMock()
- stoploss_order_mock = MagicMock(return_value={'id': 'so1'})
+ stoploss_order_mock = MagicMock(return_value={'id': 'so1', 'status': 'open'})
mocker.patch(f'{EXMS}.cancel_stoploss_order', cancel_order_mock)
mocker.patch(f'{EXMS}.create_stoploss', stoploss_order_mock)
+ trade.stoploss_order_id = '100'
# stoploss should not be updated as the interval is 60 seconds
assert freqtrade.handle_trade(trade) is False
@@ -1722,7 +1803,7 @@ def test_handle_stoploss_on_exchange_custom_stop(
assert freqtrade.handle_stoploss_on_exchange(trade) is False
- cancel_order_mock.assert_called_once_with(100, 'ETH/USDT')
+ cancel_order_mock.assert_called_once_with('100', 'ETH/USDT')
# Long uses modified ask - offset, short modified bid + offset
stoploss_order_mock.assert_called_once_with(
amount=pytest.approx(trade.amount),
@@ -1751,7 +1832,7 @@ def test_tsl_on_exchange_compatible_with_edge(mocker, edge_conf, fee, limit_orde
exit_order = limit_order['sell']
# When trailing stoploss is set
- stoploss = MagicMock(return_value={'id': 13434334})
+ stoploss = MagicMock(return_value={'id': '13434334', 'status': 'open'})
patch_RPCManager(mocker)
patch_exchange(mocker)
patch_edge(mocker)
@@ -1800,11 +1881,21 @@ def test_tsl_on_exchange_compatible_with_edge(mocker, edge_conf, fee, limit_orde
trade = Trade.session.scalars(select(Trade)).first()
trade.is_open = True
trade.open_order_id = None
- trade.stoploss_order_id = 100
- trade.stoploss_last_update = arrow.utcnow()
+ trade.stoploss_order_id = '100'
+ trade.stoploss_last_update = arrow.utcnow().datetime
+ trade.orders.append(
+ Order(
+ ft_order_side='stoploss',
+ ft_pair=trade.pair,
+ ft_is_open=True,
+ ft_amount=trade.amount,
+ ft_price=trade.stop_loss,
+ order_id='100',
+ )
+ )
stoploss_order_hanging = MagicMock(return_value={
- 'id': 100,
+ 'id': '100',
'status': 'open',
'type': 'stop_loss_limit',
'price': 3,
@@ -1851,7 +1942,7 @@ def test_tsl_on_exchange_compatible_with_edge(mocker, edge_conf, fee, limit_orde
# stoploss should be set to 1% as trailing is on
assert trade.stop_loss == 4.4 * 0.99
- cancel_order_mock.assert_called_once_with(100, 'NEO/BTC')
+ cancel_order_mock.assert_called_once_with('100', 'NEO/BTC')
stoploss_order_mock.assert_called_once_with(
amount=pytest.approx(11.41438356),
pair='NEO/BTC',
@@ -3326,6 +3417,7 @@ def test_execute_trade_exit_up(default_conf_usdt, ticker_usdt, fee, ticker_usdt_
'profit_ratio': 0.00493809 if is_short else 0.09451372,
'stake_currency': 'USDT',
'fiat_currency': 'USD',
+ 'base_currency': 'ETH',
'sell_reason': ExitType.ROI.value,
'exit_reason': ExitType.ROI.value,
'open_date': ANY,
@@ -3389,6 +3481,7 @@ def test_execute_trade_exit_down(default_conf_usdt, ticker_usdt, fee, ticker_usd
'profit_amount': -5.65990099 if is_short else -0.00075,
'profit_ratio': -0.0945681 if is_short else -1.247e-05,
'stake_currency': 'USDT',
+ 'base_currency': 'ETH',
'fiat_currency': 'USD',
'sell_reason': ExitType.STOP_LOSS.value,
'exit_reason': ExitType.STOP_LOSS.value,
@@ -3474,6 +3567,7 @@ def test_execute_trade_exit_custom_exit_price(
'profit_amount': pytest.approx(profit_amount),
'profit_ratio': profit_ratio,
'stake_currency': 'USDT',
+ 'base_currency': 'ETH',
'fiat_currency': 'USD',
'sell_reason': 'foo',
'exit_reason': 'foo',
@@ -3547,6 +3641,7 @@ def test_execute_trade_exit_down_stoploss_on_exchange_dry_run(
'profit_ratio': -0.00501253 if is_short else -0.01493766,
'stake_currency': 'USDT',
'fiat_currency': 'USD',
+ 'base_currency': 'ETH',
'sell_reason': ExitType.STOP_LOSS.value,
'exit_reason': ExitType.STOP_LOSS.value,
'open_date': ANY,
@@ -3588,7 +3683,7 @@ def test_execute_trade_exit_sloe_cancel_exception(
freqtrade.execute_trade_exit(trade=trade, limit=1234,
exit_check=ExitCheckTuple(exit_type=ExitType.STOP_LOSS))
assert create_order_mock.call_count == 2
- assert log_has('Could not cancel stoploss order abcd', caplog)
+ assert log_has('Could not cancel stoploss order abcd for pair ETH/USDT', caplog)
@pytest.mark.parametrize("is_short", [False, True])
@@ -3600,10 +3695,12 @@ def test_execute_trade_exit_with_stoploss_on_exchange(
patch_exchange(mocker)
stoploss = MagicMock(return_value={
'id': 123,
+ 'status': 'open',
'info': {
'foo': 'bar'
}
})
+ mocker.patch('freqtrade.freqtradebot.FreqtradeBot.handle_order_fee')
cancel_order = MagicMock(return_value=True)
mocker.patch.multiple(
@@ -3701,12 +3798,12 @@ def test_may_execute_trade_exit_after_stoploss_on_exchange_hit(
"lastTradeTimestamp": None,
"symbol": "BTC/USDT",
"type": "stop_loss_limit",
- "side": "sell",
+ "side": "buy" if is_short else "sell",
"price": 1.08801,
- "amount": 90.99181074,
- "cost": 99.0000000032274,
+ "amount": trade.amount,
+ "cost": 1.08801 * trade.amount,
"average": 1.08801,
- "filled": 90.99181074,
+ "filled": trade.amount,
"remaining": 0.0,
"status": "closed",
"fee": None,
@@ -3811,6 +3908,7 @@ def test_execute_trade_exit_market_order(
'profit_amount': pytest.approx(profit_amount),
'profit_ratio': profit_ratio,
'stake_currency': 'USDT',
+ 'base_currency': 'ETH',
'fiat_currency': 'USD',
'sell_reason': ExitType.ROI.value,
'exit_reason': ExitType.ROI.value,
diff --git a/tests/test_integration.py b/tests/test_integration.py
index 5cbedd818..9fb9fd8b3 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -35,7 +35,7 @@ def test_may_execute_exit_stoploss_on_exchange_multi(default_conf, ticker, fee,
"type": "stop_loss_limit",
"side": "sell",
"price": 1.08801,
- "amount": 90.99181074,
+ "amount": 91.07468123,
"cost": 0.0,
"average": 0.0,
"filled": 0.0,
@@ -49,8 +49,9 @@ def test_may_execute_exit_stoploss_on_exchange_multi(default_conf, ticker, fee,
stoploss_order_closed['filled'] = stoploss_order_closed['amount']
# Sell first trade based on stoploss, keep 2nd and 3rd trade open
+ stop_orders = [stoploss_order_closed, stoploss_order_open, stoploss_order_open]
stoploss_order_mock = MagicMock(
- side_effect=[stoploss_order_closed, stoploss_order_open, stoploss_order_open])
+ side_effect=stop_orders)
# Sell 3rd trade (not called for the first trade)
should_sell_mock = MagicMock(side_effect=[
[],
@@ -93,13 +94,14 @@ def test_may_execute_exit_stoploss_on_exchange_multi(default_conf, ticker, fee,
wallets_mock.reset_mock()
trades = Trade.session.scalars(select(Trade)).all()
- # Make sure stoploss-order is open and trade is bought (since we mock update_trade_state)
- for trade in trades:
- stoploss_order_closed['id'] = '3'
- oobj = Order.parse_from_ccxt_object(stoploss_order_closed, trade.pair, 'stoploss')
+ # Make sure stoploss-order is open and trade is bought
+ for idx, trade in enumerate(trades):
+ stop_order = stop_orders[idx]
+ stop_order['id'] = f"stop{idx}"
+ oobj = Order.parse_from_ccxt_object(stop_order, trade.pair, 'stoploss')
trade.orders.append(oobj)
- trade.stoploss_order_id = '3'
+ trade.stoploss_order_id = f"stop{idx}"
trade.open_order_id = None
n = freqtrade.exit_positions(trades)
diff --git a/tests/testdata/XRP_ETH-trades.feather b/tests/testdata/XRP_ETH-trades.feather
new file mode 100644
index 000000000..68e1c8467
Binary files /dev/null and b/tests/testdata/XRP_ETH-trades.feather differ