crypto-scanner-bot
A self-hosted Telegram bot (🤖 Crypto Scanner) that watches decentralised exchanges on Base for new tokens, audits them, and can buy and sell them from your own wallet. It runs on its own, or inside another python-telegram-bot application.
Use at your own risk. This is not financial advice. Trading new tokens is extremely risky: most fail, many are scams, and you can lose everything you put in. The software comes with no warranty (see LICENSE). Only use a separate wallet holding money you can afford to lose. You're responsible for your own trades, and for any tax or legal rules where you live.
Not affiliated with Uniswap, Aerodrome, GoPlus, honeypot.is, GeckoTerminal, DEX Screener or any RPC provider.
Status: early work in progress. Formerly published as pair-scanner-bot.
What it does
- Finds new tokens. It watches the Uniswap V2, Uniswap V3 and Aerodrome factories on Base for new pools paired with WETH.
- Audits them. It checks liquidity, the liquidity-to-market-cap ratio, locked LP, whether one wallet holds too much of the supply, taxes, contract security (GoPlus), honeypot risk (honeypot.is), and whether a sale actually goes through (simulated against the chain). Owner controls such as minting or an upgradeable contract reject a new pair, but not an established pool found by the Trending monitor, since most large tokens have them.
- Skips spam names. A new token is rejected straight away if its ticker hides invisible characters (used to copy a real ticker), or if another token with the same ticker was found in the 24 hours before it. Scam launchers often relaunch the same names every hour or two.
- Watches Uniswap v4 too, without buying. New v4 pools paired with ETH or WETH are checked and reported as "would buy", whatever mode the 🆕 New monitor is in. Only pools with no hook or a known launchpad hook (Clanker, Doppler) are looked at; any other hook is rejected, since a hook can block sales. Liquidity is checked by asking Uniswap's v4 Quoter what selling for
min_liquidity_ethwould take, and the token goes through GoPlus, the tax limit and the big-holder limit. Launchpad tokens are allowed owner controls, which their launchpad builds in. honeypot.is doesn't cover v4 yet, so instead the Quoter is asked to buybuy_amount_ethworth and sell it straight back: if the sale fails the token is a honeypot, and if more than a fifth is lost on the way it's rejected for high tax. Each pick then becomes a pretend position, priced from Uniswap's StateView, so the sell rules run on it and its result shows in "Would have made". - Buys what passes, when the monitor is on 💰 Live, up to your limits.
- Judges every position by what a sale would really return. Each minute it asks the exchange what selling would bring back and compares that with what the buy actually cost, so a thin pool's price can't fake a gain. If no quote comes back it falls back to the pool price.
- Sells half once a position is up by
half_sell_percent(30% by default; 0 turns it off). The rest then sells at break-even instead of the stop-loss, so a rug after that costs far less. - Sells on take-profit, stop-loss, trailing stop (it starts once a position is up by
trailing_start_percent, 20% by default, so gains are protected before take-profit), rug (liquidity drop), dead token, or a honeypot appearing later. - 📈 Trending monitor (optional): buys established pools with strong one-hour momentum. It skips pools younger than
trending_min_pool_age_hours(24 by default) and checks the pool's real liquidity on-chain before buying. - Alerts for every buy, sell, would-buy and health problem. Sells come in two groups, 💰 Sell and 🚨 Lost. Buys, profit sells and loss sells each have their own switch in ⚙️ Settings → Monitors & Alerts. Would-buys, failed buys and health alerts are always sent.
- Screens: the scanner dashboard (
/startopens it), pairs, positions, wallet balances (on Base and Ethereum), health, settings and CSV exports of every pair and position for your own records. - A website too (optional): the same stats with charts of your running P&L, each sale's return and what Watch picks would have made, plus tables of positions, Watch picks and tokens, why tokens were rejected, health and balances. You log in with Telegram, and only the owner gets in. It only shows things for now: trading and settings stay in the bot. See The website.
Safety
- A mode for each monitor, set in ⚙️ Settings → Monitors & Alerts. The 🆕 New Monitor and the 📈 Trending Monitor each pick one of three: ⏸️ Off: it doesn't run. 👀 Watch: it finds and checks tokens and notes what it would buy, but never buys. Each pick is then followed as a pretend position with the same sell rules, so you get a Would have made figure on the dashboard and every pick on the website, and can see whether Live would have paid before spending anything. These stay out of Telegram unless you switch on 👀 Watch Alerts, which sends a message for each would buy and would have sold. 💰 Live: it buys. So one can buy while the other only watches. A new install starts with New on Watch and Trending Off. Switching to Live asks you to confirm, and needs
PRIVATE_KEY. - Owner only. The bot answers only
OWNER_ID. - Your key stays yours. It's read from your environment, used to sign your own transactions, and never printed, stored or sent anywhere else.
- Cautious defaults: 0.001 ETH per buy, at most 3 positions, 5% slippage, and Trending off.
- Balance floor. If the wallet falls below the minimum balance (0.01 ETH by default) while a monitor is on Live, the health check switches it to Watch and alerts you. In Watch the balance only shows on the Health screen, because nothing is bought.
- Its own health check. Every
health_check_intervalminutes, while either monitor is on Watch or Live, it checks the RPCs, the wallet balance, the database (size, read-only, offline) and the pairs feed. It tells you once when something breaks, once more when it's fixed, and reminds you once if it's still broken after 12 hours. When the database nearsdb_cleanup_mbit clears the archive first. 🩺 Health on the dashboard shows the same check whenever you want. - Open positions are looked after. While either monitor is on Watch or Live, the sell monitor keeps working on your stop-loss, take-profit and the other sell rules for every open position, whichever monitor bought it. Changing a mode with open positions reminds you what happens to them; only both monitors Off stops selling.
What it connects to
There's no telemetry: nothing is sent to the authors. The bot itself talks to:
- Telegram, for your messages and alerts.
- Your RPC nodes (Alchemy or Ankr if you give it keys, otherwise public nodes), to read the chain, check your balance and send your own transactions.
- GeckoTerminal, for pool prices and momentum, and GoPlus and honeypot.is, for token safety checks. These are sent token and pool addresses, never your wallet or key.
- Your MySQL database, where everything it remembers is kept.
Run it on its own
You need Python 3.12+, a MySQL database and a bot token from @BotFather.
pip install crypto-scanner-bot
python -m crypto_scanner
Run it from a folder with a .env file holding the settings below. .env.example is a starting point. To find your Telegram user ID for OWNER_ID, message @userinfobot. Then send /start to your bot to open the dashboard.
To look around before anything runs, set MODE=off first: both monitors start ⏸️ Off for that run, whatever modes are saved.
Settings
| Setting | Environment variable | Purpose |
|---|---|---|
token |
BOT_TOKEN |
Required. Your bot's token |
owner_id |
OWNER_ID |
Required. Your Telegram user ID; the bot answers nobody else |
db_url |
DB_URL |
Required. mysql://user:pass@host:3306/db. Tables are created on first start: pairs, positions and scanner_settings |
wallet_address |
WALLET_ADDRESS |
Required. The wallet it watches and trades from |
private_key |
PRIVATE_KEY |
Only to trade. Without it the bot can't go Live |
alerts_chat_id |
ALERTS_CHAT_ID |
Where alerts go. Defaults to your private chat. For a group or channel, add the bot to it first (as an admin, for a channel) |
alchemy_api_key, ankr_api_key |
ALCHEMY_API_KEY, ANKR_API_KEY |
Optional RPC keys, tried before the public nodes |
timezone |
TIMEZONE |
Default Europe/London |
SENTRY_DSN (standalone) |
Optional error reporting when run on its own | |
mode |
MODE |
off or watch to cap both monitors at that mode for this run only, without changing the saved modes. A host passes mode="off" for local runs |
website_url |
WEBSITE_URL |
The website's address, such as https://example.com/scanner. Adds 🌐 Open Website to the dashboard (details) |
db_dashboard_url |
DB_DASHBOARD_URL |
Optional web page for your database, such as its Heroku resources page. Database health alerts get a 🔧 Open database dashboard button. Never put DB_URL here: it holds the password |
Trading limits, audit thresholds, sell rules and schedules are changed in the bot under ⚙️ Settings and saved in scanner_settings.
Upgrading from 1.0 or 1.1: start 1.2 once first. It converts the old switches to a mode per monitor, splits the sell alerts switch, and adds the half_eth column; later versions no longer have those steps.
Use it inside another bot
from crypto_scanner import start_scanner_bot, stop_scanner_bot
await start_scanner_bot(
share_with=application,
owner_id=OWNER_ID,
alerts_chat_id=ALERTS_CHAT_ID,
)
...
await stop_scanner_bot()
Inside a host (with share_with), the scanner reads the same names with a SCANNER_ prefix, such as SCANNER_DB_URL and SCANNER_WALLET_ADDRESS, so it never clashes with the host's own settings. Pass env_prefix= to use a different prefix. Settings the host already has, like the owner and alerts chat, can be passed as keywords instead.
Inside a host, the bot token is optional. Without it, the scanner uses the host's bot: its jobs run on the host's job queue and its alerts come from the host's bot. With it, the scanner runs its own bot alongside the host's. Any setting can be passed as a keyword instead of an environment variable. The host can show the scanner's screens in its own menus, and forward any button whose data starts with scanner: to handle_button, and text replies to handle_text_input:
scanner_block(context, brief=False)is the scanner dashboard;brief=Truegives a short summary for a daily message.balances_block(brief=False)shows the wallet's balance on each network.scanner_health()returns the RPC, wallet and monitor status as text, plus its alerts, so a host can show them in its own health check if it wants. It only reads: it never changes settings or cleans the database.scanner_modes()returns each monitor's mode for this run, such as{"new": "watch", "trending": "off"}, so a host can tell whether the scanner is doing anything.add_web_routes(app, prefix="/scanner")adds the website to the host'saiohttpapp (details). Passwebsite_url=tostart_scanner_botso the dashboard links to it.
The website
The website needs a public address with HTTPS: Telegram's login only works on a real domain, never on localhost or a bare IP. Hosts like Heroku give you one.
- On its own: set
PORTandpython -m crypto_scannerserves the website on that port as well as running the bot. Heroku setsPORTfor you. The site is at/scanner, and/goes there. - Inside a host: call
add_web_routes(app)on the host's ownaiohttpapp. The site is at/scanneron the host's address; passprefix=to move it. - Behind a proxy: the site reads
X-Forwarded-Prototo tell it's on HTTPS, so its login cookie is only sent over HTTPS. Heroku and most proxies set it.
Then:
- In @BotFather, send
/setdomain, pick the bot the scanner runs on (the host's bot when it shares one) and send the domain on its own, such asexample.com. - Set
WEBSITE_URLto the site's full address, such ashttps://example.com/scanner. The dashboard gets 🌐 Open Website, which opens the website already logged in.
Only OWNER_ID can log in. Anyone else who tries is told the dashboard is only for the owner.
Development
pip install -e ".[dev]"
pre-commit install
pytest
pre-commit runs Ruff, mypy and a file-size check. See CONTRIBUTING.md for where things go and how releases work, and SECURITY.md to report a security problem privately.
Licence
MIT.
Metadata
Release files for crypto-scanner-bot 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crypto_scanner_bot-2.0.0.tar.gz | 90.5 kB | With provenance | Details for crypto_scanner_bot-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crypto_scanner_bot-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for crypto_scanner_bot-2.0.0-py3-none-any.whl |
Total release size: 180.3 kB
Release files / crypto_scanner_bot-2.0.0.tar.gz
| Download URL | crypto_scanner_bot-2.0.0.tar.gz |
|---|---|
| Size | 90.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
988ab1b3aa42b5fed23008f74033f618589fe5e3d49bdb0086e14726f773c1ac
|
|
BLAKE2b-256 checksum How to use checksums |
d70933bbbefecbb3a0782a0356547cd1d694e0564b6a27b88de99cb991923006
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / crypto_scanner_bot-2.0.0-py3-none-any.whl
| Download URL | crypto_scanner_bot-2.0.0-py3-none-any.whl |
|---|---|
| Size | 89.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0025261603a64d3e69c0937783653f32d6cbea8d68333d585f74f891cbaccc8a
|
|
BLAKE2b-256 checksum How to use checksums |
22dbdde6aebf4820ddf32aa9953adb0ae75afbf663ad5ec28ace7f4343354a0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for crypto-scanner-bot 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for crypto_scanner_bot-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.