简体   繁体   中英

Bybit Api - CannotAffordOrderCost problem - Code 130021

I'm trying to open a long position to OPUSDT coin, but I always get the "CannotAffordOrderCost" error.

Numbers are here;

  1. Mark price of OPUSDT Coin: 1.708$
  2. Wallet Balance in USDT: 108.96975186$
  3. Leverage: 10x
  4. Position size in USDT with leverage: 871.8$
  5. Position amount in OP: 510.4

So the position I'm trying to open a position with 87$. Why API returning this error? I know I have enough money for this position.

    const order: APIResponseWithTime<LinearOrder | null> = await client.placeActiveOrder({
        symbol: `${position.symbol}`,
        reduce_only: false,
        close_on_trigger: false,
        order_type: "Market",
        qty: positionAmount,
        side: "Buy",
        time_in_force: "GoodTillCancel",
    });

Thanks for the answer @DamiToma

The problem is position amount calculation should be based on available balance, not total wallet balance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM