fetch data on an open position https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information :param str symbol: unified market symbol of the market the position is held in :param dict [params]: extra parameters specific to the exchange AP
(self, symbol: str, params={})
| 10341 | return tiers |
| 10342 | |
| 10343 | def fetch_position(self, symbol: str, params={}): |
| 10344 | """ |
| 10345 | fetch data on an open position |
| 10346 | |
| 10347 | https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information |
| 10348 | |
| 10349 | :param str symbol: unified market symbol of the market the position is held in |
| 10350 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 10351 | :returns dict: a `position structure <https://docs.ccxt.com/?id=position-structure>` |
| 10352 | """ |
| 10353 | self.load_markets() |
| 10354 | market = self.market(symbol) |
| 10355 | if not market['option']: |
| 10356 | raise NotSupported(self.id + ' fetchPosition() supports option markets only') |
| 10357 | request = { |
| 10358 | 'symbol': market['id'], |
| 10359 | } |
| 10360 | response = self.eapiPrivateGetPosition(self.extend(request, params)) |
| 10361 | # |
| 10362 | # [ |
| 10363 | # { |
| 10364 | # "entryPrice": "27.70000000", |
| 10365 | # "symbol": "ETH-230426-1850-C", |
| 10366 | # "side": "LONG", |
| 10367 | # "quantity": "0.50000000", |
| 10368 | # "reducibleQty": "0.50000000", |
| 10369 | # "markValue": "10.250000000", |
| 10370 | # "ror": "-0.2599", |
| 10371 | # "unrealizedPNL": "-3.600000000", |
| 10372 | # "markPrice": "20.5", |
| 10373 | # "strikePrice": "1850.00000000", |
| 10374 | # "positionCost": "13.85000000", |
| 10375 | # "expiryDate": 1682496000000, |
| 10376 | # "priceScale": 1, |
| 10377 | # "quantityScale": 2, |
| 10378 | # "optionSide": "CALL", |
| 10379 | # "quoteAsset": "USDT", |
| 10380 | # "time": 1682492427106 |
| 10381 | # } |
| 10382 | # ] |
| 10383 | # |
| 10384 | return self.parse_option_position(response[0], market) |
| 10385 | |
| 10386 | def fetch_option_positions(self, symbols: Strings = None, params={}): |
| 10387 | """ |
nothing calls this directly
no test coverage detected