auto-investor v1.0
Pre-releaseauto-investor
First beta release of auto-investor
. This version supports complex loan filtering, automatic loan investment, and automatic fund transfers. Be notified via email when loans are purchased or when unexpected errors occur.
python main.py --help
usage: main.py [-h] [-p] [-t]
Autonomous LendingClub account management.
optional arguments:
-h, --help show this help message and exit
-p, --productionMode Enter production mode. Required to invest or transfer
funds.
-t, --testFilters Test loan filters by applying them to all loans
currently listed. Exit once complete.
Requirements
- Python 3
- pyparsing
- requests
Command Line Options
Run python main.py --help
for the most current list of command line options. Currently there are two supported options.
-p
,--productionMode
: This is a required option to do anything interesting.auto-investor
will not transfer money into your account or invest in loans without it.-t
,--testFilters
: This is a special mode that will retrieve the currently listed loans and apply each filter to give you confidence that they are well formed. It is recommended to run this after updating your loan filters. No notes will be purchased.
Configuration
Account configuration and lending criteria are two pieces that you'll need/want to tweak. There are separate config files for each.
Account configuration
There are five fields of interest in the account configuration json file (config.json):
iid
- This is your account number. Find it on the account summary pageauth
- This is an authentication string used to communicate with LendingClub. You will need access to the API. Find this under "API Settings" on the "Settings" page.orderamnt
- This is the integer amount to invest in loans that pass your filters. Must be a multiple of $25.min_balance
- This is your desired minimum account balance. auto-investor will initiate a transfer when your available cash plus the sum of any pending transfers is less than this amount. Keep in mind that money transfers take 4 business days to complete.email
- Email address to send purchase notification to
Filters
This is where auto-investor
shines. It includes a parser which allows you to write arbitrarily complex filters using multiple loan keys and operators. The available loan keys are defined as part of the LendingClub API. You can find these on the developer section of their webpage.
The filter parser supports (in)equalities as well as basic math functions. The return value of a filter must be a boolean!
Available operators: +, -, *, /, %, >, >=, <, <=, ==, !=
Filter Syntax
It's easiest to illustrate the syntax with some examples. We'll start with a basic one and go from there.
Basic Example
{term} == 36
This one is pretty self explanatory, but illustrates how to perform key lookups. {term}
represents the loan term of whatever loan this filter is applied to. It is replaced at runtime with the appropriate value (only 36 and 60 month loans are available on LendingClub). This filter will restrict your investments to 36 month loans. All others will be discarded.
More Complicated Example
{annualInc} * 0.3 > {loanAmount}
This filter looks at the borrowers income to decide if the loan amount is appropriate. Specifically, the loan amount must not exceed 30% of their annual income.
Filter Types
There are two types of filters available for use. The above examples are BasicFilters
. However, it may make more logical sense to define a filter such that loans are discarded when they PASS a filter instead of when they FAIL. These filters are defined as ExclusionFilters
. While ExclusionFilters
do not add any flexibility, they're there for you to use. For example, you may find it more intuitive to toss out all loans originating from CA and NJ as {addrState} == CA
and {addrState} == NJ
instead of using a BasicFilter
and saying {addrState} != CA
and {addrState] != NJ
. Tomato, tomato. Wait...
Filter format
Now that you're ready to come up with all your badass filters, take a look at rules_template.json
for the format.