I build trading infrastructure and do empirical market research, mostly in prediction markets — a young asset class where the microstructure questions are still open and one person can collect data nobody else has.
tinli.dev · wespanko@gmail.com
github.com/wespanko/tinli — Python (FastAPI, pyarrow, Hypothesis) · TypeScript/React
One screen across Kalshi and Polymarket: unified market data (every price a
Decimal, venue quirks absorbed at the adapter boundary), a fee-aware
divergence screener that prices the cross-venue lock with each venue's
exact fee rounding, depth-walked size-aware edge curves, and a risk engine
— 95% VaR computed two ways (parametric and seeded Monte Carlo over the
actual joint Bernoulli distribution, both capped at max loss) and Kelly
sizing that only accepts the user's own probability estimates. Live
streaming over Polymarket's websocket with authenticated Kalshi access via
bring-your-own-key request signing. 163 tests; every quantitative claim
ships with its assumptions in the payload.
The interesting part. A continuously running recorder writes decimal128 parquet snapshots of both venues' books; the studies below regenerate from it as the sample grows:
- Edge persistence & lock backtest — 5.2% of 387k recorded pair-ticks showed a positive lock edge after exact taker fees at displayed size (max 8.6¢/contract). When edges appear they persist — median ~5 minutes, and one pair carried a continuously executable after-fee edge for 4.7 days. Latency barely matters (93% of P&L still capturable ~5 minutes late), but taking every edge over 20 days locks only ~$1,066 on ~$329k deployed: displayed depth, not reaction time, caps this trade. Backtest is deliberately conservative: one lock per episode, floor-quantized edges, human-verified contract pairs only.
- Cross-venue price discovery — which venue moves first? Move-conditional follow analysis with exact binomial tests (raw cross-correlation is useless on sparse mids). Each venue's moves are answered by the other well above chance (59% pooled follow rate, p < 0.001 in both directions) but symmetrically — real co-movement, no leader at snapshot cadence, with the censoring quantified.
- FOMC event study — the July 2026 Fed decision resolved the densest pair mid-recording. Kalshi's book was pulled 128s before the release and never returned (its Fed markets close at the announcement), so event-time price discovery was structurally 100% Polymarket — which repriced 80¢ → 99.4¢ inside a single 61-second snapshot bracket. The largest at-size lock in the whole sample ($1,438 after fees on one tick) was on display 36 minutes before the release: capacity peaked exactly when it was about to vanish.
A recurring theme throughout: refusing to overstate. Edges round down at every stage, statistics go unreported below sample-size floors, and pairs whose resolution criteria don't provably match are treated as traps — the repo documents a live example where two venues would settle the same question opposite ways.
github.com/wespanko/vol-surface — Python (numpy, scipy)
Implied-vol surface construction from listed SPX chains with no external assumptions: forwards and discount factors regressed out of put-call parity, Black-76 inversion with no-arbitrage bounds, and per-expiry SVI calibrated by the quasi-explicit (Zeliade) decomposition. Diagnostics include the Gatheral–Jacquier butterfly function g(k) and calendar monotonicity, evaluated on observed strike ranges only. From the first snapshot: 46 expiries fit to 0.2–0.4 vol points RMSE, and ATM skew measured decaying as ≈ T^−0.44 — the classic ~T^−1/2 stylized fact. Tests include the Axel Vogt SVI parameters correctly flagged as butterfly-arbitrageable.
github.com/wespanko/PRL — four rapid product prototypes on separate branches; the current direction is a Bloomberg-style Polymarket terminal with a YES+NO basis arbitrage finder, Kelly edge calculator, and a personal forecast-calibration tracker (Brier score, log loss, expected calibration error).
All of it runs read-only against public market data: no order placement, no account access, keys never leave the user's machine.