Skip to content

Latest commit

 

History

History
93 lines (64 loc) · 2.95 KB

README.md

File metadata and controls

93 lines (64 loc) · 2.95 KB

EasyWire - Optimize Your Global Transactions 💸

Tweet for EasyWire

🔍 Custom Monitoring System

The monitoring system continuously tracks exchange rates and sends notifications when optimal rates are detected. It uses Alpha Vantage API for real-time forex data and implements rate limiting to stay within API constraints. It is hosted on cron-job.org and runs every 60 minutes.

Monitoring Logs

Each monitoring job execution is logged in MongoDB Atlas with the following structure:

{
    "timestamp": "<UTC timestamp when job started>",
    "status": "<completed|error>",
    "message": "<descriptive message>",
    "alerts_processed": "<number of alerts processed>",
    "results": [
        {
            "alert_id": "<alert_id>",
            "status": "<notification_sent|rate_not_optimal|error>",
            "current_rate": "<rate>",
            "error": "<error message if status is error>"
        }
    ],
    "duration_seconds": "<execution time in seconds>"
}

Features

  • Rate Limiting: Implements a sliding window rate limiter for Alpha Vantage API (5 calls per minute)
  • Lock Mechanism: Prevents multiple monitoring processes from running simultaneously.
  • Sentiment Analysis: Analyzes news sentiment to assist rate optimization decisions, with news fetch done using Perplexity.AI
  • Email Notifications: Sends HTML-formatted alerts when optimal rates are detected, through Gmail SMTP
  • Error Handling: Comprehensive error handling and logging for debugging, so the user never encounters an Internal Server Error adapted from MelodySyncer

Optimization Logic

Rate is considered optimal when either:

  1. Current rate is better than 7-day average by more than 1 standard deviation
  2. Rate is moderately good (>0.5 std dev better than average) AND news sentiment is positive

🚀 Quickstart

1. Generate a repo using this template

Use git clone

2. Install dependencies

pip install -r requirements.txt

3. Create .env file

Copy the .env.example file to .env and fill in the values.

# API Configuration
# Required: Contact [email protected] for backend API credentials
API_PASSWORD=your_api_password_here

# Clerk Authentication Configuration
# Required: Sign up at https://clerk.dev to obtain credentials
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key_here 
CLERK_SECRET_KEY=your_clerk_secret_key_here

4. Start the app

python main.py

This will start the app on http://localhost:8000.

🌄 Inspiration