MCPcopy Create free account
hub / github.com/ccxt/ccxt / fetch_position

Method fetch_position

python/ccxt/async_support/bitget.py:7471–7573  ·  view source on GitHub ↗

fetch data on a single open contract trade position https://www.bitget.com/api-doc/contract/position/get-single-position https://www.bitget.com/api-doc/uta/trade/Get-Position :param str symbol: unified market symbol of the market the position is held in :pa

(self, symbol: str, params={})

Source from the content-addressed store, hash-verified

7469 return self.parse_trades(data, market, since, limit)
7470
7471 async def fetch_position(self, symbol: str, params={}):
7472 """
7473 fetch data on a single open contract trade position
7474
7475 https://www.bitget.com/api-doc/contract/position/get-single-position
7476 https://www.bitget.com/api-doc/uta/trade/Get-Position
7477
7478 :param str symbol: unified market symbol of the market the position is held in
7479 :param dict [params]: extra parameters specific to the exchange API endpoint
7480 :param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
7481 :returns dict: a `position structure <https://docs.ccxt.com/?id=position-structure>`
7482 """
7483 await self.load_markets()
7484 market = self.market(symbol)
7485 productType = None
7486 productType, params = self.handle_product_type_and_params(market, params)
7487 request = {
7488 'symbol': market['id'],
7489 }
7490 response = None
7491 uta = None
7492 result = None
7493 uta, params = self.handle_option_and_params(params, 'fetchPosition', 'uta', False)
7494 if uta:
7495 request['category'] = productType
7496 response = await self.privateUtaGetV3PositionCurrentPosition(self.extend(request, params))
7497 #
7498 # {
7499 # "code": "00000",
7500 # "msg": "success",
7501 # "requestTime": 1750929905423,
7502 # "data": {
7503 # "list": [
7504 # {
7505 # "category": "USDT-FUTURES",
7506 # "symbol": "BTCUSDT",
7507 # "marginCoin": "USDT",
7508 # "holdMode": "hedge_mode",
7509 # "posSide": "long",
7510 # "marginMode": "crossed",
7511 # "positionBalance": "5.435199",
7512 # "available": "0.001",
7513 # "frozen": "0",
7514 # "total": "0.001",
7515 # "leverage": "20",
7516 # "curRealisedPnl": "0",
7517 # "avgPrice": "107410.3",
7518 # "positionStatus": "normal",
7519 # "unrealisedPnl": "0.0047",
7520 # "liquidationPrice": "0",
7521 # "mmr": "0.004",
7522 # "profitRate": "0.0008647337475591",
7523 # "markPrice": "107415.3",
7524 # "breakEvenPrice": "107539.2",
7525 # "totalFunding": "0",
7526 # "openFeeTotal": "-0.06444618",
7527 # "closeFeeTotal": "0",
7528 # "createdTime": "1750495670699",

Callers

nothing calls this directly

Calls 10

parse_positionMethod · 0.95
safe_dictMethod · 0.80
safe_listMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected