fetch the current funding rate https://www.gate.com/docs/developers/apiv4/en/#query-single-contract-information :param str symbol: unified market symbol :param dict [params]: extra parameters specific to the exchange API endpoint :returns dict: a `funding r
(self, symbol: str, params={})
| 2000 | }) |
| 2001 | |
| 2002 | def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate: |
| 2003 | """ |
| 2004 | fetch the current funding rate |
| 2005 | |
| 2006 | https://www.gate.com/docs/developers/apiv4/en/#query-single-contract-information |
| 2007 | |
| 2008 | :param str symbol: unified market symbol |
| 2009 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 2010 | :returns dict: a `funding rate structure <https://docs.ccxt.com/?id=funding-rate-structure>` |
| 2011 | """ |
| 2012 | self.load_markets() |
| 2013 | market = self.market(symbol) |
| 2014 | if not market['swap']: |
| 2015 | raise BadSymbol(self.id + ' fetchFundingRate() supports swap contracts only') |
| 2016 | request, query = self.prepare_request(market, None, params) |
| 2017 | response = self.publicFuturesGetSettleContractsContract(self.extend(request, query)) |
| 2018 | # |
| 2019 | # [ |
| 2020 | # { |
| 2021 | # "name": "BTC_USDT", |
| 2022 | # "type": "direct", |
| 2023 | # "quanto_multiplier": "0.0001", |
| 2024 | # "ref_discount_rate": "0", |
| 2025 | # "order_price_deviate": "0.5", |
| 2026 | # "maintenance_rate": "0.005", |
| 2027 | # "mark_type": "index", |
| 2028 | # "last_price": "38026", |
| 2029 | # "mark_price": "37985.6", |
| 2030 | # "index_price": "37954.92", |
| 2031 | # "funding_rate_indicative": "0.000219", |
| 2032 | # "mark_price_round": "0.01", |
| 2033 | # "funding_offset": 0, |
| 2034 | # "in_delisting": False, |
| 2035 | # "risk_limit_base": "1000000", |
| 2036 | # "interest_rate": "0.0003", |
| 2037 | # "order_price_round": "0.1", |
| 2038 | # "order_size_min": 1, |
| 2039 | # "ref_rebate_rate": "0.2", |
| 2040 | # "funding_interval": 28800, |
| 2041 | # "risk_limit_step": "1000000", |
| 2042 | # "leverage_min": "1", |
| 2043 | # "leverage_max": "100", |
| 2044 | # "risk_limit_max": "8000000", |
| 2045 | # "maker_fee_rate": "-0.00025", |
| 2046 | # "taker_fee_rate": "0.00075", |
| 2047 | # "funding_rate": "0.002053", |
| 2048 | # "order_size_max": 1000000, |
| 2049 | # "funding_next_apply": 1610035200, |
| 2050 | # "short_users": 977, |
| 2051 | # "config_change_time": 1609899548, |
| 2052 | # "trade_size": 28530850594, |
| 2053 | # "position_size": 5223816, |
| 2054 | # "long_users": 455, |
| 2055 | # "funding_impact_value": "60000", |
| 2056 | # "orders_limit": 50, |
| 2057 | # "trade_id": 10851092, |
| 2058 | # "orderbook_id": 2129638396 |
| 2059 | # } |
nothing calls this directly
no test coverage detected