Build a Telegram prediction market alert bot with USDC payments
OddsAlertBot is a Telegram bot that watches prediction markets, sends free headlines, and unlocks premium alerts after a user pays USDC on Solana.
What OddsAlertBot integrates
The existing bot stack is simple: Telegram Bot API for chat commands, a prediction market data source for prices and volume changes, and Viaclave for wallet creation, deposit addresses, and payment verification.
This article uses a prediction-market style data source without assuming a specific exchange integration. You can plug in your own market data provider, event crawler, or internal odds engine.
Why this is worth building
Prediction market alerts are valuable when they are timely. A free bot can post delayed headlines or broad market movement. The paid product is the narrow alert that says a specific market moved, why it moved, and what source changed the probability.
The payment problem is usually what slows teams down. Telegram bots can collect card payments through a separate checkout, but that adds accounts, chargebacks, payout delays, and a support surface. A Solana USDC flow keeps the bot close to the crypto-native users who already hold stablecoins.
A simple ROI model is enough to decide whether the feature is worth shipping. If 200 users pay 5 USDC per month for premium alerts, the bot has 1000 USDC of monthly revenue before infrastructure and data costs. If premium data costs 150 USDC per month and hosting costs 50 USDC, the first break-even target is 40 paying users at 5 USDC. The point is not that every bot will hit those numbers. The point is that stablecoin payments make small paid alert products practical without waiting for a full SaaS billing system.
Recommended stack
- Telegram Bot API with Telegraf, grammY, or your existing bot framework.
- A small database table mapping Telegram user IDs to Viaclave wallet IDs and access status.
- A prediction market data provider, exchange API, crawler, or internal market watcher.
- Viaclave REST API for wallet creation, deposit address lookup, transaction verification, and optional payouts.
- A scheduler or queue for sending alerts when market prices, volume, or news triggers cross your thresholds.
Payment flow
- A user sends /premium in Telegram.
- OddsAlertBot creates or looks up a Viaclave wallet for that user.
- The bot returns a Solana deposit address and accepted stablecoins.
- The user sends USDC and replies with the transaction signature.
- The bot verifies the payment through Viaclave and unlocks premium alerts.
Data model
Keep the payment state boring. You do not need a complex ledger in your Telegram bot because Viaclave handles balances and transaction verification. Your database only needs enough state to connect a Telegram user to a wallet and a product entitlement.
type PremiumUser = {
telegramUserId: string;
viaclaveWalletId: string;
depositAddress: string;
accessTier: "free" | "premium";
premiumUntil: string | null;
lastPaymentSignature?: string;
};Create a wallet for a Telegram user
Run this when a user first opens the bot or when they ask for premium access. Store the returned wallet ID in your database so the user gets the same deposit address next time.
async function createTelegramUserWallet(telegramUserId: string) {
const response = await fetch("https://api.viaclave.com/v1/wallets", {
method: "POST",
headers: {
"Authorization": "Bearer vc_test_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
label: "telegram-user-" + telegramUserId,
}),
});
return response.json();
}Return the deposit address in Telegram
The bot should return a plain address, supported tokens, and a short instruction. Ask users to paste the transaction signature after sending payment. That gives your bot a deterministic verification step.
async function getPremiumDepositInstructions(walletId: string) {
const response = await fetch(
"https://api.viaclave.com/v1/wallets/" + walletId + "/deposit-address",
{
headers: {
"Authorization": "Bearer vc_test_YOUR_KEY",
},
},
);
const deposit = await response.json();
return "Send 5 USDC on Solana to " + deposit.deposit_address +
" then paste the transaction signature here.";
}Verify the user's Solana payment
After the user sends a Solana transaction signature, verify it before adding them to the premium alert list. This gives the bot a clean payment gate without storing private keys or polling RPC directly.
async function verifyPremiumPayment(signature: string) {
const response = await fetch(
"https://api.viaclave.com/v1/transactions/" + signature,
{
headers: {
"Authorization": "Bearer vc_test_YOUR_KEY",
},
},
);
const tx = await response.json();
return tx.confirmed === true;
}Grant access after verification
Do not unlock access only because a transaction is confirmed. Check that the transfer went to the expected address, used the expected token, and met the minimum amount. Then update your database and add the user to the premium alert segment.
function didPayForPremium(
tx: { confirmed: boolean; transfers: Array<{ asset: string; amount: number; to: string }> },
expectedAddress: string,
) {
if (!tx.confirmed) return false;
return tx.transfers.some((transfer) => (
transfer.asset === "USDC" &&
transfer.amount >= 5000000 &&
transfer.to === expectedAddress
));
}What premium alerts should include
Do not sell raw noise. A paid prediction market alert should compress the event, the market, the move, and the source into one useful message. That is what makes the bot feel like a product instead of a notification stream.
- Market name and current implied probability.
- What changed in the last few minutes or hours.
- The source or evidence behind the move.
- A risk note, for example thin liquidity or stale source data.
- A link back to the market or your internal dashboard.
Real-world extensions
- Charge per alert, per market category, or per month.
- Use separate wallets for free users, premium users, and treasury funds.
- Pay market analysts automatically when their alert performs well.
- Set spending limits on the bot treasury before enabling payouts.
Production rollout
Start with a test group and devnet keys. Once the payment flow is smooth, launch one premium tier and one payment amount. Avoid subscriptions, coupons, multiple tiers, and referral splits in the first version. You can add those once users prove they will pay for the alerts.
Build this workflow in test mode
Create a test API key, connect the MCP server, or call the REST API directly. Viaclave's test mode lets you try wallet creation and test stablecoin payments without real funds.