How to get fee percent for trades from api?
MaxPovver opened this issue · comments
Issue type
- question
Description
Right now there is no easy way to find out if trade was made on margin wallet or on exchange wallet.
However, I can clearly see that in https://report.bitfinex.com/trades/ there is a "Fee percent" field that is returned ONLY for margin trades, so it could be used as a margin trades flag.
But it does not help because v2 api trades endpoint https://api.bitfinex.com/v2/auth/r/trades/*Symbol*/hist does not return this field in its response. Is there any way to get this fee field? And if not, is there any good way to find out if trade was margin or not?
@MaxPovver I think a member of our customer support team may have solved this query for you. But just for the sake of other people stumbling across this, you can get this info using the v1 account summary endpoint:
https://docs.bitfinex.com/v1/reference#rest-auth-summary
process.env.DEBUG = 'bfx:examples:*'
const debug = require('debug')('bfx:examples:account_summary')
const bfx = require('../bfx')
const rest = bfx.rest(2)
debug('Account summary...')
rest.accountSummary()
.then(console.log)
.catch(debug)