Back to cases
Wonex · 跨境支付结算平台
Telegram 小程序跨境支付多端架构金融科技

Wonex · Cross-border Payment Platform

Telegram Mini App cross-border payment, multi-client architecture

Type:Telegram Mini App cross-border payment platform
Timeline:Ongoing

About the Project

Wonex is a cross-border payment and settlement platform built on the Telegram Mini App ecosystem, designed for multi-party business workflows — merchants post requests, users respond, and the platform handles matching and clearing automatically. The system manages order routing, fund state-machine transitions, and reconciliation end to end. It uses bank-grade FIFO (first-in, first-out) bookkeeping to ensure every fund movement is fully traceable with zero accounting errors. The platform covers three independent Mini Apps (user-side, merchant-side, platform admin) plus a unified management console. Users complete the entire flow — placing orders, responding, and managing funds — inside Telegram with no app download required.

Core Features

  • Matching Engine: Merchants post requests → users respond or platform dispatches; two matching modes switchable on demand
  • FIFO Accounting: Bank-grade first-in, first-out bookkeeping with complete audit trail for every fund movement
  • Real-Time Settlement: Funds are automatically cleared and account states updated the moment an order completes
  • User Mini App: Registration, order processing, order history, fund statement, push notifications
  • Merchant Mini App: Merchant onboarding review, service management, order processing, financial settlement
  • Platform Admin Mini App: User management, merchant review, order monitoring, data reports
  • Unified Admin Console: Permission system, data dashboard, fund reconciliation, risk review
  • Telegram Bot: Serves as the entry point for all three sides — push notifications, support access, quick actions

Tech Stack

React TypeScript TG WebApp SDK Python FastAPI PostgreSQL Redis WebSocket

Engineering Highlights

1. Shared State Across Three Independent Mini Apps The user, merchant, and platform Mini Apps are deployed independently but share session state and risk-control rules. A unified identity service issues JWTs, and the backend routes by role — avoiding three separate login systems while keeping data consistent across all three sides.

2. FIFO Ledger Strong Consistency Every fund change goes through a three-phase state machine: pre-reserve → freeze → clear. PostgreSQL transactions combined with Redis distributed locks guarantee no double-counting, missing, or duplicated entries even under concurrent order placement and response.

3. WebSocket Real-Time Push Order status changes, fund movements, and merchant notifications are all pushed via WebSocket. User-side order response latency stays under 200ms; merchant-side financial settlement requires zero polling.

4. Risk Control and Compliance All orders, account changes, and anomalous behavior feed into the risk-control pipeline, with rules configurable from the admin console. High-risk actions are blocked automatically or routed to manual review; critical operations carry full audit logs for compliance purposes.

5. Multi-Side Data Consistency Redis acts as the hot-data cache layer; PostgreSQL is the authoritative ledger. An event bus with optimistic locking keeps all three client views in sync, preventing "side A shows completed while side B shows in-progress" discrepancies.

Deliverables

  • Three independent Mini Apps + unified admin console + bot entry point — a complete end-to-end business loop
  • Full fund statement, risk-control review, and data reporting system meeting cross-border payment compliance requirements
  • In active, ongoing development with continuous feature delivery; the system has supported real business operations from day one

Need something like this?

We can build you a tailored solution drawing on what we learned from this project.

More work