ccxt icon indicating copy to clipboard operation
ccxt copied to clipboard

feat(bybit) - fetchPositionsForSymbol

Open ttodua opened this issue 2 years ago • 2 comments

ttodua avatar Jul 31 '23 07:07 ttodua

fetchPositionsForSymbol('BTC/USDT:USDT')

in hedge-mode, when having both 2 positions ( LONG & SHORT) open together

[
  {
    info: {
      symbol: "BTCUSDT",
      leverage: "10",
      autoAddMargin: "0",
      avgPrice: "37416.5",
      liqPrice: "",
      riskLimitValue: "2000000",
      takeProfit: "",
      positionValue: "112.2495",
      isReduceOnly: false,
      tpslMode: "Full",
      riskId: "1",
      trailingStop: "0",
      unrealisedPnl: "0.0063",
      markPrice: "37414.4",
      adlRankIndicator: "2",
      cumRealisedPnl: "-0.06173723",
      positionMM: "0.1358219",
      createdTime: "1700547356077",
      positionIdx: "2",
      positionIM: "11.3607719",
      seq: "102138292079",
      updatedTime: "1700556860914",
      side: "Sell",
      bustPrice: "",
      positionBalance: "0",
      leverageSysUpdatedTime: "",
      size: "0.003",
      positionStatus: "Normal",
      mmrSysUpdatedTime: "",
      stopLoss: "",
      tradeMode: "0",
    },
    id: undefined,
    symbol: "BTC/USDT:USDT",
    timestamp: 1700556860914,
    datetime: "2023-11-21T08:54:20.914Z",
    lastUpdateTimestamp: undefined,
    initialMargin: 11.3607719,
    initialMarginPercentage: 0.10121000004454363,
    maintenanceMargin: 0.1358219,
    maintenanceMarginPercentage: 0.001210000044543628,
    entryPrice: 37416.5,
    notional: 112.2495,
    leverage: 10,
    unrealizedPnl: 0.0063,
    contracts: 0.003,
    contractSize: 1,
    marginRatio: undefined,
    liquidationPrice: undefined,
    markPrice: 37414.4,
    lastPrice: undefined,
    collateral: 0,
    marginMode: "cross",
    side: "short",
    percentage: undefined,
  },
  {
    info: {
      symbol: "BTCUSDT",
      leverage: "10",
      autoAddMargin: "0",
      avgPrice: "37416.6",
      liqPrice: "",
      riskLimitValue: "2000000",
      takeProfit: "",
      positionValue: "112.2498",
      isReduceOnly: false,
      tpslMode: "Full",
      riskId: "1",
      trailingStop: "0",
      unrealisedPnl: "-0.0066",
      markPrice: "37414.4",
      adlRankIndicator: "2",
      cumRealisedPnl: "-0.06173739",
      positionMM: "0.11112732",
      createdTime: "1700547356077",
      positionIdx: "1",
      positionIM: "0.11112732",
      seq: "102138290594",
      updatedTime: "1700556859221",
      side: "Buy",
      bustPrice: "",
      positionBalance: "0",
      leverageSysUpdatedTime: "",
      size: "0.003",
      positionStatus: "Normal",
      mmrSysUpdatedTime: "",
      stopLoss: "",
      tradeMode: "0",
    },
    id: undefined,
    symbol: "BTC/USDT:USDT",
    timestamp: 1700556859221,
    datetime: "2023-11-21T08:54:19.221Z",
    lastUpdateTimestamp: undefined,
    initialMargin: 0.11112732,
    initialMarginPercentage: 0.000990000160356633,
    maintenanceMargin: 0.11112732,
    maintenanceMarginPercentage: 0.000990000160356633,
    entryPrice: 37416.6,
    notional: 112.2498,
    leverage: 10,
    unrealizedPnl: -0.0066,
    contracts: 0.003,
    contractSize: 1,
    marginRatio: undefined,
    liquidationPrice: undefined,
    markPrice: 37414.4,
    lastPrice: undefined,
    collateral: 0,
    marginMode: "cross",
    side: "long",
    percentage: undefined,
  },
]

ttodua avatar Nov 21 '23 08:11 ttodua

@carlosmiei ready

ttodua avatar Nov 21 '23 11:11 ttodua