Closed denravonska closed 8 years ago
I will commit a proposal fix for this later today.
Thanks you for this PR, @denravonska .
Did you mange to test this commit? I see a few places config.offerMinRate[currency] / 100.0
, but the config.offerMinRate[currency]
seems to be a string.
Can you please doublecheck?
@denravonska , can you check if a simple way to implement this feature would be by:
offerMaxAmount
and set it initially to config.offerMaxAmount
offerMaxAmount
instead of config.offerMaxAmount`bestReturnRate
is less than minRate
then set offerMaxAmount
to 0
else set offerMaxAmount
to config.offerMaxAmount
You mean piggy back on the offerMax checks? Right now I have changed it to be an explicit check for the min rate in postOffers:
// Do not offer loans the the best return rate is less than the specified min rate. minRate = new Big(config.offerMinRate[currency]); if (minRate.ne(0) && minRate.div(100).gt(advisorInfo[currency].bestReturnRate)) { return callback(null); }
I think it's wise to keep them separated.
However, I can only cancel but not create loan offers at the moment:
notice: createLoanOffer: Invalid API key/secret pair.
I have double checked and even created a new API key. Strange.
Thanks for the PR.
The feature has been added in version 0.5.0
It would be neat if we could set a minimum lend rate on a per-coin basis. For example, right now XMR lends for 0.015% so it would be more profitable for me to stop offer XMR loans, trade my coins into BTC and offer BTC loans at 0.056%.
I guess you can kill the bot, reconfigure the coin max lend to 0 and then restart it, but it's quite the hassle. Instead, it would be easier if we can set a minimum and handle the exchange and coin transitions manually.