InvaraINVARA CoreDOCS
Products

Borrow-Fee Alerts

Telegram alerts when a stock's TradFi borrow fee spikes, crosses your level, or shares to borrow dry up.

Get started#

Borrow-Fee Alerts is a Telegram bot. Open it in Telegram, press Start, and add your first alert with /watch GME.

It watches the same Interactive Brokers short-stock file as the Borrow Screener (~19,000 US stocks) and checks for a new file every 5 minutes. IBKR publishes roughly every 15 minutes.

Commands#

CommandWhat it does
/watch GMEAlert on sharp moves: fee spike, fee collapse, or shares drying up
/watch GME 25Alert when the borrow fee reaches 25%
/unwatch GMERemove one alert (or /unwatch all)
/listYour alerts with the current fee
/topThe 10 hardest-to-borrow US stocks right now
/top mintableOnly stocks with a Pyth feed (mintable as synthetics on INVARA)
/fee GMEBorrow fee, rebate, shares available, and mintability

Each chat can watch up to 25 tickers.

Alert rules#

AlertFires when
🚨 ThresholdThe fee reaches your level. Re-arms once the fee falls below 90% of it, so you are not spammed.
📈 SpikeThe fee rises at least 1 percentage point and at least 25% since the last file
📉 CollapseThe fee falls at least 5 percentage points and at least 50%
🔻 Drying upShares available to borrow drop below 10,000
ℹ
Every alert says whether the stock has a Pyth feed, meaning it can be minted as a synthetic on INVARA instead of shorted.

Running the bot#

  1. Create a bot with @BotFather and copy its token.
  2. Set TELEGRAM_BOT_TOKEN, TELEGRAM_BOT_USERNAME, TELEGRAM_WEBHOOK_SECRET and SITE_URL on the server.
  3. Register the webhook once after deploying:
bash
curl "https://api.telegram.org/bot<TOKEN>/setWebhook" \
  -d "url=https://<your-host>/api/telegram/webhook" \
  -d "secret_token=<TELEGRAM_WEBHOOK_SECRET>"

For local development without a public URL, set TELEGRAM_POLLING=1 instead. Without a token the bot runs in dry-run mode and writes its messages to .data/telegram-dry-run.log.

ℹ
Persistence
Subscriptions are stored in .data/alerts.json. On hosts with an ephemeral disk, point ALERTS_DATA_DIR at a persistent disk, and run the app as a long-lived server so the checker keeps running.