Closed jthomaskerr closed 6 years ago
yea im sorry the api integrations are outside of this github project, but thanks for the suggestion, i will consider soOn''
can i pay you a small bounty to get it done very soon?
It seems like a very small amount of work.
only if you are happy with the final result; im currently updating json to v3 and later i look for thiz if so you can grab then my addr from the commit msg easy
if you have any issue please open a new one; v1 of bitfinex margin is done :dancer:
Fantastic, thanks so much! How does one activate it? It doesnt look like its in the ui and I also dont see any changes in the config options. I tried "BITFINEX MARGIN" but that doesn't work.
reinstall and make use of the new config value (see https://github.com/ctubio/Krypto-trading-bot/blob/master/etc/K.sh.dist#L50)
Unfortunately this isn't quite right. In margin mode we are not trading with the funds in our wallet. Consequently the way that this is implemented is not quite right.
It actually requires a couple of separate calls.
https://docs.bitfinex.com/v1/reference#rest-auth-active-positions gives you the balance of the currency you are trading, and
https://docs.bitfinex.com/v1/reference#rest-auth-margin-information gives the balance of the base currency (in margin_limits
).
Note also that balances may be negative (if you are shorting).
we dont use REST v1 for wallet data
WS v2 is what we use (see https://docs.bitfinex.com/v2/reference#ws-auth-wallets)
do you mean we miss this https://docs.bitfinex.com/v2/reference#ws-auth-margin ? or can you point to the reference in the ws v2 docs? thanks for your time''
also we are not reading exchange funds when using margin, we ask for WALLET_TYPE = margin
Sorry for the delay. Yes, good point re websocket rather than rest.
also we are not reading exchange funds when using margin, we ask for WALLET_TYPE = margin
The margin wallet works slightly differently to the exchange wallet. You do not trade with the funds in your margin wallet, these are used as collateral to access borrowed funds, which are what you trade with.
This means that "balance" is effectively split into two separate figures:
To retrieve these:
I can add the UI and adapter code for this if you like.
thanks for the info''
I'd really like to use this bot with my margin wallet on Bitfinex.
As far as I can see this is purely a matter of adding a flag to select the margin wallet, and using this flag to change a couple of parameters in the orders REST and WS api calls.
I'd be very happy to implement this improvement, but having looked through the code in this repo, it appears that these parameters are set in the precompiled binary that is not open source.
Is there a process for making improvements to these? Is this outside the scope of this project?