-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_alert.py
More file actions
55 lines (45 loc) · 1.55 KB
/
test_alert.py
File metadata and controls
55 lines (45 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""Quick test script to send a test alert with all fields."""
import asyncio
from datetime import datetime
from src.config import config
from src.models import Trade, Signal, SignalType, TradeSide
from src.alerts import alert_manager
async def send_test_alert():
"""Send a test alert with all fields populated."""
# Create a sample trade
trade = Trade(
asset_id="12345678901234567890",
market="0x1234567890abcdef",
price=0.65,
size=15000,
side=TradeSide.BUY,
timestamp=1705420800000,
taker_address="0x941234567890abcdef1234567890abcdef123456",
)
# Create a signal with all fields
signal = Signal(
trade=trade,
signal_types=[SignalType.FRESH_WALLET, SignalType.WHALE, SignalType.TIMING],
confidence=0.85,
market_title="Will Trump win the 2024 election?",
market_slug="trump-2024-election",
current_yes_price=0.65,
current_no_price=0.35,
wallet_tx_count=3, # Fresh wallet with 3 transactions
hours_to_close=18.5, # Near market close
price_before_trade=0.62,
price_after_trade=0.65,
wallet_profit_loss=12500.0,
wallet_win_rate=0.72,
wallet_total_trades=15,
wallet_volume=85000.0,
)
# Start alert manager and send
await alert_manager.start()
await alert_manager.send_alert(signal)
# Give it time to process
await asyncio.sleep(3)
await alert_manager.stop()
print("Test alert sent!")
if __name__ == "__main__":
asyncio.run(send_test_alert())