import asyncio, time
import httpx
from ironflow_sdk import Ironflow
MARKET = "BTC-PERP"
MIN_NOTIONAL = 250_000 # USD
WEBHOOK = "https://hooks.slack.com/services/..."
async def watch():
async with Ironflow("if_your_api_key") as client:
last_seen = int(time.time() * 1000)
while True:
page = await client.trades(MARKET, from_=last_seen, limit=200)
for t in page.data:
notional = float(t.price) * float(t.size)
if notional >= MIN_NOTIONAL:
async with httpx.AsyncClient() as http:
await http.post(WEBHOOK, json={
"text": f"{MARKET}: {t.side.upper()} "
f"${notional:,.0f} @ {t.price}"
})
last_seen = max(last_seen, t.timestamp + 1)
await asyncio.sleep(2)
asyncio.run(watch())