TypeScript/Node bot for finance and macro prediction markets on Polymarket. Uses a value (edge) strategy with liquidity-aware sizing and maker-first pricing. No arbitrage — profitability comes from trading only when the market is mispriced vs your view and from execution quality.
- Edge betting — We only BUY when the market’s implied probability (best ask) is below your fair value by at least
FINANCE_VALUE_MIN_EDGE. So we only trade when there’s a real edge (you need a fair value from data or a model). - Liquidity filter — We skip markets where best-ask depth is below
FINANCE_MIN_LIQUIDITY_USD. That avoids illiquid books where prices are noisy and fills are poor. - Liquidity-aware sizing — Order size is capped to
FINANCE_LIQUIDITY_FRACTIONof the best-ask depth (e.g. 25%). That limits market impact and improves fill quality instead of walking the book. - Maker-first — When possible we place at best bid + 1 tick (improving the bid) instead of crossing the spread. That provides liquidity and can improve fill probability and effective price.
- Optional max edge — You can set
FINANCE_VALUE_MAX_EDGEso we skip situations where the edge is unrealistically large (often a sign of stale or wrong data).
So profit comes from: only trading when you have edge + sizing and pricing that protect execution, not from “bid + sell < 1” arbitrage.
| Type | Examples |
|---|---|
| Fed / rates | Fed fund rate at meeting, cut/hold/raise, number of cuts in a year |
| Inflation | CPI above/below X%, PCE, inflation direction |
| Employment | NFP, unemployment rate, jobless claims thresholds |
| Earnings / equities | S&P level, single-name earnings, sector performance |
| Crypto | BTC/ETH price levels, ETF flows, regulatory events |
| Macro | Recession Yes/No, GDP, PMI, central bank decisions |
Set FINANCE_TAG_ID to a finance/macro tag from GET https://gamma-api.polymarket.com/tags, or leave empty to scan all active events.
cd polymarket-finance-bot
npm install
cp .env.example .env
# Edit .env: POLYMARKET_PRIVATE_KEY, POLYMARKET_FUNDER_ADDRESS, FINANCE_* params
npm run dev| Variable | Description |
|---|---|
FINANCE_TAG_ID |
Gamma tag for finance. Empty = all active events |
FINANCE_VALUE_MIN_EDGE |
Min edge to place (e.g. 0.02) |
FINANCE_VALUE_MAX_EDGE |
Optional. Skip if edge > this |
FINANCE_VALUE_FAIR_PROB |
Optional fair prob (0–1). Default 0.5 |
FINANCE_STAKE_USD |
Base stake per order (USDC) |
FINANCE_MAX_ORDER_USD |
Cap per order (0 = no cap) |
FINANCE_MIN_LIQUIDITY_USD |
Min notional at best ask to trade |
FINANCE_LIQUIDITY_FRACTION |
Cap size to this fraction of ask depth (e.g. 0.25) |
FINANCE_MAKER_FIRST |
Place at best_bid+1 tick when possible |
FINANCE_DRY_RUN |
If true, no real orders |
Wallet/API: POLYMARKET_PRIVATE_KEY, POLYMARKET_FUNDER_ADDRESS, optional API key or auto-derive.
- Gamma API
GET /events?tag_id=...&active=true&closed=false. - List tags:
GET https://gamma-api.polymarket.com/tags. - Bot parses binary (Yes/No) markets and runs the value strategy only.
No strategy guarantees profit. Value depends on accurate fair values and execution. Use FINANCE_DRY_RUN=true first.