tiagosiebler / bybit-api

Node.js SDK for the Bybit APIs and WebSockets, with TypeScript & browser support.

Home Page:https://www.npmjs.com/package/bybit-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

client.getPositionInfo

iusachev opened this issue · comments

client
    .getPositionInfo({
        category: 'inverse',
        symbol: 'CATUSD',
    })
    .then((response) => {
        console.log('Position')
        console.log(response);
    })
    .catch((error) => {
        console.error(error);
    });

I have an open position in CATUSDT token

I use the method
getPositionInfo

and it comes back to me

retCode: 10001,
retMsg: 'params error: symbol invalid CATUSDT',

If I write CATUSD, same thing

Answered in telegram too, but for others too:
Did you find the answer? My estimated guess is the symbol is wrong. Inverse markets pair with USD not USDT.

If you still can’t get the symbol, you could try querying all symbols for inverse markets and seeing what the symbol looks like in the response. The docs say “you can query all holding positions with /v5/position/list?category=inverse”, so just pass category=inverse without a symbol and it should give you all symbols:
https://bybit-exchange.github.io/docs/v5/position