diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5e6bf08c..f06d7c8ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -122,18 +122,18 @@ jobs: details: Freqtrade CI failed on ${{ matrix.os }} webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - build_macos: + build-macos: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-latest ] + os: [ "macos-latest" ] python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} check-latest: true @@ -143,14 +143,13 @@ jobs: id: cache with: path: ~/dependencies/ - key: ${{ runner.os }}-dependencies + key: ${{ matrix.os }}-dependencies - name: pip cache (macOS) uses: actions/cache@v3 - if: runner.os == 'macOS' with: path: ~/Library/Caches/pip - key: test-${{ matrix.os }}-${{ matrix.python-version }}-pip + key: ${{ matrix.os }}-${{ matrix.python-version }}-pip - name: TA binary *nix if: steps.cache.outputs.cache-hit != 'true' @@ -158,7 +157,6 @@ jobs: cd build_helpers && ./install_ta-lib.sh ${HOME}/dependencies/; cd .. - name: Installation - macOS - if: runner.os == 'macOS' run: | # brew update # TODO: Should be the brew upgrade @@ -175,7 +173,7 @@ jobs: rm /usr/local/bin/python3-config || true rm /usr/local/bin/python3.11-config || true - brew install hdf5 c-blosc + brew install hdf5 c-blosc libomp python -m pip install --upgrade pip wheel export LD_LIBRARY_PATH=${HOME}/dependencies/lib:$LD_LIBRARY_PATH export TA_LIBRARY_PATH=${HOME}/dependencies/lib @@ -231,7 +229,7 @@ jobs: details: Test Succeeded! webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - build_windows: + build-windows: runs-on: ${{ matrix.os }} strategy: @@ -243,7 +241,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -301,13 +299,13 @@ jobs: details: Test Failed webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - mypy_version_check: + mypy-version-check: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.10" @@ -321,12 +319,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" - uses: pre-commit/action@v3.0.0 - docs_check: + docs-check: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -336,7 +334,7 @@ jobs: ./tests/test_docs.sh - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -362,7 +360,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.9" @@ -406,10 +404,10 @@ jobs: notify-complete: needs: [ build_linux, - build_macos, - build_windows, - docs_check, - mypy_version_check, + build-macos, + build-windows, + docs-check, + mypy-version-check, pre-commit, build_linux_online ] @@ -436,8 +434,63 @@ jobs: details: Test Completed! webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} - deploy: - needs: [ build_linux, build_macos, build_windows, docs_check, mypy_version_check, pre-commit ] + build: + name: "Build" + needs: [ build_linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ] + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Build distribution + run: | + pip install -U build + python -m build --sdist --wheel + + - name: Upload artifacts 📦 + uses: actions/upload-artifact@v4 + with: + name: freqtrade-build + path: | + dist + retention-days: 10 + + deploy-pypi: + name: "Deploy to PyPI" + needs: [ build ] + runs-on: ubuntu-22.04 + if: (github.event_name == 'release') + environment: + name: release + url: https://pypi.org/p/freqtrade + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Download artifact 📦 + uses: actions/download-artifact@v4 + with: + name: freqtrade-build + path: dist + + - name: Publish to PyPI (Test) + uses: pypa/gh-action-pypi-publish@v1.8.11 + with: + repository-url: https://test.pypi.org/legacy/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@v1.8.11 + + + deploy-docker: + needs: [ build_linux, build-macos, build-windows, docs-check, mypy-version-check, pre-commit ] runs-on: ubuntu-22.04 if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade' @@ -446,7 +499,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -455,26 +508,6 @@ jobs: run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})" id: extract_branch - - name: Build distribution - run: | - pip install -U setuptools wheel - python setup.py sdist bdist_wheel - - - name: Publish to PyPI (Test) - uses: pypa/gh-action-pypi-publish@v1.8.11 - if: (github.event_name == 'release') - with: - user: __token__ - password: ${{ secrets.pypi_test_password }} - repository_url: https://test.pypi.org/legacy/ - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.11 - if: (github.event_name == 'release') - with: - user: __token__ - password: ${{ secrets.pypi_password }} - - name: Dockerhub login env: DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} @@ -506,10 +539,11 @@ jobs: run: | build_helpers/publish_docker_multi.sh - deploy_arm: + deploy-arm: + name: "Deploy Docker" permissions: packages: write - needs: [ deploy ] + needs: [ deploy-docker ] # Only run on 64bit machines runs-on: [self-hosted, linux, ARM64] if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'release') && github.repository == 'freqtrade/freqtrade' diff --git a/.gitignore b/.gitignore index 400a082f3..c818981ee 100644 --- a/.gitignore +++ b/.gitignore @@ -111,7 +111,6 @@ target/ #exceptions !*.gitkeep !config_examples/config_binance.example.json -!config_examples/config_bittrex.example.json !config_examples/config_full.example.json !config_examples/config_kraken.example.json !config_examples/config_freqai.example.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c6575e1a..298b66956 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ repos: rev: "6.0.0" hooks: - id: flake8 + additional_dependencies: [Flake8-pyproject] # stages: [push] - repo: https://github.com/pre-commit/mirrors-mypy diff --git a/MANIFEST.in b/MANIFEST.in index a14965c09..0ed6da0ca 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,3 +5,5 @@ recursive-include freqtrade/templates/ *.j2 *.ipynb include freqtrade/exchange/binance_leverage_tiers.json include freqtrade/rpc/api_server/ui/fallback_file.html include freqtrade/rpc/api_server/ui/favicon.ico + +prune tests diff --git a/build_helpers/TA_Lib-0.4.28-cp312-cp312-win_amd64.whl b/build_helpers/TA_Lib-0.4.28-cp312-cp312-win_amd64.whl new file mode 100644 index 000000000..81ccc4818 Binary files /dev/null and b/build_helpers/TA_Lib-0.4.28-cp312-cp312-win_amd64.whl differ diff --git a/docs/configuration.md b/docs/configuration.md index 313e3e456..f01881d19 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -321,7 +321,7 @@ For example, if you have 10 ETH available in your wallet on the exchange and `tr To fully utilize compounding profits when using multiple bots on the same exchange account, you'll want to limit each bot to a certain starting balance. This can be accomplished by setting `available_capital` to the desired starting balance. -Assuming your account has 10.000 USDT and you want to run 2 different strategies on this exchange. +Assuming your account has 10000 USDT and you want to run 2 different strategies on this exchange. You'd set `available_capital=5000` - granting each bot an initial capital of 5000 USDT. The bot will then split this starting balance equally into `max_open_trades` buckets. Profitable trades will result in increased stake-sizes for this bot - without affecting the stake-sizes of the other bot. diff --git a/docs/exchanges.md b/docs/exchanges.md index ac3957b07..457033a3e 100644 --- a/docs/exchanges.md +++ b/docs/exchanges.md @@ -181,48 +181,6 @@ freqtrade download-data --exchange kraken --dl-trades -p BTC/EUR BCH/EUR Please pay attention that rateLimit configuration entry holds delay in milliseconds between requests, NOT requests\sec rate. So, in order to mitigate Kraken API "Rate limit exceeded" exception, this configuration should be increased, NOT decreased. -## Bittrex - -### Order types - -Bittrex does not support market orders. If you have a message at the bot startup about this, you should change order type values set in your configuration and/or in the strategy from `"market"` to `"limit"`. See some more details on this [here in the FAQ](faq.md#im-getting-the-exchange-bittrex-does-not-support-market-orders-message-and-cannot-run-my-strategy). - -Bittrex also does not support `VolumePairlist` due to limited / split API constellation at the moment. -Please use `StaticPairlist`. Other pairlists (other than `VolumePairlist`) should not be affected. - -### Volume pairlist - -Bittrex does not support the direct usage of VolumePairList. This can however be worked around by using the advanced mode with `lookback_days: 1` (or more), which will emulate 24h volume. - -Read more in the [pairlist documentation](plugins.md#volumepairlist-advanced-mode). - -### Restricted markets - -Bittrex split its exchange into US and International versions. -The International version has more pairs available, however the API always returns all pairs, so there is currently no automated way to detect if you're affected by the restriction. - -If you have restricted pairs in your whitelist, you'll get a warning message in the log on Freqtrade startup for each restricted pair. - -The warning message will look similar to the following: - -``` output -[...] Message: bittrex {"success":false,"message":"RESTRICTED_MARKET","result":null,"explanation":null}" -``` - -If you're an "International" customer on the Bittrex exchange, then this warning will probably not impact you. -If you're a US customer, the bot will fail to create orders for these pairs, and you should remove them from your whitelist. - -You can get a list of restricted markets by using the following snippet: - -``` python -import ccxt -ct = ccxt.bittrex() -lm = ct.load_markets() - -res = [p for p, x in lm.items() if 'US' in x['info']['prohibitedIn']] -print(res) -``` - ## Kucoin Kucoin requires a passphrase for each api key, you will therefore need to add this key into the configuration so your exchange section looks as follows: diff --git a/docs/faq.md b/docs/faq.md index 196bd4308..95a9924f9 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -130,7 +130,7 @@ This warning can point to one of the below problems: ### I'm getting the "Exchange XXX does not support market orders." message and cannot run my strategy -As the message says, your exchange does not support market orders and you have one of the [order types](configuration.md/#understand-order_types) set to "market". Your strategy was probably written with other exchanges in mind and sets "market" orders for "stoploss" orders, which is correct and preferable for most of the exchanges supporting market orders (but not for Bittrex and Gate.io). +As the message says, your exchange does not support market orders and you have one of the [order types](configuration.md/#understand-order_types) set to "market". Your strategy was probably written with other exchanges in mind and sets "market" orders for "stoploss" orders, which is correct and preferable for most of the exchanges supporting market orders (but not for Gate.io). To fix this, redefine order types in the strategy to use "limit" instead of "market": diff --git a/docs/includes/pairlists.md b/docs/includes/pairlists.md index b3b23d6ff..8e4b43178 100644 --- a/docs/includes/pairlists.md +++ b/docs/includes/pairlists.md @@ -112,8 +112,8 @@ For convenience `lookback_days` can be specified, which will imply that 1d candl !!! Warning "Performance implications when using lookback range" If used in first position in combination with lookback, the computation of the range based volume can be time and resource consuming, as it downloads candles for all tradable pairs. Hence it's highly advised to use the standard approach with `VolumeFilter` to narrow the pairlist down for further range volume calculation. -??? Tip "Unsupported exchanges (Bittrex, Gemini)" - On some exchanges (like Bittrex and Gemini), regular VolumePairList does not work as the api does not natively provide 24h volume. This can be worked around by using candle data to build the volume. +??? Tip "Unsupported exchanges" + On some exchanges (like Gemini), regular VolumePairList does not work as the api does not natively provide 24h volume. This can be worked around by using candle data to build the volume. To roughly simulate 24h volume, you can use the following configuration. Please note that These pairlists will only refresh once per day. diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt index 10c70939e..6df4bef97 100644 --- a/docs/requirements-docs.txt +++ b/docs/requirements-docs.txt @@ -1,6 +1,6 @@ markdown==3.5.1 mkdocs==1.5.3 -mkdocs-material==9.4.14 +mkdocs-material==9.5.2 mdx_truly_sane_lists==1.3 pymdown-extensions==10.5 jinja2==3.1.2 diff --git a/docs/utils.md b/docs/utils.md index ac0d341bd..b4432833d 100644 --- a/docs/utils.md +++ b/docs/utils.md @@ -242,7 +242,6 @@ bitkk True missing opt: fetchMyTrades bitmart True bitmax True missing opt: fetchMyTrades bitpanda True -bittrex True bitvavo True bitz True missing opt: fetchMyTrades btcalpha True missing opt: fetchTicker, fetchTickers @@ -324,7 +323,6 @@ bitpanda True bitso False missing: fetchOHLCV bitstamp True missing opt: fetchTickers bitstamp1 False missing: fetchOrder, fetchOHLCV -bittrex True bitvavo True bitz True missing opt: fetchMyTrades bl3p False missing: fetchOrder, fetchOHLCV diff --git a/freqtrade/configuration/config_validation.py b/freqtrade/configuration/config_validation.py index 395826557..4afed60cd 100644 --- a/freqtrade/configuration/config_validation.py +++ b/freqtrade/configuration/config_validation.py @@ -67,7 +67,7 @@ def validate_config_schema(conf: Dict[str, Any], preliminary: bool = False) -> D ) -def validate_config_consistency(conf: Dict[str, Any], preliminary: bool = False) -> None: +def validate_config_consistency(conf: Dict[str, Any], *, preliminary: bool = False) -> None: """ Validate the configuration consistency. Should be ran after loading both configuration and strategy, @@ -86,7 +86,7 @@ def validate_config_consistency(conf: Dict[str, Any], preliminary: bool = False) _validate_ask_orderbook(conf) _validate_freqai_hyperopt(conf) _validate_freqai_backtest(conf) - _validate_freqai_include_timeframes(conf) + _validate_freqai_include_timeframes(conf, preliminary=preliminary) _validate_consumers(conf) validate_migrated_strategy_settings(conf) @@ -335,7 +335,7 @@ def _validate_freqai_hyperopt(conf: Dict[str, Any]) -> None: 'Using analyze-per-epoch parameter is not supported with a FreqAI strategy.') -def _validate_freqai_include_timeframes(conf: Dict[str, Any]) -> None: +def _validate_freqai_include_timeframes(conf: Dict[str, Any], preliminary: bool) -> None: freqai_enabled = conf.get('freqai', {}).get('enabled', False) if freqai_enabled: main_tf = conf.get('timeframe', '5m') @@ -355,7 +355,7 @@ def _validate_freqai_include_timeframes(conf: Dict[str, Any]) -> None: f"`include_timeframes`.Offending include-timeframes: {', '.join(offending_lines)}") # Ensure that the base timeframe is included in the include_timeframes list - if main_tf not in freqai_include_timeframes: + if not preliminary and main_tf not in freqai_include_timeframes: feature_parameters = conf.get('freqai', {}).get('feature_parameters', {}) include_timeframes = [main_tf] + freqai_include_timeframes conf.get('freqai', {}).get('feature_parameters', {}) \ diff --git a/freqtrade/data/btanalysis.py b/freqtrade/data/btanalysis.py index 96ab4927e..66caa0dcb 100644 --- a/freqtrade/data/btanalysis.py +++ b/freqtrade/data/btanalysis.py @@ -326,7 +326,10 @@ def load_backtest_data(filename: Union[Path, str], strategy: Optional[str] = Non "Please specify a strategy.") if strategy not in data['strategy']: - raise ValueError(f"Strategy {strategy} not available in the backtest result.") + raise ValueError( + f"Strategy {strategy} not available in the backtest result. " + f"Available strategies are '{','.join(data['strategy'].keys())}'" + ) data = data['strategy'][strategy]['trades'] df = pd.DataFrame(data) diff --git a/freqtrade/data/converter/converter.py b/freqtrade/data/converter/converter.py index 8d1401e88..e4f905542 100644 --- a/freqtrade/data/converter/converter.py +++ b/freqtrade/data/converter/converter.py @@ -116,8 +116,8 @@ def ohlcv_fill_up_missing_data(dataframe: DataFrame, timeframe: str, pair: str) len_after = len(df) pct_missing = (len_after - len_before) / len_before if len_before > 0 else 0 if len_before != len_after: - message = (f"Missing data fillup for {pair}: before: {len_before} - after: {len_after}" - f" - {pct_missing:.2%}") + message = (f"Missing data fillup for {pair}, {timeframe}: " + f"before: {len_before} - after: {len_after} - {pct_missing:.2%}") if pct_missing > 0.01: logger.info(message) else: diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 8de9120dc..442dcfc89 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -6,7 +6,6 @@ from freqtrade.exchange.exchange import Exchange from freqtrade.exchange.binance import Binance from freqtrade.exchange.bitmart import Bitmart from freqtrade.exchange.bitpanda import Bitpanda -from freqtrade.exchange.bittrex import Bittrex from freqtrade.exchange.bitvavo import Bitvavo from freqtrade.exchange.bybit import Bybit from freqtrade.exchange.coinbasepro import Coinbasepro diff --git a/freqtrade/exchange/binance_leverage_tiers.json b/freqtrade/exchange/binance_leverage_tiers.json index 39d2ea7fc..3a6e6b0a1 100644 --- a/freqtrade/exchange/binance_leverage_tiers.json +++ b/freqtrade/exchange/binance_leverage_tiers.json @@ -1,4 +1,118 @@ { + "1000BONK/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "1000FLOKI/USDT:USDT": [ { "tier": 1.0, @@ -455,6 +569,120 @@ } } ], + "1000SATS/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "1000SHIB/BUSD:BUSD": [ { "tier": 1.0, @@ -4705,6 +4933,120 @@ } } ], + "BADGER/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "BAKE/USDT:USDT": [ { "tier": 1.0, @@ -5259,6 +5601,120 @@ } } ], + "BEAMX/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "BEL/USDT:USDT": [ { "tier": 1.0, @@ -5902,10 +6358,10 @@ "minNotional": 0.0, "maxNotional": 100000.0, "maintenanceMarginRate": 0.025, - "maxLeverage": 20.0, + "maxLeverage": 11.0, "info": { "bracket": "1", - "initialLeverage": "20", + "initialLeverage": "11", "notionalCap": "100000", "notionalFloor": "0", "maintMarginRatio": "0.025", @@ -5980,13 +6436,13 @@ "tier": 6.0, "currency": "BUSD", "minNotional": 5000000.0, - "maxNotional": 8000000.0, + "maxNotional": 5500000.0, "maintenanceMarginRate": 0.5, "maxLeverage": 1.0, "info": { "bracket": "6", "initialLeverage": "1", - "notionalCap": "8000000", + "notionalCap": "5500000", "notionalFloor": "5000000", "maintMarginRatio": "0.5", "cum": "1527500.0" @@ -6602,10 +7058,10 @@ "minNotional": 0.0, "maxNotional": 50000.0, "maintenanceMarginRate": 0.004, - "maxLeverage": 75.0, + "maxLeverage": 30.0, "info": { "bracket": "1", - "initialLeverage": "75", + "initialLeverage": "30", "notionalCap": "50000", "notionalFloor": "0", "maintMarginRatio": "0.004", @@ -6618,10 +7074,10 @@ "minNotional": 50000.0, "maxNotional": 250000.0, "maintenanceMarginRate": 0.005, - "maxLeverage": 50.0, + "maxLeverage": 25.0, "info": { "bracket": "2", - "initialLeverage": "50", + "initialLeverage": "25", "notionalCap": "250000", "notionalFloor": "50000", "maintMarginRatio": "0.005", @@ -6634,10 +7090,10 @@ "minNotional": 250000.0, "maxNotional": 1000000.0, "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maxLeverage": 20.0, "info": { "bracket": "3", - "initialLeverage": "25", + "initialLeverage": "20", "notionalCap": "1000000", "notionalFloor": "250000", "maintMarginRatio": "0.01", @@ -6650,10 +7106,10 @@ "minNotional": 1000000.0, "maxNotional": 7500000.0, "maintenanceMarginRate": 0.025, - "maxLeverage": 20.0, + "maxLeverage": 15.0, "info": { "bracket": "4", - "initialLeverage": "20", + "initialLeverage": "15", "notionalCap": "7500000", "notionalFloor": "1000000", "maintMarginRatio": "0.025", @@ -6744,13 +7200,13 @@ "tier": 10.0, "currency": "BUSD", "minNotional": 600000000.0, - "maxNotional": 1000000000.0, + "maxNotional": 600500000.0, "maintenanceMarginRate": 0.5, "maxLeverage": 1.0, "info": { "bracket": "10", "initialLeverage": "1", - "notionalCap": "1000000000", + "notionalCap": "600500000", "notionalFloor": "600000000", "maintMarginRatio": "0.5", "cum": "199703800.0" @@ -6778,13 +7234,13 @@ "tier": 2.0, "currency": "USDT", "minNotional": 50000.0, - "maxNotional": 250000.0, + "maxNotional": 500000.0, "maintenanceMarginRate": 0.005, "maxLeverage": 100.0, "info": { "bracket": "2", "initialLeverage": "100", - "notionalCap": "250000", + "notionalCap": "500000", "notionalFloor": "50000", "maintMarginRatio": "0.005", "cum": "50.0" @@ -6793,55 +7249,55 @@ { "tier": 3.0, "currency": "USDT", - "minNotional": 250000.0, - "maxNotional": 3000000.0, + "minNotional": 500000.0, + "maxNotional": 8000000.0, "maintenanceMarginRate": 0.01, "maxLeverage": 50.0, "info": { "bracket": "3", "initialLeverage": "50", - "notionalCap": "3000000", - "notionalFloor": "250000", + "notionalCap": "8000000", + "notionalFloor": "500000", "maintMarginRatio": "0.01", - "cum": "1300.0" + "cum": "2550.0" } }, { "tier": 4.0, "currency": "USDT", - "minNotional": 3000000.0, - "maxNotional": 20000000.0, + "minNotional": 8000000.0, + "maxNotional": 50000000.0, "maintenanceMarginRate": 0.025, "maxLeverage": 20.0, "info": { "bracket": "4", "initialLeverage": "20", - "notionalCap": "20000000", - "notionalFloor": "3000000", + "notionalCap": "50000000", + "notionalFloor": "8000000", "maintMarginRatio": "0.025", - "cum": "46300.0" + "cum": "122550.0" } }, { "tier": 5.0, "currency": "USDT", - "minNotional": 20000000.0, - "maxNotional": 40000000.0, + "minNotional": 50000000.0, + "maxNotional": 80000000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, "info": { "bracket": "5", "initialLeverage": "10", - "notionalCap": "40000000", - "notionalFloor": "20000000", + "notionalCap": "80000000", + "notionalFloor": "50000000", "maintMarginRatio": "0.05", - "cum": "546300.0" + "cum": "1372550.0" } }, { "tier": 6.0, "currency": "USDT", - "minNotional": 40000000.0, + "minNotional": 80000000.0, "maxNotional": 100000000.0, "maintenanceMarginRate": 0.1, "maxLeverage": 5.0, @@ -6849,9 +7305,9 @@ "bracket": "6", "initialLeverage": "5", "notionalCap": "100000000", - "notionalFloor": "40000000", + "notionalFloor": "80000000", "maintMarginRatio": "0.1", - "cum": "2546300.0" + "cum": "5372550.0" } }, { @@ -6867,7 +7323,7 @@ "notionalCap": "120000000", "notionalFloor": "100000000", "maintMarginRatio": "0.125", - "cum": "5046300.0" + "cum": "7872550.0" } }, { @@ -6883,7 +7339,7 @@ "notionalCap": "200000000", "notionalFloor": "120000000", "maintMarginRatio": "0.15", - "cum": "8046300.0" + "cum": "10872550.0" } }, { @@ -6899,7 +7355,7 @@ "notionalCap": "300000000", "notionalFloor": "200000000", "maintMarginRatio": "0.25", - "cum": "28046300.0" + "cum": "30872550.0" } }, { @@ -6915,121 +7371,7 @@ "notionalCap": "500000000", "notionalFloor": "300000000", "maintMarginRatio": "0.5", - "cum": "103046300.0" - } - } - ], - "BTC/USDT:USDT-230929": [ - { - "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": 120000000.0, - "maintenanceMarginRate": 0.5, - "maxLeverage": 1.0, - "info": { - "bracket": "7", - "initialLeverage": "1", - "notionalCap": "120000000", - "notionalFloor": "40000000", - "maintMarginRatio": "0.5", - "cum": "12461250.0" + "cum": "105872550.0" } } ], @@ -7701,6 +8043,120 @@ } } ], + "CAKE/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "CELO/USDT:USDT": [ { "tier": 1.0, @@ -11341,14 +11797,14 @@ "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 20.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "20", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -11358,14 +11814,14 @@ "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", - "cum": "75.0" + "cum": "50.0" } }, { @@ -11374,14 +11830,14 @@ "minNotional": 25000.0, "maxNotional": 100000.0, "maintenanceMarginRate": 0.05, - "maxLeverage": 8.0, + "maxLeverage": 10.0, "info": { "bracket": "3", - "initialLeverage": "8", + "initialLeverage": "10", "notionalCap": "100000", "notionalFloor": "25000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "675.0" } }, { @@ -11397,7 +11853,7 @@ "notionalCap": "250000", "notionalFloor": "100000", "maintMarginRatio": "0.1", - "cum": "5700.0" + "cum": "5675.0" } }, { @@ -11413,7 +11869,7 @@ "notionalCap": "1000000", "notionalFloor": "250000", "maintMarginRatio": "0.125", - "cum": "11950.0" + "cum": "11925.0" } }, { @@ -11429,7 +11885,7 @@ "notionalCap": "8000000", "notionalFloor": "1000000", "maintMarginRatio": "0.5", - "cum": "386950.0" + "cum": "386925.0" } } ], @@ -12024,10 +12480,10 @@ "minNotional": 0.0, "maxNotional": 50000.0, "maintenanceMarginRate": 0.004, - "maxLeverage": 75.0, + "maxLeverage": 30.0, "info": { "bracket": "1", - "initialLeverage": "75", + "initialLeverage": "30", "notionalCap": "50000", "notionalFloor": "0", "maintMarginRatio": "0.004", @@ -12040,10 +12496,10 @@ "minNotional": 50000.0, "maxNotional": 100000.0, "maintenanceMarginRate": 0.005, - "maxLeverage": 50.0, + "maxLeverage": 25.0, "info": { "bracket": "2", - "initialLeverage": "50", + "initialLeverage": "25", "notionalCap": "100000", "notionalFloor": "50000", "maintMarginRatio": "0.005", @@ -12056,10 +12512,10 @@ "minNotional": 100000.0, "maxNotional": 1000000.0, "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maxLeverage": 20.0, "info": { "bracket": "3", - "initialLeverage": "25", + "initialLeverage": "20", "notionalCap": "1000000", "notionalFloor": "100000", "maintMarginRatio": "0.01", @@ -12072,10 +12528,10 @@ "minNotional": 1000000.0, "maxNotional": 5000000.0, "maintenanceMarginRate": 0.025, - "maxLeverage": 20.0, + "maxLeverage": 15.0, "info": { "bracket": "4", - "initialLeverage": "20", + "initialLeverage": "15", "notionalCap": "5000000", "notionalFloor": "1000000", "maintMarginRatio": "0.025", @@ -12166,13 +12622,13 @@ "tier": 10.0, "currency": "BUSD", "minNotional": 150000000.0, - "maxNotional": 300000000.0, + "maxNotional": 160000000.0, "maintenanceMarginRate": 0.5, "maxLeverage": 1.0, "info": { "bracket": "10", "initialLeverage": "1", - "notionalCap": "300000000", + "notionalCap": "160000000", "notionalFloor": "150000000", "maintMarginRatio": "0.5", "cum": "47640550.0" @@ -12184,13 +12640,13 @@ "tier": 1.0, "currency": "USDT", "minNotional": 0.0, - "maxNotional": 100000.0, + "maxNotional": 200000.0, "maintenanceMarginRate": 0.005, "maxLeverage": 100.0, "info": { "bracket": "1", "initialLeverage": "100", - "notionalCap": "100000", + "notionalCap": "200000", "notionalFloor": "0", "maintMarginRatio": "0.005", "cum": "0.0" @@ -12199,87 +12655,87 @@ { "tier": 2.0, "currency": "USDT", - "minNotional": 100000.0, - "maxNotional": 250000.0, + "minNotional": 200000.0, + "maxNotional": 800000.0, "maintenanceMarginRate": 0.0065, "maxLeverage": 75.0, "info": { "bracket": "2", "initialLeverage": "75", - "notionalCap": "250000", - "notionalFloor": "100000", + "notionalCap": "800000", + "notionalFloor": "200000", "maintMarginRatio": "0.0065", - "cum": "150.0" + "cum": "300.0" } }, { "tier": 3.0, "currency": "USDT", - "minNotional": 250000.0, - "maxNotional": 2000000.0, + "minNotional": 800000.0, + "maxNotional": 5000000.0, "maintenanceMarginRate": 0.01, "maxLeverage": 50.0, "info": { "bracket": "3", "initialLeverage": "50", - "notionalCap": "2000000", - "notionalFloor": "250000", + "notionalCap": "5000000", + "notionalFloor": "800000", "maintMarginRatio": "0.01", - "cum": "1025.0" + "cum": "3100.0" } }, { "tier": 4.0, "currency": "USDT", - "minNotional": 2000000.0, - "maxNotional": 15000000.0, + "minNotional": 5000000.0, + "maxNotional": 30000000.0, "maintenanceMarginRate": 0.02, "maxLeverage": 20.0, "info": { "bracket": "4", "initialLeverage": "20", - "notionalCap": "15000000", - "notionalFloor": "2000000", + "notionalCap": "30000000", + "notionalFloor": "5000000", "maintMarginRatio": "0.02", - "cum": "21025.0" + "cum": "53100.0" } }, { "tier": 5.0, "currency": "USDT", - "minNotional": 15000000.0, - "maxNotional": 30000000.0, + "minNotional": 30000000.0, + "maxNotional": 50000000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, "info": { "bracket": "5", "initialLeverage": "10", - "notionalCap": "30000000", - "notionalFloor": "15000000", + "notionalCap": "50000000", + "notionalFloor": "30000000", "maintMarginRatio": "0.05", - "cum": "471025.0" + "cum": "953100.0" } }, { "tier": 6.0, "currency": "USDT", - "minNotional": 30000000.0, - "maxNotional": 60000000.0, + "minNotional": 50000000.0, + "maxNotional": 70000000.0, "maintenanceMarginRate": 0.1, "maxLeverage": 5.0, "info": { "bracket": "6", "initialLeverage": "5", - "notionalCap": "60000000", - "notionalFloor": "30000000", + "notionalCap": "70000000", + "notionalFloor": "50000000", "maintMarginRatio": "0.1", - "cum": "1971025.0" + "cum": "3453100.0" } }, { "tier": 7.0, "currency": "USDT", - "minNotional": 60000000.0, + "minNotional": 70000000.0, "maxNotional": 80000000.0, "maintenanceMarginRate": 0.125, "maxLeverage": 4.0, @@ -12287,9 +12743,9 @@ "bracket": "7", "initialLeverage": "4", "notionalCap": "80000000", - "notionalFloor": "60000000", + "notionalFloor": "70000000", "maintMarginRatio": "0.125", - "cum": "3471025.0" + "cum": "5203100.0" } }, { @@ -12305,7 +12761,7 @@ "notionalCap": "100000000", "notionalFloor": "80000000", "maintMarginRatio": "0.15", - "cum": "5471025.0" + "cum": "7203100.0" } }, { @@ -12321,7 +12777,7 @@ "notionalCap": "150000000", "notionalFloor": "100000000", "maintMarginRatio": "0.25", - "cum": "15471025.0" + "cum": "17203100.0" } }, { @@ -12337,121 +12793,7 @@ "notionalCap": "300000000", "notionalFloor": "150000000", "maintMarginRatio": "0.5", - "cum": "52971025.0" - } - } - ], - "ETH/USDT:USDT-230929": [ - { - "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": 120000000.0, - "maintenanceMarginRate": 0.5, - "maxLeverage": 1.0, - "info": { - "bracket": "7", - "initialLeverage": "1", - "notionalCap": "120000000", - "notionalFloor": "40000000", - "maintMarginRatio": "0.5", - "cum": "12461250.0" + "cum": "54703100.0" } } ], @@ -12715,6 +13057,120 @@ } } ], + "ETHW/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "FET/USDT:USDT": [ { "tier": 1.0, @@ -16383,6 +16839,120 @@ } } ], + "ILV/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "IMX/USDT:USDT": [ { "tier": 1.0, @@ -17133,6 +17703,234 @@ } } ], + "JTO/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], + "KAS/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "KAVA/USDT:USDT": [ { "tier": 1.0, @@ -17367,14 +18165,14 @@ "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -17382,22 +18180,22 @@ "tier": 2.0, "currency": "USDT", "minNotional": 5000.0, - "maxNotional": 25000.0, + "maxNotional": 50000.0, "maintenanceMarginRate": 0.025, "maxLeverage": 20.0, "info": { "bracket": "2", "initialLeverage": "20", - "notionalCap": "25000", + "notionalCap": "50000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { "tier": 3.0, "currency": "USDT", - "minNotional": 25000.0, + "minNotional": 50000.0, "maxNotional": 400000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, @@ -17405,9 +18203,9 @@ "bracket": "3", "initialLeverage": "10", "notionalCap": "400000", - "notionalFloor": "25000", + "notionalFloor": "50000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "1300.0" } }, { @@ -17423,7 +18221,7 @@ "notionalCap": "1000000", "notionalFloor": "400000", "maintMarginRatio": "0.1", - "cum": "20700.0" + "cum": "21300.0" } }, { @@ -17439,7 +18237,7 @@ "notionalCap": "2000000", "notionalFloor": "1000000", "maintMarginRatio": "0.125", - "cum": "45700.0" + "cum": "46300.0" } }, { @@ -17455,7 +18253,7 @@ "notionalCap": "6000000", "notionalFloor": "2000000", "maintMarginRatio": "0.25", - "cum": "295700.0" + "cum": "296300.0" } }, { @@ -17471,7 +18269,7 @@ "notionalCap": "10000000", "notionalFloor": "6000000", "maintMarginRatio": "0.5", - "cum": "1795700.0" + "cum": "1796300.0" } } ], @@ -17579,14 +18377,14 @@ "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -17603,7 +18401,7 @@ "notionalCap": "25000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { @@ -17619,7 +18417,7 @@ "notionalCap": "100000", "notionalFloor": "25000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "675.0" } }, { @@ -17635,7 +18433,7 @@ "notionalCap": "250000", "notionalFloor": "100000", "maintMarginRatio": "0.1", - "cum": "5700.0" + "cum": "5675.0" } }, { @@ -17651,7 +18449,7 @@ "notionalCap": "1000000", "notionalFloor": "250000", "maintMarginRatio": "0.125", - "cum": "11950.0" + "cum": "11925.0" } }, { @@ -17667,7 +18465,7 @@ "notionalCap": "5000000", "notionalFloor": "1000000", "maintMarginRatio": "0.5", - "cum": "386950.0" + "cum": "386925.0" } } ], @@ -20113,6 +20911,120 @@ } } ], + "MBL/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "MDT/USDT:USDT": [ { "tier": 1.0, @@ -20227,20 +21139,20 @@ } } ], - "MINA/USDT:USDT": [ + "MEME/USDT:USDT": [ { "tier": 1.0, "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -20257,13 +21169,127 @@ "notionalCap": "25000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { "tier": 3.0, "currency": "USDT", "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], + "MINA/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "cum": "0.0" + } + }, + { + "tier": 2.0, + "currency": "USDT", + "minNotional": 5000.0, + "maxNotional": 50000.0, + "maintenanceMarginRate": 0.025, + "maxLeverage": 20.0, + "info": { + "bracket": "2", + "initialLeverage": "20", + "notionalCap": "50000", + "notionalFloor": "5000", + "maintMarginRatio": "0.025", + "cum": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 50000.0, "maxNotional": 400000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, @@ -20271,9 +21297,9 @@ "bracket": "3", "initialLeverage": "10", "notionalCap": "400000", - "notionalFloor": "25000", + "notionalFloor": "50000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "1300.0" } }, { @@ -20289,7 +21315,7 @@ "notionalCap": "1000000", "notionalFloor": "400000", "maintMarginRatio": "0.1", - "cum": "20700.0" + "cum": "21300.0" } }, { @@ -20305,7 +21331,7 @@ "notionalCap": "2000000", "notionalFloor": "1000000", "maintMarginRatio": "0.125", - "cum": "45700.0" + "cum": "46300.0" } }, { @@ -20321,7 +21347,7 @@ "notionalCap": "6000000", "notionalFloor": "2000000", "maintMarginRatio": "0.25", - "cum": "295700.0" + "cum": "296300.0" } }, { @@ -20337,7 +21363,7 @@ "notionalCap": "10000000", "notionalFloor": "6000000", "maintMarginRatio": "0.5", - "cum": "1795700.0" + "cum": "1796300.0" } } ], @@ -21155,6 +22181,120 @@ } } ], + "NTRN/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "OCEAN/USDT:USDT": [ { "tier": 1.0, @@ -21563,20 +22703,20 @@ } } ], - "ONT/USDT:USDT": [ + "ONG/USDT:USDT": [ { "tier": 1.0, "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -21593,13 +22733,127 @@ "notionalCap": "25000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { "tier": 3.0, "currency": "USDT", "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], + "ONT/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "cum": "0.0" + } + }, + { + "tier": 2.0, + "currency": "USDT", + "minNotional": 5000.0, + "maxNotional": 50000.0, + "maintenanceMarginRate": 0.025, + "maxLeverage": 20.0, + "info": { + "bracket": "2", + "initialLeverage": "20", + "notionalCap": "50000", + "notionalFloor": "5000", + "maintMarginRatio": "0.025", + "cum": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 50000.0, "maxNotional": 600000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, @@ -21607,9 +22861,9 @@ "bracket": "3", "initialLeverage": "10", "notionalCap": "600000", - "notionalFloor": "25000", + "notionalFloor": "50000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "1300.0" } }, { @@ -21625,7 +22879,7 @@ "notionalCap": "1600000", "notionalFloor": "600000", "maintMarginRatio": "0.1", - "cum": "30700.0" + "cum": "31300.0" } }, { @@ -21641,7 +22895,7 @@ "notionalCap": "2000000", "notionalFloor": "1600000", "maintMarginRatio": "0.125", - "cum": "70700.0" + "cum": "71300.0" } }, { @@ -21657,7 +22911,7 @@ "notionalCap": "6000000", "notionalFloor": "2000000", "maintMarginRatio": "0.25", - "cum": "320700.0" + "cum": "321300.0" } }, { @@ -21673,7 +22927,7 @@ "notionalCap": "10000000", "notionalFloor": "6000000", "maintMarginRatio": "0.5", - "cum": "1820700.0" + "cum": "1821300.0" } } ], @@ -21921,6 +23175,136 @@ } } ], + "ORDI/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "cum": "0.0" + } + }, + { + "tier": 2.0, + "currency": "USDT", + "minNotional": 5000.0, + "maxNotional": 50000.0, + "maintenanceMarginRate": 0.02, + "maxLeverage": 25.0, + "info": { + "bracket": "2", + "initialLeverage": "25", + "notionalCap": "50000", + "notionalFloor": "5000", + "maintMarginRatio": "0.02", + "cum": "25.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": "275.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": "10275.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": "50275.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 2000000.0, + "maxNotional": 4000000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "6", + "initialLeverage": "4", + "notionalCap": "4000000", + "notionalFloor": "2000000", + "maintMarginRatio": "0.125", + "cum": "100275.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 4000000.0, + "maxNotional": 8000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "7", + "initialLeverage": "2", + "notionalCap": "8000000", + "notionalFloor": "4000000", + "maintMarginRatio": "0.25", + "cum": "600275.0" + } + }, + { + "tier": 8.0, + "currency": "USDT", + "minNotional": 8000000.0, + "maxNotional": 15000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "8", + "initialLeverage": "1", + "notionalCap": "15000000", + "notionalFloor": "8000000", + "maintMarginRatio": "0.5", + "cum": "2600275.0" + } + } + ], "OXT/USDT:USDT": [ { "tier": 1.0, @@ -22801,6 +24185,120 @@ } } ], + "PYTH/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "QNT/USDT:USDT": [ { "tier": 1.0, @@ -22905,14 +24403,14 @@ "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -22929,7 +24427,7 @@ "notionalCap": "25000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { @@ -22945,7 +24443,7 @@ "notionalCap": "200000", "notionalFloor": "25000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "675.0" } }, { @@ -22961,7 +24459,7 @@ "notionalCap": "500000", "notionalFloor": "200000", "maintMarginRatio": "0.1", - "cum": "10700.0" + "cum": "10675.0" } }, { @@ -22977,7 +24475,7 @@ "notionalCap": "1000000", "notionalFloor": "500000", "maintMarginRatio": "0.125", - "cum": "23200.0" + "cum": "23175.0" } }, { @@ -22993,7 +24491,7 @@ "notionalCap": "3000000", "notionalFloor": "1000000", "maintMarginRatio": "0.25", - "cum": "148200.0" + "cum": "148175.0" } }, { @@ -23009,7 +24507,7 @@ "notionalCap": "5000000", "notionalFloor": "3000000", "maintMarginRatio": "0.5", - "cum": "898200.0" + "cum": "898175.0" } } ], @@ -24969,6 +26467,234 @@ } } ], + "SLP/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], + "SNT/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "SNX/USDT:USDT": [ { "tier": 1.0, @@ -25653,6 +27379,120 @@ } } ], + "STEEM/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "STG/USDT:USDT": [ { "tier": 1.0, @@ -26435,20 +28275,20 @@ } } ], - "SUSHI/USDT:USDT": [ + "SUPER/USDT:USDT": [ { "tier": 1.0, "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -26465,13 +28305,127 @@ "notionalCap": "25000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { "tier": 3.0, "currency": "USDT", "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], + "SUSHI/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "cum": "0.0" + } + }, + { + "tier": 2.0, + "currency": "USDT", + "minNotional": 5000.0, + "maxNotional": 50000.0, + "maintenanceMarginRate": 0.025, + "maxLeverage": 20.0, + "info": { + "bracket": "2", + "initialLeverage": "20", + "notionalCap": "50000", + "notionalFloor": "5000", + "maintMarginRatio": "0.025", + "cum": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 50000.0, "maxNotional": 600000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, @@ -26479,9 +28433,9 @@ "bracket": "3", "initialLeverage": "10", "notionalCap": "600000", - "notionalFloor": "25000", + "notionalFloor": "50000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "1300.0" } }, { @@ -26497,7 +28451,7 @@ "notionalCap": "1600000", "notionalFloor": "600000", "maintMarginRatio": "0.1", - "cum": "30700.0" + "cum": "31300.0" } }, { @@ -26513,7 +28467,7 @@ "notionalCap": "2000000", "notionalFloor": "1600000", "maintMarginRatio": "0.125", - "cum": "70700.0" + "cum": "71300.0" } }, { @@ -26529,7 +28483,7 @@ "notionalCap": "6000000", "notionalFloor": "2000000", "maintMarginRatio": "0.25", - "cum": "320700.0" + "cum": "321300.0" } }, { @@ -26545,7 +28499,7 @@ "notionalCap": "10000000", "notionalFloor": "6000000", "maintMarginRatio": "0.5", - "cum": "1820700.0" + "cum": "1821300.0" } } ], @@ -26891,6 +28845,120 @@ } } ], + "TIA/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "TLM/BUSD:BUSD": [ { "tier": 1.0, @@ -27103,7 +29171,7 @@ } } ], - "TOMO/USDT:USDT": [ + "TOKEN/USDT:USDT": [ { "tier": 1.0, "currency": "USDT", @@ -27124,13 +29192,13 @@ "tier": 2.0, "currency": "USDT", "minNotional": 5000.0, - "maxNotional": 50000.0, + "maxNotional": 25000.0, "maintenanceMarginRate": 0.025, "maxLeverage": 20.0, "info": { "bracket": "2", "initialLeverage": "20", - "notionalCap": "50000", + "notionalCap": "25000", "notionalFloor": "5000", "maintMarginRatio": "0.025", "cum": "50.0" @@ -27139,81 +29207,179 @@ { "tier": 3.0, "currency": "USDT", - "minNotional": 50000.0, - "maxNotional": 600000.0, + "minNotional": 25000.0, + "maxNotional": 100000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, "info": { "bracket": "3", "initialLeverage": "10", - "notionalCap": "600000", - "notionalFloor": "50000", + "notionalCap": "100000", + "notionalFloor": "25000", "maintMarginRatio": "0.05", - "cum": "1300.0" + "cum": "675.0" } }, { "tier": 4.0, "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], + "TOMO/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 50000.0, + "maintenanceMarginRate": 0.025, + "maxLeverage": 8.0, + "info": { + "bracket": "1", + "initialLeverage": "8", + "notionalCap": "50000", + "notionalFloor": "0", + "maintMarginRatio": "0.025", + "cum": "0.0" + } + }, + { + "tier": 2.0, + "currency": "USDT", + "minNotional": 50000.0, + "maxNotional": 600000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 6.0, + "info": { + "bracket": "2", + "initialLeverage": "6", + "notionalCap": "600000", + "notionalFloor": "50000", + "maintMarginRatio": "0.05", + "cum": "1250.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", "minNotional": 600000.0, "maxNotional": 1280000.0, "maintenanceMarginRate": 0.1, "maxLeverage": 5.0, "info": { - "bracket": "4", + "bracket": "3", "initialLeverage": "5", "notionalCap": "1280000", "notionalFloor": "600000", "maintMarginRatio": "0.1", - "cum": "31300.0" + "cum": "31250.0" } }, { - "tier": 5.0, + "tier": 4.0, "currency": "USDT", "minNotional": 1280000.0, "maxNotional": 1600000.0, "maintenanceMarginRate": 0.125, "maxLeverage": 4.0, "info": { - "bracket": "5", + "bracket": "4", "initialLeverage": "4", "notionalCap": "1600000", "notionalFloor": "1280000", "maintMarginRatio": "0.125", - "cum": "63300.0" + "cum": "63250.0" } }, { - "tier": 6.0, + "tier": 5.0, "currency": "USDT", "minNotional": 1600000.0, "maxNotional": 4800000.0, "maintenanceMarginRate": 0.25, "maxLeverage": 2.0, "info": { - "bracket": "6", + "bracket": "5", "initialLeverage": "2", "notionalCap": "4800000", "notionalFloor": "1600000", "maintMarginRatio": "0.25", - "cum": "263300.0" + "cum": "263250.0" } }, { - "tier": 7.0, + "tier": 6.0, "currency": "USDT", "minNotional": 4800000.0, - "maxNotional": 8000000.0, + "maxNotional": 5000000.0, "maintenanceMarginRate": 0.5, "maxLeverage": 1.0, "info": { - "bracket": "7", + "bracket": "6", "initialLeverage": "1", - "notionalCap": "8000000", + "notionalCap": "5000000", "notionalFloor": "4800000", "maintMarginRatio": "0.5", - "cum": "1463300.0" + "cum": "1463250.0" } } ], @@ -27705,6 +29871,120 @@ } } ], + "TWT/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "UMA/USDT:USDT": [ { "tier": 1.0, @@ -28275,6 +30555,120 @@ } } ], + "USTC/USDT:USDT": [ + { + "tier": 1.0, + "currency": "USDT", + "minNotional": 0.0, + "maxNotional": 5000.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, + "info": { + "bracket": "1", + "initialLeverage": "50", + "notionalCap": "5000", + "notionalFloor": "0", + "maintMarginRatio": "0.015", + "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": "50.0" + } + }, + { + "tier": 3.0, + "currency": "USDT", + "minNotional": 25000.0, + "maxNotional": 100000.0, + "maintenanceMarginRate": 0.05, + "maxLeverage": 10.0, + "info": { + "bracket": "3", + "initialLeverage": "10", + "notionalCap": "100000", + "notionalFloor": "25000", + "maintMarginRatio": "0.05", + "cum": "675.0" + } + }, + { + "tier": 4.0, + "currency": "USDT", + "minNotional": 100000.0, + "maxNotional": 200000.0, + "maintenanceMarginRate": 0.1, + "maxLeverage": 5.0, + "info": { + "bracket": "4", + "initialLeverage": "5", + "notionalCap": "200000", + "notionalFloor": "100000", + "maintMarginRatio": "0.1", + "cum": "5675.0" + } + }, + { + "tier": 5.0, + "currency": "USDT", + "minNotional": 200000.0, + "maxNotional": 500000.0, + "maintenanceMarginRate": 0.125, + "maxLeverage": 4.0, + "info": { + "bracket": "5", + "initialLeverage": "4", + "notionalCap": "500000", + "notionalFloor": "200000", + "maintMarginRatio": "0.125", + "cum": "10675.0" + } + }, + { + "tier": 6.0, + "currency": "USDT", + "minNotional": 500000.0, + "maxNotional": 1000000.0, + "maintenanceMarginRate": 0.25, + "maxLeverage": 2.0, + "info": { + "bracket": "6", + "initialLeverage": "2", + "notionalCap": "1000000", + "notionalFloor": "500000", + "maintMarginRatio": "0.25", + "cum": "73175.0" + } + }, + { + "tier": 7.0, + "currency": "USDT", + "minNotional": 1000000.0, + "maxNotional": 2000000.0, + "maintenanceMarginRate": 0.5, + "maxLeverage": 1.0, + "info": { + "bracket": "7", + "initialLeverage": "1", + "notionalCap": "2000000", + "notionalFloor": "1000000", + "maintMarginRatio": "0.5", + "cum": "323175.0" + } + } + ], "VET/USDT:USDT": [ { "tier": 1.0, @@ -29340,10 +31734,10 @@ "minNotional": 0.0, "maxNotional": 100000.0, "maintenanceMarginRate": 0.025, - "maxLeverage": 20.0, + "maxLeverage": 11.0, "info": { "bracket": "1", - "initialLeverage": "20", + "initialLeverage": "11", "notionalCap": "100000", "notionalFloor": "0", "maintMarginRatio": "0.025", @@ -29418,13 +31812,13 @@ "tier": 6.0, "currency": "BUSD", "minNotional": 5000000.0, - "maxNotional": 8000000.0, + "maxNotional": 5500000.0, "maintenanceMarginRate": 0.5, "maxLeverage": 1.0, "info": { "bracket": "6", "initialLeverage": "1", - "notionalCap": "8000000", + "notionalCap": "5500000", "notionalFloor": "5000000", "maintMarginRatio": "0.5", "cum": "1527500.0" @@ -29941,14 +32335,14 @@ "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -29956,22 +32350,22 @@ "tier": 2.0, "currency": "USDT", "minNotional": 5000.0, - "maxNotional": 25000.0, + "maxNotional": 50000.0, "maintenanceMarginRate": 0.025, "maxLeverage": 20.0, "info": { "bracket": "2", "initialLeverage": "20", - "notionalCap": "25000", + "notionalCap": "50000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { "tier": 3.0, "currency": "USDT", - "minNotional": 25000.0, + "minNotional": 50000.0, "maxNotional": 400000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, @@ -29979,9 +32373,9 @@ "bracket": "3", "initialLeverage": "10", "notionalCap": "400000", - "notionalFloor": "25000", + "notionalFloor": "50000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "1300.0" } }, { @@ -29997,7 +32391,7 @@ "notionalCap": "1000000", "notionalFloor": "400000", "maintMarginRatio": "0.1", - "cum": "20700.0" + "cum": "21300.0" } }, { @@ -30013,7 +32407,7 @@ "notionalCap": "2000000", "notionalFloor": "1000000", "maintMarginRatio": "0.125", - "cum": "45700.0" + "cum": "46300.0" } }, { @@ -30029,7 +32423,7 @@ "notionalCap": "6000000", "notionalFloor": "2000000", "maintMarginRatio": "0.25", - "cum": "295700.0" + "cum": "296300.0" } }, { @@ -30045,7 +32439,7 @@ "notionalCap": "10000000", "notionalFloor": "6000000", "maintMarginRatio": "0.5", - "cum": "1795700.0" + "cum": "1796300.0" } } ], @@ -30381,14 +32775,14 @@ "currency": "USDT", "minNotional": 0.0, "maxNotional": 5000.0, - "maintenanceMarginRate": 0.01, - "maxLeverage": 25.0, + "maintenanceMarginRate": 0.015, + "maxLeverage": 50.0, "info": { "bracket": "1", - "initialLeverage": "25", + "initialLeverage": "50", "notionalCap": "5000", "notionalFloor": "0", - "maintMarginRatio": "0.01", + "maintMarginRatio": "0.015", "cum": "0.0" } }, @@ -30396,22 +32790,22 @@ "tier": 2.0, "currency": "USDT", "minNotional": 5000.0, - "maxNotional": 25000.0, + "maxNotional": 50000.0, "maintenanceMarginRate": 0.025, "maxLeverage": 20.0, "info": { "bracket": "2", "initialLeverage": "20", - "notionalCap": "25000", + "notionalCap": "50000", "notionalFloor": "5000", "maintMarginRatio": "0.025", - "cum": "75.0" + "cum": "50.0" } }, { "tier": 3.0, "currency": "USDT", - "minNotional": 25000.0, + "minNotional": 50000.0, "maxNotional": 600000.0, "maintenanceMarginRate": 0.05, "maxLeverage": 10.0, @@ -30419,9 +32813,9 @@ "bracket": "3", "initialLeverage": "10", "notionalCap": "600000", - "notionalFloor": "25000", + "notionalFloor": "50000", "maintMarginRatio": "0.05", - "cum": "700.0" + "cum": "1300.0" } }, { @@ -30437,7 +32831,7 @@ "notionalCap": "1600000", "notionalFloor": "600000", "maintMarginRatio": "0.1", - "cum": "30700.0" + "cum": "31300.0" } }, { @@ -30453,7 +32847,7 @@ "notionalCap": "2000000", "notionalFloor": "1600000", "maintMarginRatio": "0.125", - "cum": "70700.0" + "cum": "71300.0" } }, { @@ -30469,7 +32863,7 @@ "notionalCap": "6000000", "notionalFloor": "2000000", "maintMarginRatio": "0.25", - "cum": "320700.0" + "cum": "321300.0" } }, { @@ -30485,7 +32879,7 @@ "notionalCap": "10000000", "notionalFloor": "6000000", "maintMarginRatio": "0.5", - "cum": "1820700.0" + "cum": "1821300.0" } } ], diff --git a/freqtrade/exchange/bittrex.py b/freqtrade/exchange/bittrex.py deleted file mode 100644 index 69e2f2b8d..000000000 --- a/freqtrade/exchange/bittrex.py +++ /dev/null @@ -1,25 +0,0 @@ -""" Bittrex exchange subclass """ -import logging -from typing import Dict - -from freqtrade.exchange import Exchange - - -logger = logging.getLogger(__name__) - - -class Bittrex(Exchange): - """ - Bittrex exchange class. Contains adjustments needed for Freqtrade to work - with this exchange. - """ - - _ft_has: Dict = { - "ohlcv_candle_limit_per_timeframe": { - '1m': 1440, - '5m': 288, - '1h': 744, - '1d': 365, - }, - "l2_limit_range": [1, 25, 500], - } diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 5d0bc704f..34d5e007b 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -330,6 +330,7 @@ class Exchange: Exchange ohlcv candle limit Uses ohlcv_candle_limit_per_timeframe if the exchange has different limits per timeframe (e.g. bittrex), otherwise falls back to ohlcv_candle_limit + TODO: this is most likely no longer needed since only bittrex needed this. :param timeframe: Timeframe to check :param candle_type: Candle-type :param since_ms: Starting timestamp diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index e3027267b..6316c0a86 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -323,7 +323,7 @@ class FreqaiDataDrawer: index = self.historic_predictions[pair].index[-1:] columns = self.historic_predictions[pair].columns - zeros_df = pd.DataFrame(np.zeros, index=index, columns=columns) + zeros_df = pd.DataFrame(np.zeros((1, len(columns))), index=index, columns=columns) self.historic_predictions[pair] = pd.concat( [self.historic_predictions[pair], zeros_df], ignore_index=True, axis=0) df = self.historic_predictions[pair] diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index d58943777..1bdd8b0d5 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -244,7 +244,7 @@ class FreqaiDataKitchen: f"{self.pair}: dropped {len(unfiltered_df) - len(filtered_df)} training points" f" due to NaNs in populated dataset {len(unfiltered_df)}." ) - if len(unfiltered_df) == 0 and not self.live: + if len(filtered_df) == 0 and not self.live: raise OperationalException( f"{self.pair}: all training data dropped due to NaNs. " "You likely did not download enough training data prior " diff --git a/freqtrade/freqai/prediction_models/SKLearnRandomForestClassifier.py b/freqtrade/freqai/prediction_models/SKLearnRandomForestClassifier.py new file mode 100644 index 000000000..4462efc49 --- /dev/null +++ b/freqtrade/freqai/prediction_models/SKLearnRandomForestClassifier.py @@ -0,0 +1,82 @@ +import logging +from typing import Any, Dict, Tuple + +import numpy as np +import numpy.typing as npt +from pandas import DataFrame +from sklearn.ensemble import RandomForestClassifier +from sklearn.preprocessing import LabelEncoder + +from freqtrade.freqai.base_models.BaseClassifierModel import BaseClassifierModel +from freqtrade.freqai.data_kitchen import FreqaiDataKitchen + + +logger = logging.getLogger(__name__) + + +class SKLearnRandomForestClassifier(BaseClassifierModel): + """ + User created prediction model. The class inherits IFreqaiModel, which + means it has full access to all Frequency AI functionality. Typically, + users would use this to override the common `fit()`, `train()`, or + `predict()` methods to add their custom data handling tools or change + various aspects of the training that cannot be configured via the + top level config.json file. + """ + + def fit(self, data_dictionary: Dict, dk: FreqaiDataKitchen, **kwargs) -> Any: + """ + User sets up the training and test data to fit their desired model here + :param data_dictionary: the dictionary holding all data for train, test, + labels, weights + :param dk: The datakitchen object for the current coin/model + """ + + X = data_dictionary["train_features"].to_numpy() + y = data_dictionary["train_labels"].to_numpy()[:, 0] + + if self.freqai_info.get('data_split_parameters', {}).get('test_size', 0.1) == 0: + eval_set = None + else: + test_features = data_dictionary["test_features"].to_numpy() + test_labels = data_dictionary["test_labels"].to_numpy()[:, 0] + + eval_set = (test_features, test_labels) + + if self.freqai_info.get("continual_learning", False): + logger.warning("Continual learning is not supported for " + "SKLearnRandomForestClassifier, ignoring.") + + train_weights = data_dictionary["train_weights"] + + model = RandomForestClassifier(**self.model_training_parameters) + + model.fit(X=X, y=y, sample_weight=train_weights) + if eval_set: + logger.info("Score: %s", model.score(eval_set[0], eval_set[1])) + + return model + + def predict( + self, unfiltered_df: DataFrame, dk: FreqaiDataKitchen, **kwargs + ) -> Tuple[DataFrame, npt.NDArray[np.int_]]: + """ + Filter the prediction features data and predict with it. + :param unfiltered_df: Full dataframe for the current backtest period. + :return: + :pred_df: dataframe containing the predictions + :do_predict: np.array of 1s and 0s to indicate places where freqai needed to remove + data (NaNs) or felt uncertain about data (PCA and DI index) + """ + + (pred_df, dk.do_predict) = super().predict(unfiltered_df, dk, **kwargs) + + le = LabelEncoder() + label = dk.label_list[0] + labels_before = list(dk.data['labels_std'].keys()) + labels_after = le.fit_transform(labels_before).tolist() + pred_df[label] = le.inverse_transform(pred_df[label]) + pred_df = pred_df.rename( + columns={labels_after[i]: labels_before[i] for i in range(len(labels_before))}) + + return (pred_df, dk.do_predict) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 3a20bfbbe..c8eafc022 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -580,7 +580,8 @@ class FreqtradeBot(LoggingMixin): else: self.log_once(f"Pair {pair} is currently locked.", logger.info) return False - stake_amount = self.wallets.get_trade_stake_amount(pair, self.edge) + stake_amount = self.wallets.get_trade_stake_amount( + pair, self.config['max_open_trades'], self.edge) bid_check_dom = self.config.get('entry_pricing', {}).get('check_depth_of_market', {}) if ((bid_check_dom.get('enabled', False)) and diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 791317373..853c2c14d 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -147,9 +147,7 @@ class Backtesting: if self.config.get('freqai', {}).get('enabled', False): # For FreqAI, increase the required_startup to includes the training data - self.freqai_startup_candles = self.dataprovider.get_required_startup( - self.timeframe - ) + self.required_startup = self.dataprovider.get_required_startup(self.timeframe) # Add maximum startup candle count to configuration for informative pairs support self.config['startup_candle_count'] = self.required_startup @@ -236,17 +234,12 @@ class Backtesting: """ self.progress.init_step(BacktestState.DATALOAD, 1) - if self.config.get('freqai', {}).get('enabled', False): - startup_candle_count = self.freqai_startup_candles - else: - startup_candle_count = self.config['startup_candle_count'] - data = history.load_data( datadir=self.config['datadir'], pairs=self.pairlists.whitelist, timeframe=self.timeframe, timerange=self.timerange, - startup_candles=startup_candle_count, + startup_candles=self.config['startup_candle_count'], fail_without_data=True, data_format=self.config['dataformat_ohlcv'], candle_type=self.config.get('candle_type_def', CandleType.SPOT) @@ -283,11 +276,13 @@ class Backtesting: else: self.detail_data = {} if self.trading_mode == TradingMode.FUTURES: + self.funding_fee_timeframe: str = self.exchange.get_option('mark_ohlcv_timeframe') + self.funding_fee_timeframe_secs: int = timeframe_to_seconds(self.funding_fee_timeframe) # Load additional futures data. funding_rates_dict = history.load_data( datadir=self.config['datadir'], pairs=self.pairlists.whitelist, - timeframe=self.exchange.get_option('mark_ohlcv_timeframe'), + timeframe=self.funding_fee_timeframe, timerange=self.timerange, startup_candles=0, fail_without_data=True, @@ -299,7 +294,7 @@ class Backtesting: mark_rates_dict = history.load_data( datadir=self.config['datadir'], pairs=self.pairlists.whitelist, - timeframe=self.exchange.get_option('mark_ohlcv_timeframe'), + timeframe=self.funding_fee_timeframe, timerange=self.timerange, startup_candles=0, fail_without_data=True, @@ -601,6 +596,8 @@ class Backtesting: """ if order and self._get_order_filled(order.ft_price, row): order.close_bt_order(current_date, trade) + self._run_funding_fees(trade, current_date, force=True) + if not (order.ft_order_side == trade.exit_side and order.safe_amount == trade.amount): # trade is still open trade.set_liquidation_price(self.exchange.get_liquidation_price( @@ -722,16 +719,7 @@ class Backtesting: self, trade: LocalTrade, row: Tuple, current_time: datetime ) -> Optional[LocalTrade]: - if self.trading_mode == TradingMode.FUTURES: - trade.set_funding_fees( - self.exchange.calculate_funding_fees( - self.futures_data[trade.pair], - amount=trade.amount, - is_short=trade.is_short, - open_date=trade.date_last_filled_utc, - close_date=current_time - ) - ) + self._run_funding_fees(trade, current_time) # Check if we need to adjust our current positions if self.strategy.position_adjustment_enable: @@ -750,6 +738,27 @@ class Backtesting: return t return None + def _run_funding_fees(self, trade: LocalTrade, current_time: datetime, force: bool = False): + """ + Calculate funding fees if necessary and add them to the trade. + """ + if self.trading_mode == TradingMode.FUTURES: + + if ( + force + or (current_time.timestamp() % self.funding_fee_timeframe_secs) == 0 + ): + # Funding fee interval. + trade.set_funding_fees( + self.exchange.calculate_funding_fees( + self.futures_data[trade.pair], + amount=trade.amount, + is_short=trade.is_short, + open_date=trade.date_last_filled_utc, + close_date=current_time + ) + ) + def get_valid_price_and_stake( self, pair: str, row: Tuple, propose_rate: float, stake_amount: float, direction: LongShort, current_time: datetime, entry_tag: Optional[str], @@ -779,7 +788,8 @@ class Backtesting: leverage = trade.leverage if trade else 1.0 if not pos_adjust: try: - stake_amount = self.wallets.get_trade_stake_amount(pair, None, update=False) + stake_amount = self.wallets.get_trade_stake_amount( + pair, self.strategy.max_open_trades, update=False) except DependencyException: return 0, 0, 0, 0 @@ -961,7 +971,7 @@ class Backtesting: def trade_slot_available(self, open_trade_count: int) -> bool: # Always allow trades when max_open_trades is enabled. - max_open_trades: IntOrInf = self.config['max_open_trades'] + max_open_trades: IntOrInf = self.strategy.max_open_trades if max_open_trades <= 0 or open_trade_count < max_open_trades: return True # Rejected trade diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index cba38d84a..5d5d15b03 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -500,7 +500,7 @@ class Hyperopt: while i < 5 and len(asked_non_tried) < n_points: if i < 3: self.opt.cache_ = {} - asked = unique_list(self.opt.ask(n_points=n_points * 5)) + asked = unique_list(self.opt.ask(n_points=n_points * 5 if i > 0 else n_points)) is_random = [False for _ in range(len(asked))] else: asked = unique_list(self.opt.space.rvs(n_samples=n_points * 5)) @@ -637,6 +637,10 @@ class Hyperopt: HyperoptTools.show_epoch_details(self.current_best_epoch, self.total_epochs, self.print_json) + elif self.num_epochs_saved > 0: + print( + f"No good result found for given optimization function in {self.num_epochs_saved} " + f"{plural(self.num_epochs_saved, 'epoch')}.") else: # This is printed when Ctrl+C is pressed quickly, before first epochs have # a chance to be evaluated. diff --git a/freqtrade/rpc/api_server/api_schemas.py b/freqtrade/rpc/api_server/api_schemas.py index 7e723bbef..770f68a5d 100644 --- a/freqtrade/rpc/api_server/api_schemas.py +++ b/freqtrade/rpc/api_server/api_schemas.py @@ -471,6 +471,7 @@ class FreqAIModelListResponse(BaseModel): class StrategyResponse(BaseModel): strategy: str code: str + timeframe: Optional[str] class AvailablePairs(BaseModel): diff --git a/freqtrade/rpc/api_server/api_v1.py b/freqtrade/rpc/api_server/api_v1.py index f19010945..4f4aac32c 100644 --- a/freqtrade/rpc/api_server/api_v1.py +++ b/freqtrade/rpc/api_server/api_v1.py @@ -350,6 +350,7 @@ def get_strategy(strategy: str, config=Depends(get_config)): return { 'strategy': strategy_obj.get_strategy_name(), 'code': strategy_obj.__source__, + 'timeframe': getattr(strategy_obj, 'timeframe', None), } diff --git a/freqtrade/rpc/fiat_convert.py b/freqtrade/rpc/fiat_convert.py index d084725d1..2453f4f25 100644 --- a/freqtrade/rpc/fiat_convert.py +++ b/freqtrade/rpc/fiat_convert.py @@ -28,6 +28,7 @@ coingecko_mapping = { 'busd': 'binance-usd', 'tusd': 'true-usd', 'usdc': 'usd-coin', + 'btc': 'bitcoin' } diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index ef789db52..809c63e78 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -121,8 +121,8 @@ class RPC: 'stake_currency_decimals': decimals_per_coin(config['stake_currency']), 'stake_amount': str(config['stake_amount']), 'available_capital': config.get('available_capital'), - 'max_open_trades': (config['max_open_trades'] - if config['max_open_trades'] != float('inf') else -1), + 'max_open_trades': (config.get('max_open_trades', 0) + if config.get('max_open_trades', 0) != float('inf') else -1), 'minimal_roi': config['minimal_roi'].copy() if 'minimal_roi' in config else {}, 'stoploss': config.get('stoploss'), 'stoploss_on_exchange': config.get('order_types', @@ -914,7 +914,8 @@ class RPC: if not stake_amount: # gen stake amount - stake_amount = self._freqtrade.wallets.get_trade_stake_amount(pair) + stake_amount = self._freqtrade.wallets.get_trade_stake_amount( + pair, self._config['max_open_trades']) # execute buy if not order_type: diff --git a/freqtrade/templates/FreqaiExampleStrategy.py b/freqtrade/templates/FreqaiExampleStrategy.py index 8be1f0336..93b916e38 100644 --- a/freqtrade/templates/FreqaiExampleStrategy.py +++ b/freqtrade/templates/FreqaiExampleStrategy.py @@ -6,7 +6,7 @@ import talib.abstract as ta from pandas import DataFrame from technical import qtpylib -from freqtrade.strategy import CategoricalParameter, IStrategy +from freqtrade.strategy import IStrategy logger = logging.getLogger(__name__) @@ -45,11 +45,6 @@ class FreqaiExampleStrategy(IStrategy): startup_candle_count: int = 40 can_short = True - std_dev_multiplier_buy = CategoricalParameter( - [0.75, 1, 1.25, 1.5, 1.75], default=1.25, space="buy", optimize=True) - std_dev_multiplier_sell = CategoricalParameter( - [0.75, 1, 1.25, 1.5, 1.75], space="sell", default=1.25, optimize=True) - def feature_engineering_expand_all(self, dataframe: DataFrame, period: int, metadata: Dict, **kwargs) -> DataFrame: """ @@ -239,21 +234,13 @@ class FreqaiExampleStrategy(IStrategy): dataframe = self.freqai.start(dataframe, metadata, self) - for val in self.std_dev_multiplier_buy.range: - dataframe[f'target_roi_{val}'] = ( - dataframe["&-s_close_mean"] + dataframe["&-s_close_std"] * val - ) - for val in self.std_dev_multiplier_sell.range: - dataframe[f'sell_roi_{val}'] = ( - dataframe["&-s_close_mean"] - dataframe["&-s_close_std"] * val - ) return dataframe def populate_entry_trend(self, df: DataFrame, metadata: dict) -> DataFrame: enter_long_conditions = [ df["do_predict"] == 1, - df["&-s_close"] > df[f"target_roi_{self.std_dev_multiplier_buy.value}"], + df["&-s_close"] > 0.01, ] if enter_long_conditions: @@ -263,7 +250,7 @@ class FreqaiExampleStrategy(IStrategy): enter_short_conditions = [ df["do_predict"] == 1, - df["&-s_close"] < df[f"sell_roi_{self.std_dev_multiplier_sell.value}"], + df["&-s_close"] < -0.01, ] if enter_short_conditions: @@ -276,14 +263,14 @@ class FreqaiExampleStrategy(IStrategy): def populate_exit_trend(self, df: DataFrame, metadata: dict) -> DataFrame: exit_long_conditions = [ df["do_predict"] == 1, - df["&-s_close"] < df[f"sell_roi_{self.std_dev_multiplier_sell.value}"] * 0.25, + df["&-s_close"] < 0 ] if exit_long_conditions: df.loc[reduce(lambda x, y: x & y, exit_long_conditions), "exit_long"] = 1 exit_short_conditions = [ df["do_predict"] == 1, - df["&-s_close"] > df[f"target_roi_{self.std_dev_multiplier_buy.value}"] * 0.25, + df["&-s_close"] > 0 ] if exit_short_conditions: df.loc[reduce(lambda x, y: x & y, exit_short_conditions), "exit_short"] = 1 diff --git a/freqtrade/templates/base_config.json.j2 b/freqtrade/templates/base_config.json.j2 index 1a4552c11..caa27a69e 100644 --- a/freqtrade/templates/base_config.json.j2 +++ b/freqtrade/templates/base_config.json.j2 @@ -39,7 +39,7 @@ }, {{ exchange | indent(4) }}, "pairlists": [ - {{ '{"method": "StaticPairList"}' if exchange_name == 'bittrex' else volume_pairlist }} + {{ volume_pairlist }} ], "telegram": { "enabled": {{ telegram | lower }}, diff --git a/freqtrade/wallets.py b/freqtrade/wallets.py index ceef8d158..0f41114ed 100644 --- a/freqtrade/wallets.py +++ b/freqtrade/wallets.py @@ -6,7 +6,7 @@ from copy import deepcopy from datetime import datetime, timedelta from typing import Dict, NamedTuple, Optional -from freqtrade.constants import UNLIMITED_STAKE_AMOUNT, Config +from freqtrade.constants import UNLIMITED_STAKE_AMOUNT, Config, IntOrInf from freqtrade.enums import RunMode, TradingMode from freqtrade.exceptions import DependencyException from freqtrade.exchange import Exchange @@ -262,15 +262,15 @@ class Wallets: return min(self.get_total_stake_amount() - Trade.total_open_trades_stakes(), free) def _calculate_unlimited_stake_amount(self, available_amount: float, - val_tied_up: float) -> float: + val_tied_up: float, max_open_trades: IntOrInf) -> float: """ Calculate stake amount for "unlimited" stake amount :return: 0 if max number of trades reached, else stake_amount to use. """ - if self._config['max_open_trades'] == 0: + if max_open_trades == 0: return 0 - possible_stake = (available_amount + val_tied_up) / self._config['max_open_trades'] + possible_stake = (available_amount + val_tied_up) / max_open_trades # Theoretical amount can be above available amount - therefore limit to available amount! return min(possible_stake, available_amount) @@ -298,7 +298,8 @@ class Wallets: return stake_amount - def get_trade_stake_amount(self, pair: str, edge=None, update: bool = True) -> float: + def get_trade_stake_amount( + self, pair: str, max_open_trades: IntOrInf, edge=None, update: bool = True) -> float: """ Calculate stake amount for the trade :return: float: Stake amount @@ -322,7 +323,7 @@ class Wallets: stake_amount = self._config['stake_amount'] if stake_amount == UNLIMITED_STAKE_AMOUNT: stake_amount = self._calculate_unlimited_stake_amount( - available_amount, val_tied_up) + available_amount, val_tied_up, max_open_trades) return self._check_available_stake_amount(stake_amount, available_amount) diff --git a/pyproject.toml b/pyproject.toml index bcfc1e551..c446419e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,55 @@ requires = ["setuptools >= 64.0.0", "wheel"] build-backend = "setuptools.build_meta" +[project] +name = "freqtrade" +dynamic = ["version", "dependencies", "optional-dependencies"] + +authors = [ + {name = "Freqtrade Team"}, + {name = "Freqtrade Team", email = "freqtrade@protonmail.com"}, +] + +description = "Freqtrade - Crypto Trading Bot" +readme = "README.md" +requires-python = ">=3.9" +license = {text = "GPLv3"} +# license = "GPLv3" +classifiers = [ + "Environment :: Console", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: MacOS", + "Operating System :: Unix", + "Topic :: Office/Business :: Financial :: Investment", +] + + +[project.urls] +Homepage = "https://github.com/freqtrade/freqtrade" +Documentation = "https://freqtrade.io" +"Bug Tracker" = "https://github.com/freqtrade/freqtrade/issues" + + +[project.scripts] +freqtrade = "freqtrade.main:main" + +[tool.setuptools] +include-package-data = true +zip-safe = false + +[tool.setuptools.packages.find] +where = ["."] +include = ["freqtrade*"] +exclude = ["tests", "tests.*"] +namespaces = true + +[tool.setuptools.dynamic] +version = {attr = "freqtrade.__version__"} + [tool.black] line-length = 100 exclude = ''' @@ -93,3 +142,18 @@ max-complexity = 12 [tool.ruff.per-file-ignores] "tests/*" = ["S"] + +[tool.flake8] +# Default from https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-ignore +# minus E226 +ignore = ["E121","E123","E126","E24","E704","W503","W504"] +max-line-length = 100 +max-complexity = 12 +exclude = [ + ".git", + "__pycache__", + ".eggs", + "user_data", + ".venv", + ".env", +] diff --git a/requirements-dev.txt b/requirements-dev.txt index 2302a0426..32e2cf4f9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,15 +7,15 @@ -r docs/requirements-docs.txt coveralls==3.3.1 -ruff==0.1.6 +ruff==0.1.8 mypy==1.7.1 -pre-commit==3.5.0 +pre-commit==3.6.0 pytest==7.4.3 pytest-asyncio==0.21.1 pytest-cov==4.1.0 pytest-mock==3.12.0 pytest-random-order==1.1.0 -isort==5.12.0 +isort==5.13.2 # For datetime mocking time-machine==2.13.0 diff --git a/requirements-freqai-rl.txt b/requirements-freqai-rl.txt index fba25d409..55a09e6f9 100644 --- a/requirements-freqai-rl.txt +++ b/requirements-freqai-rl.txt @@ -2,7 +2,7 @@ -r requirements-freqai.txt # Required for freqai-rl -torch==2.0.1 +torch==2.1.2 #until these branches will be released we can use this gymnasium==0.29.1 stable_baselines3==2.2.1 diff --git a/requirements-freqai.txt b/requirements-freqai.txt index d990b0714..7d817c2d9 100644 --- a/requirements-freqai.txt +++ b/requirements-freqai.txt @@ -3,7 +3,7 @@ -r requirements-plot.txt # Required for freqai -scikit-learn==1.1.3 +scikit-learn==1.3.2 joblib==1.3.2 catboost==1.2.2; 'arm' not in platform_machine lightgbm==4.1.0 diff --git a/requirements-hyperopt.txt b/requirements-hyperopt.txt index b4bca9751..d7f440c0a 100644 --- a/requirements-hyperopt.txt +++ b/requirements-hyperopt.txt @@ -3,6 +3,6 @@ # Required for hyperopt scipy==1.11.4 -scikit-learn==1.1.3 -scikit-optimize==0.9.0 +scikit-learn==1.3.2 +ft-scikit-optimize==0.9.2 filelock==3.13.1 diff --git a/requirements.txt b/requirements.txt index 5ef69111d..98930b1b5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ numpy==1.26.2 -pandas==2.1.3 +pandas==2.1.4 pandas-ta==0.3.14b -ccxt==4.1.76 +ccxt==4.1.91 cryptography==41.0.7 aiohttp==3.9.1 SQLAlchemy==2.0.23 @@ -15,7 +15,7 @@ requests==2.31.0 urllib3==2.1.0 jsonschema==4.20.0 TA-Lib==0.4.28 -technical==1.4.0 +technical==1.4.2 tabulate==0.9.0 pycoingecko==3.1.0 jinja2==3.1.2 @@ -28,7 +28,7 @@ pyarrow==14.0.1; platform_machine != 'armv7l' py_find_1st==1.1.6 # Load ticker files 30% faster -python-rapidjson==1.13 +python-rapidjson==1.14 # Properly format api responses orjson==3.9.10 @@ -36,12 +36,12 @@ orjson==3.9.10 sdnotify==0.3.2 # API Server -fastapi==0.104.1 +fastapi==0.105.0 pydantic==2.5.2 uvicorn==0.24.0.post1 pyjwt==2.8.0 aiofiles==23.2.1 -psutil==5.9.6 +psutil==5.9.7 # Support for colorized terminal output colorama==0.4.6 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d4d70bc34..000000000 --- a/setup.cfg +++ /dev/null @@ -1,53 +0,0 @@ -[metadata] -name = freqtrade -version = attr: freqtrade.__version__ -author = Freqtrade Team -author_email = freqtrade@protonmail.com -description = Freqtrade - Crypto Trading Bot -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/freqtrade/freqtrade -project_urls = - Bug Tracker = https://github.com/freqtrade/freqtrade/issues -license = GPLv3 -classifiers = - Environment :: Console - Intended Audience :: Science/Research - License :: OSI Approved :: GNU General Public License v3 (GPLv3) - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Operating System :: MacOS - Operating System :: Unix - Topic :: Office/Business :: Financial :: Investment - - -[options] -zip_safe = False -include_package_data = True -tests_require = - pytest - pytest-asyncio - pytest-cov - pytest-mock - -packages = find: -python_requires = >=3.9 - -[options.entry_points] -console_scripts = - freqtrade = freqtrade.main:main - -[flake8] -# Default from https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-ignore -# minus E226 -ignore = E121,E123,E126,E24,E704,W503,W504 -max-line-length = 100 -max-complexity = 12 -exclude = - .git, - __pycache__, - .eggs, - user_data, - .venv - .env diff --git a/setup.py b/setup.py index 2e92d0839..8100f21ae 100644 --- a/setup.py +++ b/setup.py @@ -5,8 +5,8 @@ from setuptools import setup plot = ['plotly>=4.0'] hyperopt = [ 'scipy', - 'scikit-learn<=1.1.3', - 'scikit-optimize>=0.7.0', + 'scikit-learn', + 'ft-scikit-optimize>=0.9.2', 'filelock', ] @@ -122,4 +122,5 @@ setup( 'freqai_rl': freqai_rl, 'all': all_extra, }, + url="https://github.com/freqtrade/freqtrade", ) diff --git a/tests/commands/test_build_config.py b/tests/commands/test_build_config.py index 7bf374ae0..f799be3ba 100644 --- a/tests/commands/test_build_config.py +++ b/tests/commands/test_build_config.py @@ -30,7 +30,7 @@ def test_validate_is_int(): assert not validate_is_int('-ee') -@pytest.mark.parametrize('exchange', ['bittrex', 'binance', 'kraken']) +@pytest.mark.parametrize('exchange', ['bybit', 'binance', 'kraken']) def test_start_new_config(mocker, caplog, exchange): wt_mock = mocker.patch.object(Path, "write_text", MagicMock()) mocker.patch.object(Path, "exists", MagicMock(return_value=True)) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 7698740a5..d6d2b5794 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -32,7 +32,7 @@ from tests.conftest_trades import MOCK_TRADE_COUNT def test_setup_utils_configuration(): args = [ - 'list-exchanges', '--config', 'config_examples/config_bittrex.example.json', + 'list-exchanges', '--config', 'tests/testdata/testconfigs/main_test_config.json', ] config = setup_utils_configuration(get_args(args), RunMode.OTHER) @@ -49,7 +49,7 @@ def test_start_trading_fail(mocker, caplog): exitmock = mocker.patch("freqtrade.worker.Worker.exit", MagicMock()) args = [ 'trade', - '-c', 'config_examples/config_bittrex.example.json' + '-c', 'tests/testdata/testconfigs/main_test_config.json' ] start_trading(get_args(args)) assert exitmock.call_count == 1 @@ -68,7 +68,7 @@ def test_start_webserver(mocker, caplog): args = [ 'webserver', - '-c', 'config_examples/config_bittrex.example.json' + '-c', 'tests/testdata/testconfigs/main_test_config.json' ] start_webserver(get_args(args)) assert api_server_mock.call_count == 1 @@ -84,7 +84,7 @@ def test_list_exchanges(capsys): captured = capsys.readouterr() assert re.match(r"Exchanges available for Freqtrade.*", captured.out) assert re.search(r".*binance.*", captured.out) - assert re.search(r".*bittrex.*", captured.out) + assert re.search(r".*bybit.*", captured.out) # Test with --one-column args = [ @@ -95,7 +95,7 @@ def test_list_exchanges(capsys): start_list_exchanges(get_args(args)) captured = capsys.readouterr() assert re.search(r"^binance$", captured.out, re.MULTILINE) - assert re.search(r"^bittrex$", captured.out, re.MULTILINE) + assert re.search(r"^bybit$", captured.out, re.MULTILINE) # Test with --all args = [ @@ -107,7 +107,7 @@ def test_list_exchanges(capsys): captured = capsys.readouterr() assert re.match(r"All exchanges supported by the ccxt library.*", captured.out) assert re.search(r".*binance.*", captured.out) - assert re.search(r".*bittrex.*", captured.out) + assert re.search(r".*bingx.*", captured.out) assert re.search(r".*bitmex.*", captured.out) # Test with --one-column --all @@ -120,7 +120,7 @@ def test_list_exchanges(capsys): start_list_exchanges(get_args(args)) captured = capsys.readouterr() assert re.search(r"^binance$", captured.out, re.MULTILINE) - assert re.search(r"^bittrex$", captured.out, re.MULTILINE) + assert re.search(r"^bingx$", captured.out, re.MULTILINE) assert re.search(r"^bitmex$", captured.out, re.MULTILINE) @@ -133,7 +133,7 @@ def test_list_timeframes(mocker, capsys): '1h': 'hour', '1d': 'day', } - patch_exchange(mocker, api_mock=api_mock, id='bittrex') + patch_exchange(mocker, api_mock=api_mock, id='bybit') args = [ "list-timeframes", ] @@ -143,25 +143,25 @@ def test_list_timeframes(mocker, capsys): match=r"This command requires a configured exchange.*"): start_list_timeframes(pargs) - # Test with --config config_examples/config_bittrex.example.json + # Test with --config tests/testdata/testconfigs/main_test_config.json args = [ "list-timeframes", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', ] start_list_timeframes(get_args(args)) captured = capsys.readouterr() - assert re.match("Timeframes available for the exchange `Bittrex`: " + assert re.match("Timeframes available for the exchange `Bybit`: " "1m, 5m, 30m, 1h, 1d", captured.out) - # Test with --exchange bittrex + # Test with --exchange bybit args = [ "list-timeframes", - "--exchange", "bittrex", + "--exchange", "bybit", ] start_list_timeframes(get_args(args)) captured = capsys.readouterr() - assert re.match("Timeframes available for the exchange `Bittrex`: " + assert re.match("Timeframes available for the exchange `Bybit`: " "1m, 5m, 30m, 1h, 1d", captured.out) @@ -190,7 +190,7 @@ def test_list_timeframes(mocker, capsys): # Test with --one-column args = [ "list-timeframes", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--one-column", ] start_list_timeframes(get_args(args)) @@ -217,7 +217,7 @@ def test_list_timeframes(mocker, capsys): def test_list_markets(mocker, markets_static, capsys): api_mock = MagicMock() - patch_exchange(mocker, api_mock=api_mock, id='bittrex', mock_markets=markets_static) + patch_exchange(mocker, api_mock=api_mock, id='binance', mock_markets=markets_static) # Test with no --config args = [ @@ -229,15 +229,15 @@ def test_list_markets(mocker, markets_static, capsys): match=r"This command requires a configured exchange.*"): start_list_markets(pargs, False) - # Test with --config config_examples/config_bittrex.example.json + # Test with --config tests/testdata/testconfigs/main_test_config.json args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 12 active markets: " + assert ("Exchange Binance has 12 active markets: " "ADA/USDT:USDT, BLK/BTC, ETH/BTC, ETH/USDT, ETH/USDT:USDT, LTC/BTC, " "LTC/ETH, LTC/USD, NEO/BTC, TKN/BTC, XLTCUSDT, XRP/BTC.\n" in captured.out) @@ -255,16 +255,16 @@ def test_list_markets(mocker, markets_static, capsys): assert re.match("\nExchange Binance has 12 active markets:\n", captured.out) - patch_exchange(mocker, api_mock=api_mock, id="bittrex", mock_markets=markets_static) + patch_exchange(mocker, api_mock=api_mock, id="binance", mock_markets=markets_static) # Test with --all: all markets args = [ "list-markets", "--all", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 14 markets: " + assert ("Exchange Binance has 14 markets: " "ADA/USDT:USDT, BLK/BTC, BTT/BTC, ETH/BTC, ETH/USDT, ETH/USDT:USDT, " "LTC/BTC, LTC/ETH, LTC/USD, LTC/USDT, NEO/BTC, TKN/BTC, XLTCUSDT, XRP/BTC.\n" in captured.out) @@ -272,24 +272,24 @@ def test_list_markets(mocker, markets_static, capsys): # Test list-pairs subcommand: active pairs args = [ "list-pairs", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--print-list", ] start_list_markets(get_args(args), True) captured = capsys.readouterr() - assert ("Exchange Bittrex has 9 active pairs: " + assert ("Exchange Binance has 9 active pairs: " "BLK/BTC, ETH/BTC, ETH/USDT, LTC/BTC, LTC/ETH, LTC/USD, NEO/BTC, TKN/BTC, XRP/BTC.\n" in captured.out) # Test list-pairs subcommand with --all: all pairs args = [ "list-pairs", "--all", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--print-list", ] start_list_markets(get_args(args), True) captured = capsys.readouterr() - assert ("Exchange Bittrex has 11 pairs: " + assert ("Exchange Binance has 11 pairs: " "BLK/BTC, BTT/BTC, ETH/BTC, ETH/USDT, LTC/BTC, LTC/ETH, LTC/USD, LTC/USDT, NEO/BTC, " "TKN/BTC, XRP/BTC.\n" in captured.out) @@ -297,133 +297,133 @@ def test_list_markets(mocker, markets_static, capsys): # active markets, base=ETH, LTC args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--base", "ETH", "LTC", "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 7 active markets with ETH, LTC as base currencies: " + assert ("Exchange Binance has 7 active markets with ETH, LTC as base currencies: " "ETH/BTC, ETH/USDT, ETH/USDT:USDT, LTC/BTC, LTC/ETH, LTC/USD, XLTCUSDT.\n" in captured.out) # active markets, base=LTC args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--base", "LTC", "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 4 active markets with LTC as base currency: " + assert ("Exchange Binance has 4 active markets with LTC as base currency: " "LTC/BTC, LTC/ETH, LTC/USD, XLTCUSDT.\n" in captured.out) # active markets, quote=USDT, USD args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--quote", "USDT", "USD", "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 5 active markets with USDT, USD as quote currencies: " + assert ("Exchange Binance has 5 active markets with USDT, USD as quote currencies: " "ADA/USDT:USDT, ETH/USDT, ETH/USDT:USDT, LTC/USD, XLTCUSDT.\n" in captured.out) # active markets, quote=USDT args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--quote", "USDT", "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 4 active markets with USDT as quote currency: " + assert ("Exchange Binance has 4 active markets with USDT as quote currency: " "ADA/USDT:USDT, ETH/USDT, ETH/USDT:USDT, XLTCUSDT.\n" in captured.out) # active markets, base=LTC, quote=USDT args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--base", "LTC", "--quote", "USDT", "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 1 active market with LTC as base currency and " + assert ("Exchange Binance has 1 active market with LTC as base currency and " "with USDT as quote currency: XLTCUSDT.\n" in captured.out) # active pairs, base=LTC, quote=USDT args = [ "list-pairs", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--base", "LTC", "--quote", "USD", "--print-list", ] start_list_markets(get_args(args), True) captured = capsys.readouterr() - assert ("Exchange Bittrex has 1 active pair with LTC as base currency and " + assert ("Exchange Binance has 1 active pair with LTC as base currency and " "with USD as quote currency: LTC/USD.\n" in captured.out) # active markets, base=LTC, quote=USDT, NONEXISTENT args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--base", "LTC", "--quote", "USDT", "NONEXISTENT", "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 1 active market with LTC as base currency and " + assert ("Exchange Binance has 1 active market with LTC as base currency and " "with USDT, NONEXISTENT as quote currencies: XLTCUSDT.\n" in captured.out) # active markets, base=LTC, quote=NONEXISTENT args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--base", "LTC", "--quote", "NONEXISTENT", "--print-list", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 0 active markets with LTC as base currency and " + assert ("Exchange Binance has 0 active markets with LTC as base currency and " "with NONEXISTENT as quote currency.\n" in captured.out) # Test tabular output args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 12 active markets:\n" + assert ("Exchange Binance has 12 active markets:\n" in captured.out) # Test tabular output, no markets found args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--base", "LTC", "--quote", "NONEXISTENT", ] start_list_markets(get_args(args), False) captured = capsys.readouterr() - assert ("Exchange Bittrex has 0 active markets with LTC as base currency and " + assert ("Exchange Binance has 0 active markets with LTC as base currency and " "with NONEXISTENT as quote currency.\n" in captured.out) # Test --print-json args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--print-json" ] start_list_markets(get_args(args), False) @@ -435,7 +435,7 @@ def test_list_markets(mocker, markets_static, capsys): # Test --print-csv args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--print-csv" ] start_list_markets(get_args(args), False) @@ -447,7 +447,7 @@ def test_list_markets(mocker, markets_static, capsys): # Test --one-column args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--one-column" ] start_list_markets(get_args(args), False) @@ -459,7 +459,7 @@ def test_list_markets(mocker, markets_static, capsys): # Test --one-column args = [ "list-markets", - '--config', 'config_examples/config_bittrex.example.json', + '--config', 'tests/testdata/testconfigs/main_test_config.json', "--one-column" ] with pytest.raises(OperationalException, match=r"Cannot get markets.*"): @@ -971,7 +971,7 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys): patched_configuration_load_config_file(mocker, default_conf) args = [ 'test-pairlist', - '-c', 'config_examples/config_bittrex.example.json' + '-c', 'tests/testdata/testconfigs/main_test_config.json' ] start_test_pairlist(get_args(args)) @@ -985,7 +985,7 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys): args = [ 'test-pairlist', - '-c', 'config_examples/config_bittrex.example.json', + '-c', 'tests/testdata/testconfigs/main_test_config.json', '--one-column', ] start_test_pairlist(get_args(args)) @@ -994,7 +994,7 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys): args = [ 'test-pairlist', - '-c', 'config_examples/config_bittrex.example.json', + '-c', 'tests/testdata/testconfigs/main_test_config.json', '--print-json', ] start_test_pairlist(get_args(args)) diff --git a/tests/conftest.py b/tests/conftest.py index 9b983882a..2d7a805b1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -91,6 +91,8 @@ def generate_test_data(timeframe: str, size: int, start: str = '2020-07-05'): base = np.random.normal(20, 2, size=size) if timeframe == '1M': date = pd.date_range(start, periods=size, freq='1MS', tz='UTC') + elif timeframe == '1w': + date = pd.date_range(start, periods=size, freq='1W-MON', tz='UTC') else: tf_mins = timeframe_to_minutes(timeframe) date = pd.date_range(start, periods=size, freq=f'{tf_mins}min', tz='UTC') diff --git a/tests/data/test_converter.py b/tests/data/test_converter.py index 99c56e1d0..4186708ab 100644 --- a/tests/data/test_converter.py +++ b/tests/data/test_converter.py @@ -64,7 +64,7 @@ def test_ohlcv_fill_up_missing_data(testdatadir, caplog): # Column names should not change assert (data.columns == data2.columns).all() - assert log_has_re(f"Missing data fillup for UNITTEST/BTC: before: " + assert log_has_re(f"Missing data fillup for UNITTEST/BTC, 1m: before: " f"{len(data)} - after: {len(data2)}.*", caplog) # Test fillup actually fixes invalid backtest data @@ -128,7 +128,7 @@ def test_ohlcv_fill_up_missing_data2(caplog): # Column names should not change assert (data.columns == data2.columns).all() - assert log_has_re(f"Missing data fillup for UNITTEST/BTC: before: " + assert log_has_re(f"Missing data fillup for UNITTEST/BTC, {timeframe}: before: " f"{len(data)} - after: {len(data2)}.*", caplog) diff --git a/tests/data/test_dataprovider.py b/tests/data/test_dataprovider.py index 1eeaffb2c..a61dd9679 100644 --- a/tests/data/test_dataprovider.py +++ b/tests/data/test_dataprovider.py @@ -500,3 +500,89 @@ def test_dp__add_external_df(default_conf_usdt): # 36 hours - from 2022-01-03 12:00:00+00:00 to 2022-01-05 00:00:00+00:00 assert isinstance(res[1], int) assert res[1] == 0 + + +def test_dp_get_required_startup(default_conf_usdt): + timeframe = '1h' + default_conf_usdt["timeframe"] = timeframe + dp = DataProvider(default_conf_usdt, None) + + # No FreqAI config + assert dp.get_required_startup('5m', False) == 0 + assert dp.get_required_startup('1h', False) == 0 + assert dp.get_required_startup('1d', False) == 0 + assert dp.get_required_startup('1d', True) == 0 + assert dp.get_required_startup('1d') == 0 + + dp._config['startup_candle_count'] = 20 + assert dp.get_required_startup('5m', False) == 20 + assert dp.get_required_startup('5m', True) == 20 + assert dp.get_required_startup('1h', False) == 20 + assert dp.get_required_startup('1h') == 20 + + # With freqAI config + + dp._config['freqai'] = { + 'enabled': True, + 'train_period_days': 20, + 'feature_parameters': { + 'indicator_periods_candles': [ + 5, + 20, + ] + } + } + assert dp.get_required_startup('5m', False) == 20 + assert dp.get_required_startup('5m', True) == 5780 + + assert dp.get_required_startup('1h', False) == 20 + assert dp.get_required_startup('1h', True) == 500 + + assert dp.get_required_startup('1d', False) == 20 + assert dp.get_required_startup('1d', True) == 40 + assert dp.get_required_startup('1d') == 40 + + # FreqAI kindof ignores startup_candle_count if it's below indicator_periods_candles + dp._config['startup_candle_count'] = 0 + assert dp.get_required_startup('5m', False) == 20 + assert dp.get_required_startup('5m', True) == 5780 + + assert dp.get_required_startup('1h', False) == 20 + assert dp.get_required_startup('1h', True) == 500 + + assert dp.get_required_startup('1d', False) == 20 + assert dp.get_required_startup('1d', True) == 40 + assert dp.get_required_startup('1d') == 40 + + dp._config['freqai']['feature_parameters']['indicator_periods_candles'][1] = 50 + assert dp.get_required_startup('5m', False) == 50 + assert dp.get_required_startup('5m', True) == 5810 + + assert dp.get_required_startup('1h', False) == 50 + assert dp.get_required_startup('1h', True) == 530 + + assert dp.get_required_startup('1d', False) == 50 + assert dp.get_required_startup('1d', True) == 70 + assert dp.get_required_startup('1d') == 70 + + # scenario from issue https://github.com/freqtrade/freqtrade/issues/9432 + dp._config['freqai'] = { + 'enabled': True, + 'train_period_days': 180, + 'feature_parameters': { + 'indicator_periods_candles': [ + 10, + 20, + ] + } + } + dp._config['startup_candle_count'] = 40 + assert dp.get_required_startup('5m', False) == 40 + assert dp.get_required_startup('5m', True) == 51880 + + assert dp.get_required_startup('1h', False) == 40 + assert dp.get_required_startup('1h', True) == 4360 + + assert dp.get_required_startup('1d', False) == 40 + assert dp.get_required_startup('1d', True) == 220 + assert dp.get_required_startup('1d') == 220 diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index 1d26b706f..8d2d52219 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -13,7 +13,7 @@ from freqtrade.enums import CandleType, MarginMode, TradingMode from freqtrade.exceptions import (DDosProtection, DependencyException, ExchangeError, InsufficientFundsError, InvalidOrderException, OperationalException, PricingError, TemporaryError) -from freqtrade.exchange import (Binance, Bittrex, Exchange, Kraken, market_is_active, +from freqtrade.exchange import (Binance, Bybit, Exchange, Kraken, market_is_active, timeframe_to_prev_date) from freqtrade.exchange.common import (API_FETCH_ORDER_RETRY_COUNT, API_RETRY_COUNT, calculate_backoff, remove_exchange_credentials) @@ -228,10 +228,10 @@ def test_exchange_resolver(default_conf, mocker, caplog): assert log_has_re(r"No .* specific subclass found. Using the generic class instead.", caplog) caplog.clear() - default_conf['exchange']['name'] = 'Bittrex' + default_conf['exchange']['name'] = 'Bybit' exchange = ExchangeResolver.load_exchange(default_conf) assert isinstance(exchange, Exchange) - assert isinstance(exchange, Bittrex) + assert isinstance(exchange, Bybit) assert not log_has_re(r"No .* specific subclass found. Using the generic class instead.", caplog) caplog.clear() @@ -263,8 +263,8 @@ def test_exchange_resolver(default_conf, mocker, caplog): def test_validate_order_time_in_force(default_conf, mocker, caplog): caplog.set_level(logging.INFO) - # explicitly test bittrex, exchanges implementing other policies need separate tests - ex = get_patched_exchange(mocker, default_conf, id="bittrex") + # explicitly test bybit, exchanges implementing other policies need separate tests + ex = get_patched_exchange(mocker, default_conf, id="bybit") tif = { "buy": "gtc", "sell": "gtc", @@ -273,11 +273,14 @@ def test_validate_order_time_in_force(default_conf, mocker, caplog): ex.validate_order_time_in_force(tif) tif2 = { "buy": "fok", - "sell": "ioc", + "sell": "ioc22", } with pytest.raises(OperationalException, match=r"Time in force.*not supported for .*"): ex.validate_order_time_in_force(tif2) - + tif2 = { + "buy": "fok", + "sell": "ioc", + } # Patch to see if this will pass if the values are in the ft dict ex._ft_has.update({"order_time_in_force": ["GTC", "FOK", "IOC"]}) ex.validate_order_time_in_force(tif2) @@ -915,7 +918,6 @@ def test_validate_ordertypes(default_conf, mocker): mocker.patch(f'{EXMS}.validate_timeframes') mocker.patch(f'{EXMS}.validate_stakecurrency') mocker.patch(f'{EXMS}.validate_pricing') - mocker.patch(f'{EXMS}.name', 'Bittrex') default_conf['order_types'] = { 'entry': 'limit', @@ -2766,7 +2768,6 @@ async def test___async_get_candle_history_sort(default_conf, mocker, exchange_na assert res_ohlcv[9][4] == 0.07668 assert res_ohlcv[9][5] == 16.65244264 - # Bittrex use-case (real data from Bittrex) # This OHLCV data is ordered ASC (oldest first, newest last) ohlcv = [ [1527827700000, 0.07659999, 0.0766, 0.07627, 0.07657998, 1.85216924], @@ -3410,7 +3411,7 @@ def test_get_fee(default_conf, mocker, exchange_name): def test_stoploss_order_unsupported_exchange(default_conf, mocker): - exchange = get_patched_exchange(mocker, default_conf, id='bittrex') + exchange = get_patched_exchange(mocker, default_conf, id='bitpanda') with pytest.raises(OperationalException, match=r"stoploss is not implemented .*"): exchange.create_stoploss( pair='ETH/BTC', @@ -3606,10 +3607,10 @@ def test_ohlcv_candle_limit(default_conf, mocker, exchange_name): timeframes = ('1m', '5m', '1h') expected = exchange._ft_has['ohlcv_candle_limit'] for timeframe in timeframes: - if 'ohlcv_candle_limit_per_timeframe' in exchange._ft_has: - expected = exchange._ft_has['ohlcv_candle_limit_per_timeframe'][timeframe] - # This should only run for bittrex - assert exchange_name == 'bittrex' + # if 'ohlcv_candle_limit_per_timeframe' in exchange._ft_has: + # expected = exchange._ft_has['ohlcv_candle_limit_per_timeframe'][timeframe] + # This should only run for bittrex + # assert exchange_name == 'bittrex' assert exchange.ohlcv_candle_limit(timeframe, CandleType.SPOT) == expected @@ -4522,10 +4523,10 @@ def test_amount_to_contract_precision( @pytest.mark.parametrize('exchange_name,open_rate,is_short,trading_mode,margin_mode', [ - # Bittrex - ('bittrex', 2.0, False, 'spot', None), - ('bittrex', 2.0, False, 'spot', 'cross'), - ('bittrex', 2.0, True, 'spot', 'isolated'), + # Bybit + ('bybit', 2.0, False, 'spot', None), + ('bybit', 2.0, False, 'spot', 'cross'), + ('bybit', 2.0, True, 'spot', 'isolated'), # Binance ('binance', 2.0, False, 'spot', None), ('binance', 2.0, False, 'spot', 'cross'), @@ -4947,7 +4948,7 @@ def test_get_max_leverage_futures(default_conf, mocker, leverage_tiers): exchange.get_max_leverage("BTC/USDT:USDT", 1000000000.01) -@pytest.mark.parametrize("exchange_name", ['bittrex', 'binance', 'kraken', 'gate', 'okx', 'bybit']) +@pytest.mark.parametrize("exchange_name", ['binance', 'kraken', 'gate', 'okx', 'bybit']) def test__get_params(mocker, default_conf, exchange_name): api_mock = MagicMock() mocker.patch(f'{EXMS}.exchange_has', return_value=True) diff --git a/tests/exchange_online/test_ccxt_compat.py b/tests/exchange_online/test_ccxt_compat.py index b48d70de2..f95f4c000 100644 --- a/tests/exchange_online/test_ccxt_compat.py +++ b/tests/exchange_online/test_ccxt_compat.py @@ -218,9 +218,6 @@ class TestCCXTExchange: def test_ccxt__async_get_candle_history(self, exchange: EXCHANGE_FIXTURE_TYPE): exc, exchangename = exchange - if exchangename in ('bittrex'): - # For some weired reason, this test returns random lengths for bittrex. - pytest.skip("Exchange doesn't provide stable ohlcv history") if not exc._ft_has['ohlcv_has_history']: pytest.skip("Exchange does not support candle history") diff --git a/tests/freqai/conftest.py b/tests/freqai/conftest.py index be208408f..8a9425a32 100644 --- a/tests/freqai/conftest.py +++ b/tests/freqai/conftest.py @@ -20,6 +20,21 @@ def is_mac() -> bool: return "Darwin" in machine +@pytest.fixture(autouse=True) +def patch_torch_initlogs(mocker) -> None: + + if is_mac(): + # Mock torch import completely + import sys + import types + + module_name = 'torch' + mocked_module = types.ModuleType(module_name) + sys.modules[module_name] = mocked_module + else: + mocker.patch("torch._logging._init_logs") + + @pytest.fixture(scope="function") def freqai_conf(default_conf, tmp_path): freqaiconf = deepcopy(default_conf) diff --git a/tests/freqai/test_freqai_interface.py b/tests/freqai/test_freqai_interface.py index 7638c03ed..9fc722ab1 100644 --- a/tests/freqai/test_freqai_interface.py +++ b/tests/freqai/test_freqai_interface.py @@ -176,6 +176,7 @@ def test_extract_data_and_train_model_MultiTargets(mocker, freqai_conf, model, s 'CatboostClassifier', 'XGBoostClassifier', 'XGBoostRFClassifier', + 'SKLearnRandomForestClassifier', 'PyTorchMLPClassifier', ]) def test_extract_data_and_train_model_Classifiers(mocker, freqai_conf, model): diff --git a/tests/optimize/test_backtesting.py b/tests/optimize/test_backtesting.py index ca4dc73f5..fd594e94b 100644 --- a/tests/optimize/test_backtesting.py +++ b/tests/optimize/test_backtesting.py @@ -549,6 +549,7 @@ def test_backtest__enter_trade_futures(default_conf_usdt, fee, mocker) -> None: default_conf_usdt['exchange']['pair_whitelist'] = ['.*'] backtesting = Backtesting(default_conf_usdt) backtesting._set_strategy(backtesting.strategylist[0]) + mocker.patch('freqtrade.optimize.backtesting.Backtesting._run_funding_fees') pair = 'ETH/USDT:USDT' row = [ pd.Timestamp(year=2020, month=1, day=1, hour=5, minute=0), @@ -851,9 +852,13 @@ def test_backtest_one_detail(default_conf_usdt, fee, mocker, testdatadir, use_de assert late_entry > 0 -@pytest.mark.parametrize('use_detail', [True, False]) +@pytest.mark.parametrize('use_detail,exp_funding_fee, exp_ff_updates', [ + (True, -0.018054162, 11), + (False, -0.01780296, 5), + ]) def test_backtest_one_detail_futures( - default_conf_usdt, fee, mocker, testdatadir, use_detail) -> None: + default_conf_usdt, fee, mocker, testdatadir, use_detail, exp_funding_fee, + exp_ff_updates) -> None: default_conf_usdt['use_exit_signal'] = False default_conf_usdt['trading_mode'] = 'futures' default_conf_usdt['margin_mode'] = 'isolated' @@ -882,6 +887,8 @@ def test_backtest_one_detail_futures( default_conf_usdt['max_open_trades'] = 10 backtesting = Backtesting(default_conf_usdt) + ff_spy = mocker.spy(backtesting.exchange, 'calculate_funding_fees') + backtesting._set_strategy(backtesting.strategylist[0]) backtesting.strategy.populate_entry_trend = advise_entry backtesting.strategy.custom_entry_price = custom_entry_price @@ -936,13 +943,22 @@ def test_backtest_one_detail_futures( assert (round(ln2.iloc[0]["low"], 6) <= round( t["close_rate"], 6) <= round(ln2.iloc[0]["high"], 6)) - assert -0.0181 < Trade.trades[1].funding_fees < -0.01 + assert pytest.approx(Trade.trades[1].funding_fees) == exp_funding_fee + assert ff_spy.call_count == exp_ff_updates # assert late_entry > 0 -@pytest.mark.parametrize('use_detail', [True, False]) +@pytest.mark.parametrize('use_detail,entries,max_stake,ff_updates,expected_ff', [ + (True, 50, 3000, 54, -1.18038144), + (False, 6, 360, 10, -0.14679994), +]) def test_backtest_one_detail_futures_funding_fees( - default_conf_usdt, fee, mocker, testdatadir, use_detail) -> None: + default_conf_usdt, fee, mocker, testdatadir, use_detail, entries, max_stake, + ff_updates, expected_ff, +) -> None: + """ + Funding fees are expected to differ, as the maximum position size differs. + """ default_conf_usdt['use_exit_signal'] = False default_conf_usdt['trading_mode'] = 'futures' default_conf_usdt['margin_mode'] = 'isolated' @@ -975,6 +991,7 @@ def test_backtest_one_detail_futures_funding_fees( default_conf_usdt['max_open_trades'] = 1 backtesting = Backtesting(default_conf_usdt) + ff_spy = mocker.spy(backtesting.exchange, 'calculate_funding_fees') backtesting._set_strategy(backtesting.strategylist[0]) backtesting.strategy.populate_entry_trend = advise_entry backtesting.strategy.adjust_trade_position = adjust_trade_position @@ -1000,13 +1017,18 @@ def test_backtest_one_detail_futures_funding_fees( assert len(results) == 1 assert 'orders' in results.columns + # funding_fees have been calculated for each funding-fee candle + # the trade is open for 26 hours - hence we expect the 8h fee to apply 4 times. + # Additional counts will happen due each successful entry, which needs to call this, too. + assert ff_spy.call_count == ff_updates for t in Trade.trades: - # At least 4 adjustment orders - assert t.nr_of_successful_entries >= 6 + # At least 6 adjustment orders + assert t.nr_of_successful_entries == entries # Funding fees will vary depending on the number of adjustment orders # That number is a lot higher with detail data. - assert -1.81 < t.funding_fees < -0.1 + assert t.max_stake_amount == max_stake + assert pytest.approx(t.funding_fees) == expected_ff def test_backtest_timedout_entry_orders(default_conf, fee, mocker, testdatadir) -> None: diff --git a/tests/optimize/test_backtesting_adjust_position.py b/tests/optimize/test_backtesting_adjust_position.py index ad1f31068..9b40b3a9d 100644 --- a/tests/optimize/test_backtesting_adjust_position.py +++ b/tests/optimize/test_backtesting_adjust_position.py @@ -104,6 +104,7 @@ def test_backtest_position_adjustment_detailed(default_conf, fee, mocker, levera mocker.patch(f"{EXMS}.get_max_pair_stake_amount", return_value=float('inf')) mocker.patch(f"{EXMS}.get_max_leverage", return_value=10) mocker.patch(f"{EXMS}.get_maintenance_ratio_and_amt", return_value=(0.1, 0.1)) + mocker.patch('freqtrade.optimize.backtesting.Backtesting._run_funding_fees') patch_exchange(mocker) default_conf.update({ diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index e94509b40..17b0399d9 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -1770,6 +1770,7 @@ def test_api_freqaimodels(botclient, tmp_path, mocker): {'name': 'LightGBMRegressorMultiTarget'}, {'name': 'ReinforcementLearner'}, {'name': 'ReinforcementLearner_multiproc'}, + {'name': 'SKlearnRandomForestClassifier'}, {'name': 'XGBoostClassifier'}, {'name': 'XGBoostRFClassifier'}, {'name': 'XGBoostRFRegressor'}, @@ -1788,6 +1789,7 @@ def test_api_freqaimodels(botclient, tmp_path, mocker): 'LightGBMRegressorMultiTarget', 'ReinforcementLearner', 'ReinforcementLearner_multiproc', + 'SKlearnRandomForestClassifier', 'XGBoostClassifier', 'XGBoostRFClassifier', 'XGBoostRFRegressor', diff --git a/tests/strategy/test_strategy_helpers.py b/tests/strategy/test_strategy_helpers.py index 831856702..22c7359bf 100644 --- a/tests/strategy/test_strategy_helpers.py +++ b/tests/strategy/test_strategy_helpers.py @@ -63,7 +63,35 @@ def test_merge_informative_pair(): assert result.iloc[8]['date_1h'] is pd.NaT -def test_merge_informative_pair_high_tf(): +def test_merge_informative_pair_weekly(): + # Covers roughly 2 months - until 2023-01-10 + data = generate_test_data('1h', 1040, '2022-11-28') + informative = generate_test_data('1w', 40, '2022-11-01') + informative['day'] = informative['date'].dt.day_name() + + result = merge_informative_pair(data, informative, '1h', '1w', ffill=True) + assert isinstance(result, pd.DataFrame) + # 2022-12-24 is a Saturday + candle1 = result.loc[(result['date'] == '2022-12-24T22:00:00.000Z')] + assert candle1.iloc[0]['date'] == pd.Timestamp('2022-12-24T22:00:00.000Z') + assert candle1.iloc[0]['date_1w'] == pd.Timestamp('2022-12-12T00:00:00.000Z') + + candle2 = result.loc[(result['date'] == '2022-12-24T23:00:00.000Z')] + assert candle2.iloc[0]['date'] == pd.Timestamp('2022-12-24T23:00:00.000Z') + assert candle2.iloc[0]['date_1w'] == pd.Timestamp('2022-12-12T00:00:00.000Z') + + # 2022-12-25 is a Sunday + candle3 = result.loc[(result['date'] == '2022-12-25T22:00:00.000Z')] + assert candle3.iloc[0]['date'] == pd.Timestamp('2022-12-25T22:00:00.000Z') + # Still old candle + assert candle3.iloc[0]['date_1w'] == pd.Timestamp('2022-12-12T00:00:00.000Z') + + candle4 = result.loc[(result['date'] == '2022-12-25T23:00:00.000Z')] + assert candle4.iloc[0]['date'] == pd.Timestamp('2022-12-25T23:00:00.000Z') + assert candle4.iloc[0]['date_1w'] == pd.Timestamp('2022-12-19T00:00:00.000Z') + + +def test_merge_informative_pair_monthly(): # Covers roughly 2 months - until 2023-01-10 data = generate_test_data('1h', 1040, '2022-11-28') informative = generate_test_data('1M', 40, '2022-01-01') diff --git a/tests/test_arguments.py b/tests/test_arguments.py index b4f6e7279..e14b09719 100644 --- a/tests/test_arguments.py +++ b/tests/test_arguments.py @@ -173,7 +173,7 @@ def test_download_data_options() -> None: def test_plot_dataframe_options() -> None: args = [ 'plot-dataframe', - '-c', 'config_examples/config_bittrex.example.json', + '-c', 'tests/testdata/testconfigs/main_test_config.json', '--indicators1', 'sma10', 'sma100', '--indicators2', 'macd', 'fastd', 'fastk', '--plot-limit', '30', diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index c9cb86cc0..06d40dfb0 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -146,7 +146,7 @@ def test_get_trade_stake_amount(default_conf_usdt, mocker) -> None: freqtrade = FreqtradeBot(default_conf_usdt) - result = freqtrade.wallets.get_trade_stake_amount('ETH/USDT') + result = freqtrade.wallets.get_trade_stake_amount('ETH/USDT', 1) assert result == default_conf_usdt['stake_amount'] @@ -211,12 +211,12 @@ def test_check_available_stake_amount( if expected[i] is not None: limit_buy_order_usdt_open['id'] = str(i) - result = freqtrade.wallets.get_trade_stake_amount('ETH/USDT') + result = freqtrade.wallets.get_trade_stake_amount('ETH/USDT', 1) assert pytest.approx(result) == expected[i] freqtrade.execute_entry('ETH/USDT', result) else: with pytest.raises(DependencyException): - freqtrade.wallets.get_trade_stake_amount('ETH/USDT') + freqtrade.wallets.get_trade_stake_amount('ETH/USDT', 1) def test_edge_called_in_process(mocker, edge_conf) -> None: @@ -238,9 +238,9 @@ def test_edge_overrides_stake_amount(mocker, edge_conf) -> None: freqtrade = FreqtradeBot(edge_conf) assert freqtrade.wallets.get_trade_stake_amount( - 'NEO/BTC', freqtrade.edge) == (999.9 * 0.5 * 0.01) / 0.20 + 'NEO/BTC', 1, freqtrade.edge) == (999.9 * 0.5 * 0.01) / 0.20 assert freqtrade.wallets.get_trade_stake_amount( - 'LTC/BTC', freqtrade.edge) == (999.9 * 0.5 * 0.01) / 0.21 + 'LTC/BTC', 1, freqtrade.edge) == (999.9 * 0.5 * 0.01) / 0.21 @pytest.mark.parametrize('buy_price_mult,ignore_strat_sl', [ @@ -420,7 +420,8 @@ def test_create_trade_minimal_amount( else: assert not freqtrade.create_trade('ETH/USDT') if not max_open_trades: - assert freqtrade.wallets.get_trade_stake_amount('ETH/USDT', freqtrade.edge) == 0 + assert freqtrade.wallets.get_trade_stake_amount( + 'ETH/USDT', default_conf_usdt['max_open_trades'], freqtrade.edge) == 0 @pytest.mark.parametrize('whitelist,positions', [ @@ -3485,7 +3486,7 @@ def test_handle_cancel_enter(mocker, caplog, default_conf_usdt, limit_order, is_ @pytest.mark.parametrize("is_short", [False, True]) -@pytest.mark.parametrize("limit_buy_order_canceled_empty", ['binance', 'kraken', 'bittrex'], +@pytest.mark.parametrize("limit_buy_order_canceled_empty", ['binance', 'kraken', 'bybit'], indirect=['limit_buy_order_canceled_empty']) def test_handle_cancel_enter_exchanges(mocker, caplog, default_conf_usdt, is_short, fee, limit_buy_order_canceled_empty) -> None: diff --git a/tests/test_integration.py b/tests/test_integration.py index b3b17a7d2..45c424170 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -185,7 +185,7 @@ def test_forcebuy_last_unlimited(default_conf, ticker, fee, mocker, balance_rati trades = Trade.session.scalars(select(Trade)).all() assert len(trades) == 4 - assert freqtrade.wallets.get_trade_stake_amount('XRP/BTC') == result1 + assert freqtrade.wallets.get_trade_stake_amount('XRP/BTC', 5) == result1 rpc._rpc_force_entry('TKN/BTC', None) @@ -205,7 +205,7 @@ def test_forcebuy_last_unlimited(default_conf, ticker, fee, mocker, balance_rati # One trade sold assert len(trades) == 4 # stake-amount should now be reduced, since one trade was sold at a loss. - assert freqtrade.wallets.get_trade_stake_amount('XRP/BTC') < result1 + assert freqtrade.wallets.get_trade_stake_amount('XRP/BTC', 5) < result1 # Validate that balance of sold trade is not in dry-run balances anymore. bals2 = freqtrade.wallets.get_all_balances() assert bals != bals2 diff --git a/tests/test_main.py b/tests/test_main.py index bdb3c2bba..442e6e1d7 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -67,12 +67,12 @@ def test_main_fatal_exception(mocker, default_conf, caplog) -> None: mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock()) mocker.patch('freqtrade.freqtradebot.init_db', MagicMock()) - args = ['trade', '-c', 'config_examples/config_bittrex.example.json'] + args = ['trade', '-c', 'tests/testdata/testconfigs/main_test_config.json'] # Test Main + the KeyboardInterrupt exception with pytest.raises(SystemExit): main(args) - assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog) + assert log_has('Using config: tests/testdata/testconfigs/main_test_config.json ...', caplog) assert log_has('Fatal exception!', caplog) @@ -85,12 +85,12 @@ def test_main_keyboard_interrupt(mocker, default_conf, caplog) -> None: mocker.patch('freqtrade.wallets.Wallets.update', MagicMock()) mocker.patch('freqtrade.freqtradebot.init_db', MagicMock()) - args = ['trade', '-c', 'config_examples/config_bittrex.example.json'] + args = ['trade', '-c', 'tests/testdata/testconfigs/main_test_config.json'] # Test Main + the KeyboardInterrupt exception with pytest.raises(SystemExit): main(args) - assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog) + assert log_has('Using config: tests/testdata/testconfigs/main_test_config.json ...', caplog) assert log_has('SIGINT received, aborting ...', caplog) @@ -106,12 +106,12 @@ def test_main_operational_exception(mocker, default_conf, caplog) -> None: mocker.patch('freqtrade.freqtradebot.RPCManager', MagicMock()) mocker.patch('freqtrade.freqtradebot.init_db', MagicMock()) - args = ['trade', '-c', 'config_examples/config_bittrex.example.json'] + args = ['trade', '-c', 'tests/testdata/testconfigs/main_test_config.json'] # Test Main + the KeyboardInterrupt exception with pytest.raises(SystemExit): main(args) - assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog) + assert log_has('Using config: tests/testdata/testconfigs/main_test_config.json ...', caplog) assert log_has('Oh snap!', caplog) @@ -160,13 +160,13 @@ def test_main_reload_config(mocker, default_conf, caplog) -> None: args = Arguments([ 'trade', '-c', - 'config_examples/config_bittrex.example.json' + 'tests/testdata/testconfigs/main_test_config.json' ]).get_parsed_arg() worker = Worker(args=args, config=default_conf) with pytest.raises(SystemExit): - main(['trade', '-c', 'config_examples/config_bittrex.example.json']) + main(['trade', '-c', 'tests/testdata/testconfigs/main_test_config.json']) - assert log_has('Using config: config_examples/config_bittrex.example.json ...', caplog) + assert log_has('Using config: tests/testdata/testconfigs/main_test_config.json ...', caplog) assert worker_mock.call_count == 4 assert reconfigure_mock.call_count == 1 assert isinstance(worker.freqtrade, FreqtradeBot) @@ -187,7 +187,7 @@ def test_reconfigure(mocker, default_conf) -> None: args = Arguments([ 'trade', '-c', - 'config_examples/config_bittrex.example.json' + 'tests/testdata/testconfigs/main_test_config.json' ]).get_parsed_arg() worker = Worker(args=args, config=default_conf) freqtrade = worker.freqtrade diff --git a/tests/test_plotting.py b/tests/test_plotting.py index 377caf59c..7f80a8588 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -377,7 +377,7 @@ def test_start_plot_dataframe(mocker): aup = mocker.patch("freqtrade.plot.plotting.load_and_plot_trades", MagicMock()) args = [ "plot-dataframe", - "--config", "config_examples/config_bittrex.example.json", + "--config", "tests/testdata/testconfigs/main_test_config.json", "--pairs", "ETH/BTC" ] start_plot_dataframe(get_args(args)) @@ -420,7 +420,7 @@ def test_start_plot_profit(mocker): aup = mocker.patch("freqtrade.plot.plotting.plot_profit", MagicMock()) args = [ "plot-profit", - "--config", "config_examples/config_bittrex.example.json", + "--config", "tests/testdata/testconfigs/main_test_config.json", "--pairs", "ETH/BTC" ] start_plot_profit(get_args(args)) diff --git a/tests/test_wallets.py b/tests/test_wallets.py index 478993058..1c1a3b548 100644 --- a/tests/test_wallets.py +++ b/tests/test_wallets.py @@ -121,7 +121,7 @@ def test_get_trade_stake_amount_no_stake_amount(default_conf, mocker) -> None: freqtrade = get_patched_freqtradebot(mocker, default_conf) with pytest.raises(DependencyException, match=r'.*stake amount.*'): - freqtrade.wallets.get_trade_stake_amount('ETH/BTC') + freqtrade.wallets.get_trade_stake_amount('ETH/BTC', 1) @pytest.mark.parametrize("balance_ratio,capital,result1,result2", [ @@ -148,7 +148,6 @@ def test_get_trade_stake_amount_unlimited_amount(default_conf, ticker, balance_r conf = deepcopy(default_conf) conf['stake_amount'] = UNLIMITED_STAKE_AMOUNT conf['dry_run_wallet'] = 100 - conf['max_open_trades'] = 2 conf['tradable_balance_ratio'] = balance_ratio if capital is not None: conf['available_capital'] = capital @@ -156,30 +155,28 @@ def test_get_trade_stake_amount_unlimited_amount(default_conf, ticker, balance_r freqtrade = get_patched_freqtradebot(mocker, conf) # no open trades, order amount should be 'balance / max_open_trades' - result = freqtrade.wallets.get_trade_stake_amount('ETH/USDT') + result = freqtrade.wallets.get_trade_stake_amount('ETH/USDT', 2) assert result == result1 # create one trade, order amount should be 'balance / (max_open_trades - num_open_trades)' freqtrade.execute_entry('ETH/USDT', result) - result = freqtrade.wallets.get_trade_stake_amount('LTC/USDT') + result = freqtrade.wallets.get_trade_stake_amount('LTC/USDT', 2) assert result == result1 # create 2 trades, order amount should be None freqtrade.execute_entry('LTC/BTC', result) - result = freqtrade.wallets.get_trade_stake_amount('XRP/USDT') + result = freqtrade.wallets.get_trade_stake_amount('XRP/USDT', 2) assert result == 0 - freqtrade.config['max_open_trades'] = 3 freqtrade.config['dry_run_wallet'] = 200 freqtrade.wallets.start_cap = 200 - result = freqtrade.wallets.get_trade_stake_amount('XRP/USDT') + result = freqtrade.wallets.get_trade_stake_amount('XRP/USDT', 3) assert round(result, 4) == round(result2, 4) # set max_open_trades = None, so do not trade - freqtrade.config['max_open_trades'] = 0 - result = freqtrade.wallets.get_trade_stake_amount('NEO/USDT') + result = freqtrade.wallets.get_trade_stake_amount('NEO/USDT', 0) assert result == 0 diff --git a/config_examples/config_bittrex.example.json b/tests/testdata/testconfigs/main_test_config.json similarity index 98% rename from config_examples/config_bittrex.example.json rename to tests/testdata/testconfigs/main_test_config.json index 882b92edc..0af5816dc 100644 --- a/config_examples/config_bittrex.example.json +++ b/tests/testdata/testconfigs/main_test_config.json @@ -29,7 +29,7 @@ "order_book_top": 1 }, "exchange": { - "name": "bittrex", + "name": "binance", "key": "your_exchange_key", "secret": "your_exchange_secret", "ccxt_config": {},