You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
630 B
27 lines
630 B
#!/usr/bin/env python3
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
|
|
import ccxt
|
|
|
|
|
|
key = os.environ.get('FREQTRADE__EXCHANGE__KEY')
|
|
secret = os.environ.get('FREQTRADE__EXCHANGE__SECRET')
|
|
|
|
proxy = os.environ.get('CI_WEB_PROXY')
|
|
|
|
exchange = ccxt.binance({
|
|
'apiKey': key,
|
|
'secret': secret,
|
|
'httpsProxy': proxy,
|
|
'options': {'defaultType': 'swap'}
|
|
})
|
|
_ = exchange.load_markets()
|
|
|
|
lev_tiers = exchange.fetch_leverage_tiers()
|
|
|
|
# Assumes this is running in the root of the repository.
|
|
file = Path('freqtrade/exchange/binance_leverage_tiers.json')
|
|
json.dump(dict(sorted(lev_tiers.items())), file.open('w'), indent=2)
|