Skip to content

official-jumpa/jumpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Jumpa - Collaborative Crypto Trading Bot

Jumpa is a Telegram-based collaborative trading bot that enables users to create groups for collective cryptocurrency trading on Solana and EVM blockchains.

Test the bot on Telegram πŸ‘‰ Jumpa Bot

Watch the Demo Video on YouTube πŸ‘‰ Demo Video

Features

  • Multi-Chain Support: Trade on Solana and EVM-compatible chains
  • Collaborative Trading: Create groups and make collective trading decisions
  • Multi-Wallet Management: Support for multiple Solana and EVM wallets
  • Secure Key Storage: Encrypted private key storage
  • Fiat On/Off Ramp: NGN withdrawal support via integrated payment gateway
  • On-Chain State: Anchor smart contract integration for transparent group management
  • Social Trading: Referral system and community-driven decision making

Tech Stack

Backend

  • Runtime: Node.js with TypeScript
  • Bot Framework: Telegraf (Telegram Bot API)
  • Database: MongoDB with Mongoose ODM
  • Blockchain:
    • Solana (web3.js, Anchor, SPL Token)
    • EVM (ethers.js)

Key Libraries

  • @solana/web3.js - Solana blockchain interaction
  • @coral-xyz/anchor - Solana smart contract framework
  • telegraf - Telegram bot development
  • ethers - Ethereum wallet & transactions
  • mongoose - MongoDB object modeling

πŸ“ Project Structure

jumpa/
β”œβ”€β”€ src/                          # Source code
β”‚   β”œβ”€β”€ index.ts                  # Application entry point
β”‚   β”œβ”€β”€ core/                     # Core configuration & infrastructure
β”‚   β”‚   β”œβ”€β”€ config/               # Environment configuration
β”‚   β”‚   └── database/             # Database connection & models
β”‚   β”‚       └── models/           # Mongoose schemas (User, Group, Wallet, etc.)
β”‚   β”œβ”€β”€ blockchain/               # Blockchain integrations
β”‚   β”‚   β”œβ”€β”€ solana/               # Solana & Anchor services
β”‚   β”‚   β”œβ”€β”€ base/                 # Base chain integration
β”‚   β”‚   └── shared/               # Shared blockchain utilities
β”‚   β”‚       β”œβ”€β”€ interfaces/       # Common interfaces
β”‚   β”‚       β”œβ”€β”€ types/            # Type definitions
β”‚   β”‚       └── utils/            # Shared blockchain helpers
β”‚   β”œβ”€β”€ features/                 # Feature modules (Domain-Driven Design)
β”‚   β”‚   β”œβ”€β”€ onboarding/           # User registration & onboarding
β”‚   β”‚   β”‚   β”œβ”€β”€ commands/         # /start command
β”‚   β”‚   β”‚   β”œβ”€β”€ callbacks/        # Callback query handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ handlers/         # Message handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/         # Business logic
β”‚   β”‚   β”‚   └── utils/            # Helper functions
β”‚   β”‚   β”œβ”€β”€ wallets/              # Wallet management
β”‚   β”‚   β”‚   β”œβ”€β”€ commands/         # /wallet, /import commands
β”‚   β”‚   β”‚   β”œβ”€β”€ callbacks/        # Wallet action handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/         # Balance, creation services
β”‚   β”‚   β”‚   └── utils/            # Wallet utilities
β”‚   β”‚   β”œβ”€β”€ groups/               # Group operations
β”‚   β”‚   β”‚   β”œβ”€β”€ commands/         # /create_group, /join, /leave commands
β”‚   β”‚   β”‚   β”œβ”€β”€ callbacks/        # Group action handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/         # Group management logic
β”‚   β”‚   β”‚   └── utils/            # Group helpers
β”‚   β”‚   β”œβ”€β”€ trading/              # Token trading
β”‚   β”‚   β”‚   β”œβ”€β”€ commands/         # /buy, /sell commands
β”‚   β”‚   β”‚   β”œβ”€β”€ callbacks/        # Trade confirmation handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/         # Trading logic & execution
β”‚   β”‚   β”‚   └── utils/            # Trade utilities
β”‚   β”‚   β”œβ”€β”€ payments/             # Fiat on/off ramp
β”‚   β”‚   β”‚   β”œβ”€β”€ commands/         # /withdraw command
β”‚   β”‚   β”‚   β”œβ”€β”€ callbacks/        # Payment flow handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/         # Payment gateway integration
β”‚   β”‚   β”‚   └── utils/            # Payment helpers & conversions
β”‚   β”‚   β”œβ”€β”€ users/                # User management
β”‚   β”‚   β”‚   β”œβ”€β”€ commands/         # User-related commands
β”‚   β”‚   β”‚   β”œβ”€β”€ callbacks/        # User action handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/         # User services
β”‚   β”‚   β”‚   └── utils/            # User utilities
β”‚   β”‚   └── referrals/            # Referral system
β”‚   β”‚       β”œβ”€β”€ commands/         # Referral commands
β”‚   β”‚       β”œβ”€β”€ callbacks/        # Referral handlers
β”‚   β”‚       β”œβ”€β”€ services/         # Referral logic
β”‚   β”‚       └── utils/            # Referral utilities
β”‚   β”œβ”€β”€ telegram/                 # Telegram bot infrastructure
β”‚   β”‚   β”œβ”€β”€ commands/             # Command manager & registration
β”‚   β”‚   └── callbacks/            # Callback query router
β”‚   β”œβ”€β”€ shared/                   # Shared utilities
β”‚   β”‚   β”œβ”€β”€ utils/                # Helper functions (encryption, formatting)
β”‚   β”‚   └── state/                # In-memory state management
β”‚   └── images/                   # Static assets
β”œβ”€β”€ docs/                         # Documentation
β”‚   β”œβ”€β”€ ARCHITECTURE_SUMMARY.md   # Architecture overview
β”‚   β”œβ”€β”€ ON_CHAIN_COMMANDS_GUIDE.md # On-chain integration guide
β”‚   β”œβ”€β”€ TESTING_GUIDE.md          # Testing instructions
β”‚   └── debug/                    # Debug logs & artifacts
β”œβ”€β”€ scripts/                      # Utility scripts

πŸš€ Installation

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • MongoDB database
  • Telegram Bot Token (from @BotFather)
  • Solana RPC endpoint (Mainnet/Devnet)
  • (Optional) EVM RPC endpoint

Setup

  1. Clone the repository

    git clone https://github.com/official-jumpa/jumpa.git
    cd jumpa
  2. Install dependencies

    npm install
  3. Configure environment variables

    Create a .env file in the root directory:

    # Bot Configuration
    BOT_TOKEN=your_telegram_bot_token
    
    # Database
    # DB_URL=mongodb+srv://username:password@cluster.mongodb.net/jumpa
    
    # Solana
    SOL_MAINNET=https://api.mainnet-beta.solana.com
    SOL_DEVNET=https://api.devnet.solana.com
    RPC_URL=https://api.mainnet-beta.solana.com
    
    # EVM (Optional)
    EVM_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/your-key
    
    # Payment Gateway (Yara)
    PAYMENT_WIDGET_URL=
    PAYMENT_RATE_URL=
    YARA_API_KEY=your_yara_api_key
    
    # Security
    ENCRYPTION_KEY=your_256_bit_hex_key
    GEMINI_API_KEY="xxxx"
    PAYSTACK_BEARER_KEY="xxxxx"
  4. Generate encryption key

    node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

    Copy the output to ENCRYPTION_KEY in .env

πŸ’» Development

Run in development mode

npm run dev

Build the project

npm run build

Run in production mode

npm run build
npm start

Architecture

Path Aliases

The project uses TypeScript path aliases for clean imports:

import { config } from "@core/config/config";
import { User } from "@database/models/user";
import { WalletService } from "@modules/wallets/balanceService";
import { encryption } from "@shared/utils/encryption";

Feature Organization

Features are organized by domain (Domain-Driven Design):

  • Each feature contains its commands, callbacks, and utils
  • Clear separation of concerns
  • Easy to test and maintain

State Management

In-memory state management for multi-step user flows:

  • User actions (wallet import, PIN setup)
  • Withdrawal flows
  • Trade confirmations
  • Bank updates

πŸ“š Documentation

Deployment

Deploy to Railway

# Railway will automatically:
# 1. Run npm install
# 2. Run npm run build
# 3. Run npm start

Deploy to Render/Heroku

Set the following:

  • Build Command: npm run build
  • Start Command: npm start
  • Environment Variables: Add all variables from .env

Environment Variables Required

  • BOT_TOKEN - Telegram bot token
  • DB_URL - MongoDB connection string
  • RPC_URL - Solana RPC endpoint
  • ENCRYPTION_KEY - 256-bit encryption key
  • All other variables from .env file

πŸ”’ Security

  • Private Key Encryption: All private keys are encrypted
  • Environment Variables: Sensitive data stored in environment variables
  • Rate Limiting: Built-in rate limiting for bot commands

Testing

npm test

See Testing Guide for detailed testing instructions.

πŸ“‹ Available Commands

User Commands

  • /start - Register and create wallet
  • /wallet - Manage wallets
  • /create_group - Create/manage groups
  • /buy - Buy tokens
  • /sell - Sell tokens
  • /withdraw - Withdraw to NGN
  • /help - Show help message

Group Commands

  • /create_group - Create new group
  • /join - Join existing group
  • /leave_group - Leave group
  • /group - View group details
  • /poll - Create poll for trading decision

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

ISC License

Meet the Team

  • CEO and Co-founder - Anita Ndukwe
  • COO and Co-founder - Udoma Christian
  • CTO and Fullstack Developer - Damian Olebuezie

Issues

Report issues at: https://github.com/official-jumpa/jumpa/issues


About

The official source code for the jumpa trading bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •