This repository has been archived on 2026-11-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
pascal 480ee3ad2d feat(polymarket): subscription monitoring and connection recycling
The exchange can fail without telling us, and first one wins hides a
subscription gone quiet on one of a symbol's two connections.

- A connection that receives nothing for 30 s, not even the keepalive's
  answer, reconnects.
- Each book thread counts a symbol's changes per connection every minute:
  a subscription with none against three or more on the other is
  resubscribed, and moved to another connection if it stays quiet.
- The orchestrator recycles one connection at a time, each about hourly,
  and never while another connection is down or just back.
- A reconnect's opening book of a symbol unchanged for 10 s is judged like
  a resync's answer: one newer than ours that differs shows a symbol quiet
  on both connections, written as a Snapshot and logged as a loss.
2026-11-11 17:42:27 +00:00
2026-10-22 00:07:38 -04:00
2026-10-22 18:44:20 -04:00
2026-10-22 00:07:38 -04:00
2026-10-22 18:44:20 -04:00

Read before getting started!!

First, read src/main.rs. Then, some background on this repo:

This repo uses the FIX SBE standard for writing binary messages. The rust code abstracts this away for you, and you can simply use the helpers, as demonstrated in main.rs.

More background, in case you are curious!

FIX SBE is defined in XML, which I find extremely cumbersome to edit, especially when updating schemas frequently. To solve this, I have also introduced some helper code that takes our own custom YAML format, and turns it into FIX SBE XML, which in turn is used to generate rust code to encode and decode the messages. You don't need to edit any of these files. This explanation is simply to help you understand the origins of the various files in this repo.

If you're curious to see the YAML schema, take a look at challenge_orderbook.yaml. We also use a custom timestamp field, so that the Rust struct can use chrono::DateTime in the generated struct, and in SBE schema, it is a uint64 representing the timestamp as the number of microseconds since unix epoch.

S
Description
No description provided
Readme
1.1 MiB
0 Stars 1 Watchers 0 Forks
Languages
Rust 92%
Python 3.7%
Shell 3.5%
Awk 0.8%