Skip to content

feat(bench): the first capture where both venues quote the same event - #71

Merged
DanielWLiu07 merged 2 commits into
mainfrom
feat/fomc-cross-venue-capture
Sep 7, 2026
Merged

DanielWLiu07 merged 2 commits into
mainfrom
feat/fomc-cross-venue-capture

Conversation

@DanielWLiu07

Copy link
Copy Markdown
Owner

Ships a 23.6-minute cross-venue capture of the September 2026 FOMC decision on
Kalshi and Polymarket, plus the hand-paired registry it needs.

This is the first capture in the repo that uses Kalshi's live feed at all.
The adapter existed for months without ever connecting, and the first time it
did, its books came back empty (fixed in #69).

gunzip -c docs/bench/fomc-xvenue.feedlog.gz > /tmp/fomc-xvenue.feedlog
./build/src/basis replay /tmp/fomc-xvenue.feedlog \
    --config configs/contracts-fomc.toml

records   1510 (kalshi 218, polymarket 1292)
deltas    8598 applied, 0 unmapped
dropped   0 malformed msgs, 0 bad lines, 0 gaps

The pairing is by hand

contracts-live.toml leaves kalshi empty on purpose - matching an outcome
across venues is a judgement about resolution wording, and a wrong pairing
poisons everything downstream. Each Kalshi outcome and its Polymarket question
resolve on the same meeting and both close 2026-09-16. The prices corroborate
it: Kalshi's hold contract quoted 0.48/0.49 against Polymarket's 0.495.

The result is negative, which is why it is worth having

On the hold contract the raw books cross on 1,383 of 2,328 two-sided
updates (59.4%), mean edge at the touch $1,083.49. Every one loses money
after Kalshi's taker fee:

net of Kalshi taker fees   mean $-811.87   0/1383 profitable
fee-aware optimal sweep    mean $0.00      0/1383 worth taking
surviving a 50ms delay     $0.00 (22/22 episodes)

A naive cross-venue scanner would report a 59% arbitrage rate on this feed.

The caveat is larger than the result

59.7% of those samples were priced against a quote over 5 seconds old,
stalest 60.8s. 218 Kalshi records in 23.6 minutes is not enough for both books
to be fresh simultaneously, so an unknown share of the crossing is a
stale-quote artifact.

That does not change the fee conclusion, but it means this capture cannot
support a claim about how often the venues genuinely cross - and the doc does
not make one. Lead-lag is reported as no signal for the same reason: 525
Kalshi moves, 0 confirmed follows, which at this update rate is absence of
data rather than absence of effect.

RequestIsSafeUnderConcurrentPublishAndDrain asserted served > 0: that at
least one of 20,000 request() calls found a value in the slot. The drainer
in the same test is a tight loop emptying that slot, so the assertion is a
statement about scheduling, not about the code under test. It passed 200
consecutive local runs and failed once in CI under the BDE allocators on a
loaded runner.

Nothing is lost. That request() returns a present value is pinned
deterministically by RequestReturnsTheCurrentValueWithoutSubscribing, and
the assertion this test exists for - requests_served + requests_denied
equals the number of calls made - is unaffected by who wins the race.

A test that reddens the build at random teaches you to ignore red.
Ships a 23.6-minute cross-venue capture of the September 2026 FOMC decision
on Kalshi and Polymarket, and the hand-paired registry it needs. This is
the first capture in the repo that uses Kalshi's live feed at all: the
adapter existed for months without ever connecting, and the first time it
did, its books came back empty.

The pairing is by hand because contracts-live.toml says it has to be -
matching an outcome across venues is a judgement about resolution wording,
and a wrong pairing poisons every number downstream. Each Kalshi outcome
and its Polymarket question resolve on the same meeting and both close
2026-09-16. The prices corroborate it rather than merely permitting it:
Kalshi's hold contract quoted 0.48/0.49 against Polymarket's 0.495.

The result worth having is negative. On the hold contract the raw books
cross on 1,383 of 2,328 two-sided updates, 59.4%, mean edge at the touch
$1,083.49 - and every one of them loses money once Kalshi's taker fee is
charged. The fee-aware sweep, free to take part of a crossed book, declines
all 1,383. A naive scanner would report a 59% arbitrage rate on this feed.

The caveat is bigger than the result and the doc leads with it: 59.7% of
those samples were priced against a quote over 5 seconds old, because 218
Kalshi records in 23.6 minutes is not enough for both books to be fresh at
once. An unknown share of the crossing is a stale-quote artifact. That does
not change the fee conclusion, but it does mean this capture cannot support
a claim about how often the venues genuinely cross, and it does not make
one.
@DanielWLiu07
DanielWLiu07 merged commit f3a13ba into main Sep 7, 2026
9 checks passed
@DanielWLiu07
DanielWLiu07 deleted the feat/fomc-cross-venue-capture branch September 7, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant