Position

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

circle-exclamation

Get Position Info

circle-info

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

https://bybit-exchange.github.io/docs/v5/positionarrow-up-right

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

circle-info

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

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

Function name:

Usage:

Switch Cross/Isolated Margin

circle-info

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

https://bybit-exchange.github.io/docs/v5/position/cross-isolatearrow-up-right

Function name:

Usage:

Set TP/SL Mode

circle-info

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

https://bybit-exchange.github.io/docs/v5/position/tpsl-modearrow-up-right

Function name:

Usage:

Switch Position Mode

circle-info

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

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

Function name:

Usage:

Set Risk Limit

circle-info

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

https://bybit-exchange.github.io/docs/v5/position/set-risk-limitarrow-up-right

Function name:

Usage:

Set Trading Stop

circle-info

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

https://bybit-exchange.github.io/docs/v5/position/trading-stoparrow-up-right

Function name:

Usage:

Set Auto Add Margin

circle-info

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

https://bybit-exchange.github.io/docs/v5/position/add-marginarrow-up-right

Function name:

Usage:

Get Execution

circle-info

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

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

Function name:

Usage:

Get Closed PnL

circle-info

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

https://bybit-exchange.github.io/docs/v5/position/close-pnlarrow-up-right

Function name:

Usage:

Last updated