jgillick / LendingClubAutoInvestor

A simple command line tool that will automatically invest all cash that becomes available
MIT License
47 stars 21 forks source link

Can't find portfolios for available cash #9

Closed jgillick closed 10 years ago

jgillick commented 11 years ago

From @ilyakatz "Looks like LC has an interesting bug if you have more cash than what can be invested into available loans (eg. I have $100 but with my filters there are only $75 worth of loans), nothing will show up"

Proposed solution

Let's say that you have setup you program to invest when your account has at least $50, and when the program runs you actually have $125. First it will try to invest the entire $125. If nothing is found, it could search a few more times at decreasing values, as long as they're greater than $50. So, for example: $125 -- nothing, $100 -- nothing, $75 -- LOANS FOUND! If nothing was found at $75, it will try once more at $50.

Technical

The delta between the minimum investment amount and account balance could be large enough to create quite a few portfolio searches. For example, if your account has $1,000 and your minimum is set to $50, the program could perform up to 38 searches (at $25 increments). That would be too many.

Instead, the delta should be taken and divided by 5 and each slice rounded to the nearest $25. That way the program will only ever perform 6 searches, at most.

So for the $1,000 and $50 example, it would make the following investment checks:

(1,000 - 50) / 5 = 190
jgillick commented 10 years ago

Fixed in version 2.1.2