fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market https://docs.delta.exchange/#get-ticker-for-a-product-by-symbol :param str symbol: unified symbol of the market to fetch the ticker for :p
(self, symbol: str, params={})
| 1093 | }, market) |
| 1094 | |
| 1095 | def fetch_ticker(self, symbol: str, params={}) -> Ticker: |
| 1096 | """ |
| 1097 | fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market |
| 1098 | |
| 1099 | https://docs.delta.exchange/#get-ticker-for-a-product-by-symbol |
| 1100 | |
| 1101 | :param str symbol: unified symbol of the market to fetch the ticker for |
| 1102 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 1103 | :returns dict: a `ticker structure <https://docs.ccxt.com/?id=ticker-structure>` |
| 1104 | """ |
| 1105 | self.load_markets() |
| 1106 | market = self.market(symbol) |
| 1107 | request = { |
| 1108 | 'symbol': market['id'], |
| 1109 | } |
| 1110 | response = self.publicGetTickersSymbol(self.extend(request, params)) |
| 1111 | # |
| 1112 | # spot |
| 1113 | # |
| 1114 | # { |
| 1115 | # "result": { |
| 1116 | # "close": 30634.0, |
| 1117 | # "contract_type": "spot", |
| 1118 | # "greeks": null, |
| 1119 | # "high": 30780.0, |
| 1120 | # "low": 30340.5, |
| 1121 | # "mark_price": "48000", |
| 1122 | # "oi": "0.0000", |
| 1123 | # "oi_change_usd_6h": "0.0000", |
| 1124 | # "oi_contracts": "0", |
| 1125 | # "oi_value": "0.0000", |
| 1126 | # "oi_value_symbol": "BTC", |
| 1127 | # "oi_value_usd": "0.0000", |
| 1128 | # "open": 30464.0, |
| 1129 | # "price_band": null, |
| 1130 | # "product_id": 8320, |
| 1131 | # "quotes": {}, |
| 1132 | # "size": 2.6816639999999996, |
| 1133 | # "spot_price": "30637.91465121", |
| 1134 | # "symbol": "BTC_USDT", |
| 1135 | # "timestamp": 1689139767621299, |
| 1136 | # "turnover": 2.6816639999999996, |
| 1137 | # "turnover_symbol": "BTC", |
| 1138 | # "turnover_usd": 81896.45613400004, |
| 1139 | # "volume": 2.6816639999999996 |
| 1140 | # }, |
| 1141 | # "success": True |
| 1142 | # } |
| 1143 | # |
| 1144 | # swap |
| 1145 | # |
| 1146 | # { |
| 1147 | # "result": { |
| 1148 | # "close": 30600.5, |
| 1149 | # "contract_type": "perpetual_futures", |
| 1150 | # "funding_rate": "0.00602961", |
| 1151 | # "greeks": null, |
| 1152 | # "high": 30803.0, |
nothing calls this directly
no test coverage detected