MikaLendingBot icon indicating copy to clipboard operation
MikaLendingBot copied to clipboard

Bot is lending out more than maxtolend

Open utdrmac opened this issue 9 years ago • 28 comments

I have maxtolend = 4 set in default.cfg. maxpercenttolend, maxtolendrate are both commented.

Expected Behavior: For the bot to strictly not lend more than 4 BTC

Actual behavior: screen shot 2017-02-17 at 8 53 41 am

utdrmac avatar Feb 17 '17 14:02 utdrmac

http://poloniexlendingbot.readthedocs.io/en/latest/configuration.html#max-to-be-lent you need to set maxtolendrate in order for maxtolend to be used by the bot. Basically you set a rate that above it you are willing to lend, if you really don't want to lend just set a high rate.

rnevet avatar Feb 17 '17 23:02 rnevet

Why can't maxtolend be used when the other settings are commented out? As if to create a blanket rule that says "no matter what, never lend out more than this much"

utdrmac avatar Feb 18 '17 00:02 utdrmac

It could, right now it doesn't... however, you can achieve this by setting a high maxtolendrate.

rnevet avatar Feb 18 '17 00:02 rnevet

I would like the bot to lend 90% of a given currency by keeping always a 10% reserve for any emergency. Do we have this feature? Is a good idea?

lexrms avatar Feb 18 '17 00:02 lexrms

@lexrms That's what I'm trying to accomplish. @rnevet I guess I'm not understanding the logic behind maxtolendrate

utdrmac avatar Feb 18 '17 04:02 utdrmac

This feature group allows you to only lend a certain percentage of your total holding in a coin, until the lending rate suprasses a certain threshhold. Then it will lend at max capacity.

maxtolend is a raw number of how much you will lend of each coin whose lending rate is below maxtolendrate

rnevet avatar Feb 18 '17 08:02 rnevet

@lexrms try the following: maxtolend = 0 maxpercenttolend = 90 maxtolendrate = 5

This will lend only 90% of the specific coin unless lending rate is over 5% daily (which I think is impossible)

rnevet avatar Feb 18 '17 09:02 rnevet

@utdrmac does that solve your need as well?

rnevet avatar Feb 19 '17 14:02 rnevet

Not really. It is still based on a percentage calculation. I'm looking for a hard stop number. ie: no matter what, never lend more than X coin. When maxtolend = X and the other two options are commented out, I would expect this behavior/logic.

utdrmac avatar Feb 20 '17 04:02 utdrmac

Try this: maxtolend = 4 maxpercenttolend = 0 maxtolendrate = 5

rnevet avatar Feb 20 '17 06:02 rnevet

I've made this change. Testing it.

utdrmac avatar Feb 21 '17 14:02 utdrmac

We can add the logic where: If maxtolend or maxpercenttolend set but maxtolendrate not set, then never disable maxtolend.

Evanito avatar Feb 24 '17 18:02 Evanito

@Evanito we can, I would also look into which of those fields most be uncommented. I think right now "you can't set maxpercenttolend without having maxtolend set to 0. I don't like this dependency between both fields.

rnevet avatar Feb 24 '17 18:02 rnevet

Should it be whichever is higher/lower per cur? That seems like a decent idea.

Evanito avatar Feb 24 '17 18:02 Evanito

Would start with allowing either to be commented out. Then if both are set I would take the higher (also not breaking current config).

rnevet avatar Feb 24 '17 18:02 rnevet

Still looking for a real fix on this:

Lent 4.0196 of 4.0000 (100.49%) Lendable

Have the following set:

maxtolend = 4
maxpercenttolend = 0
maxtolendrate = 5

maxtolend=X should always take highest precedence. I don't want more than 4 coin to ever be lent out.

utdrmac avatar Mar 23 '17 21:03 utdrmac

How did you achieve that? Are there loans at 5%?

rnevet avatar Mar 23 '17 22:03 rnevet

Looks like the bot did create 2 lends for 30 days at 0.499%

utdrmac avatar Mar 23 '17 23:03 utdrmac

@rnevet I've got TONS of these lines now in my bot:

2017-03-27 19:01:45 The Lower Rate found on BTC is 0.1262% vs conditional rate 5.0000%. Lending 0.00000000 of 0.05786153 Available

What does this mean? Seems that all 4 of my 4.0132BTC are lent out. Why is the bot continuing to look for more trades?

utdrmac avatar Mar 28 '17 00:03 utdrmac

That's exactly what it should do. The logs are saying it isn't making offers because the rate is lower than 5% and that you should have 0.05786153 available not lent. It's basically checking if the rate is over 5%, as it isn't the bot isn't placing offers over 4.

rnevet avatar Mar 28 '17 00:03 rnevet

I'm not sure if I should close this out. It's been working with the config values specified in my previous comment but it still seems an awkward way to put a hard limit on how many BTC to lend out.

utdrmac avatar May 02 '17 00:05 utdrmac

Leave it open please, we can simplify the settings.

rnevet avatar May 02 '17 06:05 rnevet

This issue has come up again after I added some more BTC to my polo account. I recently added 3 BTC to bring my total to 7 in my trading account. So, I adjusted my config to match:

maxtolend = 7
maxpercenttolend = 0
maxtolendrate = 5

But: Lent 7.0480 of 7.0480 (100.00%) is what is visible on bot page.

I don't want it to lend out more than 7. This is how I'm tracking my overall profit; any amount over 7 I consider to be profit. Also, if I wanted to protect my account and set this to 6, I would expect the behavior to be 'under no circumstances lend out more than 6 BTC'

utdrmac avatar May 19 '17 03:05 utdrmac

I'm also limiting my lent amount and not seeing an issue. Are you also using a custom config? could you share your config (without API keys)?

rnevet avatar May 19 '17 09:05 rnevet

@rnevet My config: http://termbin.com/v0u7

utdrmac avatar May 19 '17 15:05 utdrmac

So I'm lending multiple coins, so I'm using the custom config in the end of the file like so: [BTC] minloansize = 0.01 mindailyrate = 0.01 maxactiveamount = 1 maxtolend = 7 maxpercenttolend = 0 maxtolendrate = 5

could you try that as well?

rnevet avatar May 19 '17 15:05 rnevet

That's essentially the same config I have. I only had to change mindailyrate from 0.009 to 0.01 to match your config. I'm only lending 1 coin, BTC.

So it looks like it just took it a few days to stabilize. Says this now:

Lent 7.0000 of 7.0739 (98.96%) Total
Lent 7.0000 of 7.0000 (100.00%) Lendable

And lots of these:

2017-05-21 12:58:32 The Lower Rate found on BTC is 0.1749% vs conditional rate 5.0000%. Lending 0.00000000 of 0.07386617 Available

utdrmac avatar May 21 '17 18:05 utdrmac

@utdrmac Thanks! So now it is lending only 7 BTC, good.
Regarding the "lots of these", yeah that's how this feature is working at the moment.

Seems like a bug when using the general config

rnevet avatar May 21 '17 18:05 rnevet