Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

RateTrackr

An AI-powered Telegram bot that aggregates publicly available savings rates and investment returns across Nigerian fintech platforms — and lets you query them in natural language.

Instead of opening six different apps to compare rates, ask one bot: "Which platform has the best flexible savings rate?" and get a clear, data-backed answer.

Platforms Tracked

  • PiggyVest
  • Cowrywise
  • Palmpay
  • Opay
  • Risevest
  • Bamboo
  • More added continuously

How It Works

User asks a question on Telegram
    → n8n fetches latest data from Notion database
        → JavaScript aggregates and cleans the data
            → AI Agent (Gemini via OpenRouter) reads data and answers
                → Reply sent back to Telegram

The data is manually maintained in a Notion database with the following columns:

Column Description
APP Platform name (e.g. PiggyVest)
Plan Type Savings or Investment
Category Specific product (e.g. SafeLock, Flex Naira)
Withdrawal Type Flexible, Semi-locked, Locked, Fixed
Interest per annum Annual interest rate (pre-tax)
YTD Returns Year-to-date returns for investment products
Notes Additional context
Date Last Updated When the data was last verified

Architecture

  • n8n — workflow automation (self-hosted on DigitalOcean VPS via Docker)
  • Notion — data store for rates and returns
  • Telegram Bot API — user-facing interface
  • OpenRouter (Gemini 2.5 Flash) — AI agent for natural language queries
  • Cloudflare Tunnel — HTTPS for Telegram webhooks with custom domain

Setup

Prerequisites

  • A VPS (Ubuntu) with Docker installed
  • A Telegram bot token (via @BotFather)
  • A Notion account with an internal integration
  • An OpenRouter API key
  • A Cloudflare account (for HTTPS tunnel)

1. Clone this repo

git clone https://github.com/YOUR_USERNAME/ratetrackr.git

2. Set up Notion

Create a database with the columns listed above. Share it with your Notion integration. Every row must have the APP field filled — no blank grouping rows.

3. Deploy n8n

mkdir ~/n8n && cd ~/n8n

Create docker-compose.yml:

version: '3.8'
services:
  n8n:
    image: n8nio/n8n
    restart: always
    ports:
      - "5678:5678"
    environment:
      - WEBHOOK_URL=https://your-subdomain.yourdomain.com/
    volumes:
      - ~/.n8n:/home/node/.n8n
docker-compose up -d

If you get an EACCES permission error:

sudo chown -R 1000:1000 ~/.n8n

4. Set up Cloudflare Tunnel

cloudflared tunnel login
cloudflared tunnel create n8n
cloudflared tunnel route dns n8n your-subdomain.yourdomain.com

Create ~/.cloudflared/config.yml:

tunnel: n8n
credentials-file: /etc/cloudflared/<TUNNEL_ID>.json

ingress:
  - hostname: your-subdomain.yourdomain.com
    service: http://localhost:5678
  - service: http_status:404

Install as a service:

sudo mkdir -p /etc/cloudflared
sudo cp ~/.cloudflared/config.yml /etc/cloudflared/
sudo cp ~/.cloudflared/*.json /etc/cloudflared/
sudo cloudflared service install
sudo systemctl start cloudflared

5. Import the workflow

Open n8n, go to Workflows → Import from File → select workflow.json from this repo. Then:

  1. Set up credentials for Telegram, Notion, and OpenRouter
  2. Select your Notion database in the "Get many database pages" node
  3. Activate the workflow

Example Queries

  • "What's the best savings rate right now?"
  • "Compare PiggyVest and Cowrywise"
  • "Which platform has the highest investment returns?"
  • "Show me all flexible savings options"
  • "What are Risevest's rates?"

Key Design Decisions

  • Notion over Google Sheets — Google Cloud service account setup was unnecessarily complex for this use case. Notion's integration system is simpler.
  • Manual data entry — Nigerian fintechs don't offer public APIs for rate data. Scraping violates ToS and risks account suspension. Manual entry is the only clean approach.
  • Code node for aggregation — Without aggregating Notion results into a single item, the bot sends one Telegram message per database row. The Code node merges everything into one payload.
  • HTML parse mode — Telegram's MarkdownV2 is strict about escaping special characters. HTML is more forgiving.

Limitations

  • Data is manually maintained — rates are only as current as the last update
  • The AI model (Gemini 2.5 Flash) occasionally ignores formatting instructions
  • No personal account linking — this is a public rate comparison tool, not a portfolio tracker

License

MIT

About

AI-powered Telegram bot that compares savings rates and investment returns across Nigerian fintech platforms using n8n, Notion, and OpenRouter.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors