XEMO TRADING AI BOT - Automated funnel and trading AI signals
Development of an automated B2C funnel and AI signals. The project demonstrates complex integration of a Telegram bot with the broker's API through secure webhooks (postbacks) and management of phased onboarding.
Architecture and Stack:
Backend: Python 3.12, Aiogram 3.25. (Telegram API), FastAPI (API & Webhooks).
Database: PostgreSQL (Async) + SQLAlchemy (Async ORM).
State & Locales: MemoryStorage (FSM), aiogram_i18n (Fluent .ftl files).
Deploy: Ubuntu (Linux), systemd.
Key Modules:
Postback Receiver: Secure FastAPI endpoint for instant asynchronous processing of statuses from the broker (registration, deposit) and updating user rights.
Smart User Flow: Automatic generation of affiliate deep-links (with tracking sub_id1 via TG ID) and "Smart Guardian" module for checking mandatory subscriptions.
Dynamic Media Manager: "Hot" replacement system for visual content and texts depending on the selected localization (RU/EN). By default, a forced English start is implemented for global reach.
Clean Chat UX: Automatic deletion of previous messages/instructions when transitioning to a new stage in the funnel (by saving message IDs in FSM).
Implementation Features:
The architecture is built on the principle of separating logic (separate Telegram client, separate REST API receiver). A strict level of security is implemented: access to the API is protected by a custom Security Key to prevent financial transaction forgery (fake deposits). A custom Maintenance Middleware is written for maintenance mode - seamless bot updates without system errors for the end user. Database scalability is ensured by using a pool of asynchronous sessions.
Architecture and Stack:
Backend: Python 3.12, Aiogram 3.25. (Telegram API), FastAPI (API & Webhooks).
Database: PostgreSQL (Async) + SQLAlchemy (Async ORM).
State & Locales: MemoryStorage (FSM), aiogram_i18n (Fluent .ftl files).
Deploy: Ubuntu (Linux), systemd.
Key Modules:
Postback Receiver: Secure FastAPI endpoint for instant asynchronous processing of statuses from the broker (registration, deposit) and updating user rights.
Smart User Flow: Automatic generation of affiliate deep-links (with tracking sub_id1 via TG ID) and "Smart Guardian" module for checking mandatory subscriptions.
Dynamic Media Manager: "Hot" replacement system for visual content and texts depending on the selected localization (RU/EN). By default, a forced English start is implemented for global reach.
Clean Chat UX: Automatic deletion of previous messages/instructions when transitioning to a new stage in the funnel (by saving message IDs in FSM).
Implementation Features:
The architecture is built on the principle of separating logic (separate Telegram client, separate REST API receiver). A strict level of security is implemented: access to the API is protected by a custom Security Key to prevent financial transaction forgery (fake deposits). A custom Maintenance Middleware is written for maintenance mode - seamless bot updates without system errors for the end user. Database scalability is ensured by using a pool of asynchronous sessions.