Position

Documentation on interacting with ByBit's Position API functions through the PENDAX Javascript SDK.

Get Position Info

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position

Function name:

getPositionInfo(options)

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myByBitAccount = createExchange({
      exchange: "bybit",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "bybit",
      testnet: "false"
});

async function getPositionInfo(exchange, options) {
    try {
        let result = await exchange.getPositionInfo(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getPositionInfo(myByBitAccount, 
    {
       category: 'linear',
       symbol: 'BTCUSDT'
     });

Set Leverage

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/leverage

Function name:

Usage:

Switch Cross/Isolated Margin

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/cross-isolate

Function name:

Usage:

Set TP/SL Mode

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/tpsl-mode

Function name:

Usage:

Switch Position Mode

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/position-mode

Function name:

Usage:

Set Risk Limit

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/set-risk-limit

Function name:

Usage:

Set Trading Stop

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/trading-stop

Function name:

Usage:

Set Auto Add Margin

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/add-margin

Function name:

Usage:

Get Execution

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/execution

Function name:

Usage:

Get Closed PnL

Please refer to the official ByBit API Docs for the required parameters.

https://bybit-exchange.github.io/docs/v5/position/close-pnl

Function name:

Usage:

Last updated