BettaPay is a premium, non-custodial merchant payment and settlement platform built on Stellar and Soroban, specifically optimized for African enterprises (Nigeria-first). It enables local merchants to accept digital dollar (USDC) payments via dynamic QR codes and checkout links, automatically perform real-time FX conversions, settle directly into local fiat currencies via Stellar Anchors (e.g., NGN, KES), and pay utility bills on-chain.
Live Deployment: https://betta-pay-frontend.vercel.app/
The following ASCII diagram illustrates the core components of the BettaPay system and how they interact:
+-----------------------------+
| Next.js Frontend |
| (Merchant Dashboard) |
+--------------+--------------+
|
(1) API | (2) Wallet
Requests | Transaction
v
+------------------------------------------------+--------------+
| BettaPay Backend |
| |
| +-------------------+ +--------------------+ |
| | API Gateway +------------->| Settlement Engine | |
| | (Port 3000) | | (Port 3001) | |
| +---------+---------+ +---------+----------+ |
| | | |
| v v |
| +---------+---------+ +---------+----------+ |
| | FX Engine | | Indexer | |
| | (Port 3002) | | (Port 3003) | |
| +-------------------+ +---------+----------+ |
| | |
+------------------------------------------------+--------------+
| |
(3) DB | | (4) Poll
Queries | | Stellar
v | Events
+-------------+-------------+ |
| PostgreSQL | |
| (Prisma ORM Layer) | v
+---------------------------+ +------------+--------------+
| Stellar RPC / Horizon |
+------------+--------------+
|
v
+------------------------------------------------+--------------+
| Stellar / Soroban Network |
| |
| +-------------------------------------------------------+ |
| | Settlement Contract | |
| | - Fee Splits - Payment Reference Mappings| |
| +--------------------------+----------------------------+ |
| | |
| +--------------------------v----------------------------+ |
| | Governance Contract | |
| | - Platform Fees - Anchor Registry | |
| +-------------------------------------------------------+ |
| |
| +-------------------------------------------------------+ |
| | Stellar Anchors | |
| | - Fiat Off-Ramp API (e.g., USDC -> NGN/KES) | |
| +-------------------------------------------------------+ |
+---------------------------------------------------------------+
For an in-depth breakdown of the technical components, system sequence, and security considerations, see Architecture.md.
BETTAPAY_ORG/
├── BettaPay-Contract/ # Rust/Soroban smart contracts
├── BettaPay-Backend/ # Node.js backend services
└── BettaPay-Frontend/ # Next.js merchant dashboard
| Contract | Address |
|---|---|
| Settlement | CC74K4KWT4ZSTDBGEYM2LT2N4H6R2HV7VA5HEWUQVPMHVDPL44EQSCNM |
| Governance | CATDQJ4O24SOWJHJFHA4GZCVBFSAAELJ62FXI7XSAMNQ753BOWHIM3LJ |
| Admin | GCCHHKNI7GRA5QWC7RCTT3OHO7SKAUMKQA6IBWEQEO2SXI3GF376UHDD |
Network: Test SDF Network ; September 2015
cd BettaPay-Contract
cargo test # Run all 14 unit tests
cargo build --target wasm32-unknown-unknown --release
bash scripts/deploy_testnet.sh # Deploy to Stellar testnetcd BettaPay-Backend
cp .env.example .env && pnpm install
pnpm dev # Starts all 4 servicescd BettaPay-Frontend
cp .env.example .env.local && npm install
npm run dev # → http://localhost:3000BettaPay-Frontend (Next.js 15)
│
│ HTTP
▼
BettaPay-Backend/services/api-gateway :3000
│
├── settlement-engine :3001 (fee splits, cashouts)
├── fx-engine :3002 (exchange rates, quotes)
└── indexer :3003 (Soroban event scanner)
│
│ Stellar RPC / Soroban
▼
BettaPay-Contract (Stellar Testnet)
├── settlement_contract
└── governance_contract
| Service | Port |
|---|---|
| api-gateway | 3000 |
| settlement-engine | 3001 |
| fx-engine | 3002 |
| indexer | 3003 |
| frontend (dev) | 3000 (Next.js) |
Run backend on a separate port if developing frontend simultaneously.
| Layer | Technology |
|---|---|
| Contracts | Rust, Soroban SDK 21.7.7, Stellar CLI |
| Backend | Node.js 20, TypeScript, Zod, pnpm |
| Frontend | Next.js 15, React 19, Tailwind CSS 3 |
| Chain | Stellar (Soroban), Testnet / Mainnet |