Docs
Notifications
Notifications
Send alerts when arbitrage opportunities appear.
Telegram Notifications
Send real-time alerts to your phone via a Telegram bot.
Setup
- Create a bot with @BotFather and get your bot token
- Start a chat with your bot and get your chat ID from @userinfobot
Code
import requests
import time
TELEGRAM_BOT_TOKEN = "your_bot_token"
TELEGRAM_CHAT_ID = "your_chat_id"
API_KEY = "your_api_key"
def send_telegram(message):
"""Send message via Telegram bot."""
url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
requests.post(url, json={
"chat_id": TELEGRAM_CHAT_ID,
"text": message,
"parse_mode": "HTML"
})
def check_and_alert(min_roi=4.0):
"""Check for opportunities and send alerts."""
response = requests.get(
"https://getarbitragebets.com/api/internal/arbs-full_2",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"investment": 100, "min_profit": 3.0}
)
data = response.json()
for arb in data['profitable_arbitrages']:
roi = arb['best_arbitrage']['roi_percent']
if roi >= min_roi:
message = f"""
<b>Arbitrage Alert!</b>
Market: {arb['market_name_a'][:40]}
Profit: ${arb['best_arbitrage']['net_profit']:.2f} ({roi:.2f}%)
Strategy: {arb['best_arbitrage']['combination']}
Kalshi: {arb['url_a']}
Polymarket: {arb['url_b']}
"""
send_telegram(message)
print(f"Alert sent: {roi}% ROI")
# Run every 2 minutes
while True:
check_and_alert(min_roi=4.0)
time.sleep(120)Email Notifications with Resend
Send email alerts using the Resend API.
Setup
- Sign up at resend.com and get your API key
- Verify your sending domain or use the sandbox
Code
import requests
import time
RESEND_API_KEY = "re_your_api_key"
FROM_EMAIL = "alerts@yourdomain.com"
TO_EMAIL = "you@example.com"
API_KEY = "your_api_key"
def send_email(subject, html_body):
"""Send email via Resend API."""
response = requests.post(
"https://api.resend.com/emails",
headers={
"Authorization": f"Bearer {RESEND_API_KEY}",
"Content-Type": "application/json"
},
json={
"from": FROM_EMAIL,
"to": TO_EMAIL,
"subject": subject,
"html": html_body
}
)
return response.json()
def check_and_email(min_roi=5.0):
"""Check for opportunities and send email alerts."""
response = requests.get(
"https://getarbitragebets.com/api/internal/arbs-full_2",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"investment": 100, "min_profit": 3.0}
)
data = response.json()
high_roi_arbs = [
arb for arb in data['profitable_arbitrages']
if arb['best_arbitrage']['roi_percent'] >= min_roi
]
if high_roi_arbs:
html_body = "<h2>High ROI Opportunities Found</h2><ul>"
for arb in high_roi_arbs:
ba = arb['best_arbitrage']
html_body += f"""
<li>
<strong>{arb['market_name_a'][:50]}</strong><br>
Profit: ${ba['net_profit']:.2f} ({ba['roi_percent']:.2f}% ROI)<br>
<a href="{arb['url_a']}">Kalshi</a> |
<a href="{arb['url_b']}">Polymarket</a>
</li>
"""
html_body += "</ul>"
send_email(
f"Arbitrage Alert: {len(high_roi_arbs)} opportunities found",
html_body
)
print(f"Email sent with {len(high_roi_arbs)} opportunities")
# Run every 5 minutes
while True:
check_and_email(min_roi=5.0)
time.sleep(300)Discord Webhook
Send alerts to a Discord channel using webhooks.
Setup
- In your Discord server, go to Server Settings > Integrations > Webhooks
- Create a new webhook and copy the URL
Code
import requests
import time
DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/your_webhook_url"
API_KEY = "your_api_key"
def send_discord(content, embeds=None):
"""Send message to Discord via webhook."""
payload = {"content": content}
if embeds:
payload["embeds"] = embeds
requests.post(DISCORD_WEBHOOK_URL, json=payload)
def check_and_alert_discord(min_roi=4.0):
"""Check for opportunities and send Discord alerts."""
response = requests.get(
"https://getarbitragebets.com/api/internal/arbs-full_2",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"investment": 100, "min_profit": 3.0}
)
data = response.json()
for arb in data['profitable_arbitrages']:
ba = arb['best_arbitrage']
roi = ba['roi_percent']
if roi >= min_roi:
embed = {
"title": "Arbitrage Alert!",
"color": 0x00ff00,
"fields": [
{"name": "Market", "value": arb['market_name_a'][:50], "inline": False},
{"name": "Profit", "value": f"${ba['net_profit']:.2f}", "inline": True},
{"name": "ROI", "value": f"{roi:.2f}%", "inline": True},
{"name": "Links", "value": f"[Kalshi]({arb['url_a']}) | [Polymarket]({arb['url_b']})", "inline": False}
]
}
send_discord("", embeds=[embed])
print(f"Discord alert sent: {roi}% ROI")
# Run every 2 minutes
while True:
check_and_alert_discord(min_roi=4.0)
time.sleep(120)