aluna-crypto / alunajs

Standardizing Crypto Trading APIs across multiple exchanges.
MIT License
0 stars 0 forks source link

Bitfinex - Position `openPrice` it's not always present on parsed positions #79

Closed Torres-ssf closed 2 years ago

Torres-ssf commented 2 years ago

Right the Bitfinex position parse method uses the field trade_amount that is inside the meta prop. Turns out that this prop is not always present in the API response.

  interface IBitfinexPositionMeta {
    reason: 'TRADE' | 'FUNDING_ACCR' 
    order_id: number
    liq_stage: null | number
    order_cid: null | number
    order_gid: null | number
    trade_price?: string
    trade_amount?: string
    order_id_oppo: number
  }