/october-eu-bot

💰🤖 Semi-automated lending bot for the October.eu platform

Primary LanguageJavaScriptMIT LicenseMIT

💰🤖 October-eu-bot

Semi-automated lending bot for the October.eu platform

What is October.eu?

October.eu is a european crowdlending platform. It allows anybody living in the EU to lend money directly to Small and Medium Enterprises (SME) across europe, with interest rates up to 9.9% and no fees.

Want to register on October.eu? Use my referral link to receive 20€ once you credit your account with 500€!

What is the purpose of the bot?

As any investor can tell you: "it is better to invest a small amount in many places than a big amount in a single one."

The same advice applies to October.eu: Lend a small amount of money into as many project as possible!

However, you may not have the time to follow all the new projects coming into the platform, as well as forgetting when a new project is available.

october-eu-bot is built to look for new projects every hour. If a project is available, it will trigger the lending action automatically.

Of course, you may want to define a strategy to choose which projects are valuable to you. With the october-eu-bot, you can define the strategy that best suits you.

Why "semi-automated"?

October.eu does not have a public API: october-eu-bot only replicates what a user would do on the platform.

For security reasons, October.eu implemented a 2-factor authentication that sends an SMS with a code before you are authorized to lend money to a project.

Because of this security, you will need to manually input the code to the bot as soon as you receive it: Either through the CLI, or with a simple web page (See example: https://october-eu-bot.web.app).

In the end, you will have only one simple task: When you receive a code by SMS, submit it to the bot.


Documentation:


Usage

You can use october-eu-bot either:

  • By manually running it with the CLI every hour
  • By hosting it on firebase

With the CLI

Create an .env file based on .env.example. Complete it with your October credentials and the strategy. Then run:

npm run cli

How it works

  1. When running the CLI, it will check for available projects on October
  2. If available projects are found, it will use a user-defined strategy to compute if it should lend to the projects, and how much
  3. If the strategy wants to lend to projects, it will secure the user session (2FA from October sending a code by SMS) and wait
  4. The user will enter the code they received in the console prompt
  5. The CLI will then make the lending requests to October

Hosted on Firebase

1. Create a firebase project

  • Go to https://firebase.google.com
  • Click on "Get Started"
  • Click on "Add project"
  • Choose a project name (You will use it for the next steps)
  • Click on "Continue"
  • Disable Google Analytics
  • Click on "Create project"

When your arrive in your project dashboard, go to "Database" and select the "Realtime database"

2. Configure IFTTT actions

  • Create action "Check October.eu every hour"

  • Create action "Send email with summary of strategy"

    • Got to https://ifttt.com/create
    • For "This", choose "Webhooks"
    • Choose "Receive a web request"
    • Write "october_eu_bot_summary"
    • Click on "Create trigger"
    • For "That", choose "Email"
    • Choose "Send me an email"
    • Fill with the following:
      • Subject: October.eu bot
      • Body: {{Value1}}<br/>{{Value2}}<br/>{{Value3}}
    • Click on "Create action"
    • Disable "Receive notification"
    • Click on "Finish"
  • Retrieve API key

3. Create env file

Create an .env file based on .env.example and complete it.

4. Deploy to firebase

firebase use --add [your-project-name]
npm run deploy

5. Wait for a project to be available

Now, wait for a new project to be available on october. If the project is available and is chosen by the strategy, you should receive an SMS with a code: Go to https://[your-project-id].web.app and fill your password and the code. After a few seconds, you should receive an email with the summary of the strategy actions!

Note: There is a 9min timeout on the firebase function to retrieve the code. Be quick!

How it works

  1. Every hours, an IFTTT action calls a firebase function
  2. This firebase function checks for available projects on October
  3. If available projects are found, it will use a user-defined strategy to compute if it should lend to the projects, and how much
  4. If the strategy wants to lend to projects, it will secure the user session (2FA from October sending a code by SMS) and wait
  5. The user will have to go to a webpage to enter the code they received
  6. Once the code is available to the firebase function, it will make the lending requests to October
  7. Every time a lending request is done, it will send a query to IFTTT so that an email is sent to the user to notify if it was successful or not

Note: Since the firebase functions are making external requests, you need to have the Blaze (pay as you go) pricing plan. However, the functions are entirely within the free quotas and you should not expect to pay anything.


Strategies

Threshold

This strategy will lend amount€ to any available projects that have a rate >= rate%.

Syntax:

THRESHOLD(rate,amount)

# Example
THRESHOLD(7,50) # Lend 50€ to all projects with rate >= 7%

Risk Levels

This strategy will lend amount€ to a project if the risk level is in the riskLevels array

Syntax:

RISKLEVELS(riskLevels,amount)

# Example
RISKLEVELS([A,B+,B],50) # Lend 50€ to all projects with risk level A, B+, or B

More strategies...

Have another strategy that you want to implement in october-eu-bot?

Great! Please create an issue so we can talk about it 🙂


Author

👤 Thibaud Courtoison

Contributions

Contributions, issues, and feature requests are welcome! 🙌

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

License

Copyright © 2020 Thibaud Courtoison.

This project is MIT licensed.