Kodrana

Case study

Mini-game bot with economy and withdrawals

A Telegram bot with mini-games, internal balance, referral system, anti-fraud measures and withdrawal functionality. Built with Python, aiogram and Telegram Mini Apps.

1,300+community members

Task

The project needed a Telegram bot that could host mini-games with a functioning internal economy where users earn and spend in-game balance. The system had to support real withdrawals, which meant anti-fraud protection was necessary from the start.

The challenge was building a reliable economy inside Telegram that could handle referrals, track balances accurately, prevent abuse, and process withdrawals without errors or exploitation.

Solution

We built a Telegram bot using Python and aiogram as the core framework. The mini-games run inside a Telegram Mini App, giving users a native in-app interface without leaving the messenger.

The internal economy is backed by PostgreSQL for persistent storage of balances, transactions and user data, with Redis handling session state and caching for fast reads. The referral programme tracks invites and rewards, while anti-fraud logic monitors patterns and flags suspicious activity before payouts.

Users can withdraw their in-game balance through the bot. The withdrawal flow includes validation, fraud checks and processing logic that connects to the payout mechanism. A community chat was set up alongside the bot to support users and build engagement.

  • Telegram bot built with Python and aiogram
  • Mini-games delivered through Telegram Mini Apps
  • Internal economy with balance tracking and referral rewards
  • Anti-fraud protection for withdrawals and transactions
  • PostgreSQL for data storage, Redis for caching and sessions
  • Withdrawal system for converting in-game balance to real funds

Result

  • The bot supports mini-games with a working internal economy
  • Users can withdraw funds from their in-game balance
  • Anti-fraud protection is active across transactions and withdrawals
  • A community chat with 1,300+ members was established

Need something similar? Tell us about your task

Describe the website, the data or the task. We will reply with questions, a solution and a quote.

or write directly

Message @kodrana on Telegram
We use your contact only to reply to this request.
Telegram