Streamlining Prosper Investments with the Prosper Auto-Investor

Ariel Filotti
3 min readSep 7, 2023

--

Introduction

For individuals who are diving into the world of peer-to-peer lending, Prosper stands out as a reputable platform. But as with many investment avenues, the real success often hinges on streamlining and automation. That’s where the Prosper Auto-Investor steps in. It automates the entire investment process based on criteria you set, ensuring you remain at the forefront of potential opportunities.

What Makes Prosper Auto-Investor Special?

The application performs the following actions:

  1. Retrieves your account balance.
  2. Scans listings that align with your criteria.
  3. Places bids without your direct intervention.

With such automation, you’re poised to maximize your investment reach and efficiency on Prosper.

How Does It Work?

This application seamlessly blends a variety of Google Cloud Platform (GCP) components:

  • Google Secrets Manager: This ensures that sensitive information like your Prosper API credentials remains secure. You benefit from its features like secure storage, versioning, and controlled access.
  • Cloud Functions: At the heart of the auto-investor lies the Cloud Function, a serverless solution ensuring you focus solely on the code and not infrastructure management. It’s event-driven, designed to react to a specific trigger — a message on a Pub/Sub topic sent by Cloud Scheduler.
  • Cloud Scheduler: It’s the catalyst, setting into motion the Cloud Function at intervals you define. Whether you want the investment process to kick in daily or at specific hours, Cloud Scheduler is your reliable chronometer.
  • Pub/Sub: Acting as the bridge, Google Cloud Pub/Sub ensures real-time communication between Cloud Scheduler and Cloud Functions, ensuring that the application runs smoothly and efficiently.

Getting started

To ensure the successful setup of the Prosper Auto-Investor, follow the steps below. It’s highly recommended to run these commands from Cloud Shell to guarantee the use of the correct project and account.

1. Get the Code

Clone the repository:

git clone https://github.com/filotti/prosper.git
cd prosper

2. Enable GCP Services

Activate the necessary APIs:

gcloud services enable \
secretmanager.googleapis.com \
cloudfunctions.googleapis.com \
cloudscheduler.googleapis.com \
pubsub.googleapis.com \
cloudbuild.googleapis.com

3. Configure Secrets Manager

Register your application with Prosper to get your credentials. Navigate to Settings -> API on Prosper's platform to generate the Client ID and Client Secret. Then, store the following secrets in Google Cloud’s Secrets Manager:

  • PROSPER_USER: Your Prosper username.
  • PROSPER_PASSWORD: Your Prosper password.
  • PROSPER_CLIENT_ID: Prosper Client ID.
  • PROSPER_CLIENT_SECRET: Prosper Client Secret.

4. Set Up Pub/Sub

Create a Pub/Sub topic to facilitate communication between Cloud Scheduler and Cloud Function:

gcloud pubsub topics create prosper

5. Configure Cloud Scheduler

Establish a Cloud Scheduler job to trigger the function. The following command schedules it to run every hour:

gcloud scheduler jobs create pubsub prosper \
--schedule="0 * * * *" \
--topic prosper \
--message-body="{}" \
--location=us-central1

Tip: Adjust the --schedule value using standard cron syntax if you wish to change the frequency.

6. Set up environment variables

The Cloud Function requires the following environment variables to be set:

- GCP_PROJECT: Your GCP project ID.
- INVESTMENT_AMOUNT: The amount you wish to invest per listing.
- INVESTMENT_CRITERIA: A JSON string containing the criteria for listings you want to invest in. Example:

{
"prosper_rating": ["C", "D", "E"],
"listing_term": ["24", "36"],
"g041s_accounts_30_or_more_days_past_due_ever": "0",
"biddable": "true",
"invested": "false",
"sort_by": "percent_funded desc",
"amount_remaining_min": "25"
}

Tip: Modify the values as needed based on your preferences.

7. Deploy the Cloud Function

Execute the command below to deploy the function:

gcloud functions deploy prosper \
--runtime python311 \
--trigger-topic prosper \
--region us-central1 \
--set-env-vars GCP_PROJECT=$GCP_PROJECT,INVESTMENT_AMOUNT=$INVESTMENT_AMOUNT,INVESTMENT_CRITERIA=$INVESTMENT_CRITERIA \
--source=. \
--docker-registry artifact-registry

8. Testing

  • Manual Test: Initiate a manual test from the GCP Console on the Cloud Scheduler page. Click the three dots beside the job and choose “Force Run”.

9. Monitoring

  • Monitor activity in the GCP Console on the Cloud Functions page. Select the function’s name, then the “Logs” tab to view investments.

Conclusion

Optimizing your investments on Prosper is no longer a time-consuming task. With the Prosper Auto-Investor, you’re equipped to make the most of every suitable opportunity. As a reminder, this tool is independently developed and is not officially affiliated with Prosper, though it leverages their API for functionality.

Ready to redefine your investment strategy on Prosper? Check out the Prosper Auto-Investor on GitHub and embark on a transformative investment journey!

--

--