gateio / gateapi-nodejs

TypeScript client SDK for Gate APIv4 used in NodeJS(can be compiled to javascript)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Future open order list (Size does not give decimal value)

TanjinAlam opened this issue · comments

This is the response i am getting by calling listFuturesOrders
where i place this order with size of 0.1 BTC
But i am getting Integer value
Note i am using future testnet

FuturesOrder {
  id: 730839938,
  user: 11867749,
  createTime: 1657354368.131,
  finishTime: undefined,
  finishAs: undefined,
  status: 'open',
  contract: 'BTC_USDT',
  size: 1000,
  iceberg: 0,
  price: '21486.5',
  close: undefined,
  isClose: false,
  reduceOnly: undefined,
  isReduceOnly: false,
  isLiq: false,
  tif: 'gtc',
  left: 1000,
  fillPrice: '21486.5',
  text: 'web',
  tkfr: '0.0005',
  mkfr: '0.00015',
  refu: 0,
  autoSize: undefined
}

0.1 is amount, not size. Amount will be changed to size upon api request

@revilwang
size or amount but you can see the response it's not giving me 0.1 its giving me 1000
I dont know about the mainnet but in the testnet i am not getting proper amount for an open order.

API requests uses contract size instead of amount. Your 0.1 amount on the web page will be updated to 1000 size before the API is sent to the server(which you can inspect the request detail from the web console).

You can retrieve contract's detail using GetFuturesContract and in the response there is a quantoMultiplier field which tells the amount 1 size represents.

Thanks i have got it. I was confused with listFuturesContracts and listFuturesOrders which are different.