bybit-exchange / pybit

Official Python3 API connector for Bybit's HTTP and WebSockets APIs.
Other
340 stars 113 forks source link

Something is wrong with purchasing lev-tokens #211

Closed loxxxlie closed 5 days ago

loxxxlie commented 1 month ago

Parameters that are required are ltCoin and ltAmount (even though in redeem method they are ltCoin and quantity which is strange). Redeem works, but purchasing doesn't. I checked minimum number of this exact tokens to buy per transaction and my number is above, so it cannot be a problem. When I try to

ans = session.purchase_leveraged_token(
                ltCoin=dict['instrument'],
                ltAmount=str(quantity),
)

I get: image

I also tried to ROUND my float quantity before making it string, but it didn't help. And I checked ltStatus. For APE2L it is "1" which mean that it can be bought and sold. Seems like the params which are expected are not ltCoin and ltAmount and that's why I get invalid parameter sent