Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions deployment/aliyun/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ until this lane is stable and explicitly expanded.
The service records normalized `MarketUpdate` NDJSON under
`/data/monday/spool/polymarket/`. It has no credential environment file and cannot
emit trading intents. The primary tape stores Polymarket quotes/lifecycle events plus
reference prices, records one full visible CLOB book per token per second, retains
every bid and ask level in each snapshot, and drops orphaned or post-expiry quotes.
reference prices, records every quote update with the full visible CLOB book
per token, retains every bid and ask level in each snapshot, and drops
orphaned or post-expiry quotes.
The manifest separates `venue_depth_complete` from `temporal_updates_complete` so a
full-depth sampled snapshot cannot be mistaken for a raw exchange-diff tape.
Quotes timestamped after
Expand Down Expand Up @@ -93,7 +94,7 @@ requires three additional stable polls before a market is marked complete. Malfo
trade rows are isolated and counted by reason in `health.json` instead of blocking
valid rows.
The collector discovers the full 24-hour settlement lane on every cycle, but bounds
Data API trade requests to 112 markets per cycle. Markets in the active/finalization
Data API trade requests to 200 markets per cycle. Markets in the active/finalization
window and failed retries are always selected first; the remaining historical lane
rotates by oldest successful poll so cold-start backfill cannot prevent health from
advancing. `priority_trade_backlog` must be zero for the shadow gate to accept a
Expand All @@ -108,9 +109,13 @@ A separate OS-thread watchdog enforces the same wall-clock deadline across synch
tape fsync and atomic state publication, where a cooperative Tokio timeout cannot
preempt non-yielding work. Health evidence over that duration is rejected by the
shadow gate.
The 112-request budget and the collector units' 672MiB/768MiB memory high/max
limits are a measured pair. A Tokyo cold-start probe covered all 112 priority
markets in 31.425 seconds with zero priority backlog. The retired 384MiB high
The 200-request budget and the collector units' 672MiB/768MiB memory high/max
limits are a measured pair. The budget was raised from 112 to speed historical
trade backfill without raising concurrency: at most four requests remain in
flight and each chunk retains at most four market responses, so the measured
memory calibration below still bounds the same working set. A Tokyo cold-start
probe covered all 112 priority markets in 31.425 seconds with zero priority
backlog. The retired 384MiB high
watermark prevented health publication, while a later formal shadow reached a
538,951,680-byte peak and continued incrementing `memory.events high` under the
512MiB watermark. July 17 formal gates then measured 586.1MiB, 605.8MiB, and
Expand Down
2 changes: 1 addition & 1 deletion deployment/aliyun/polymarket-market-tape-upload.service
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ User=hftcollector
Group=hftcollector
Environment=HOME=/var/lib/hft-collector
EnvironmentFile=/etc/monday/polymarket-market-tape-upload.env
ExecStart=/opt/monday/bin/polymarket-raw-ops upload --quote-depth-levels 0 --quote-sample-ms 1000
ExecStart=/opt/monday/bin/polymarket-raw-ops upload --quote-depth-levels 0 --quote-sample-ms 0
TimeoutStartSec=0
NoNewPrivileges=true
PrivateTmp=true
Expand Down
2 changes: 1 addition & 1 deletion deployment/aliyun/polymarket-market-tape.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ market_data_source = "external_direct"
record_market_updates_to = "/data/monday/spool/polymarket/market-updates.ndjson"
record_market_updates_rotate_seconds = 3600
record_market_updates_include_kinds = ["quote", "event_discovered", "event_expired", "reference_price", "spot_price", "agg_trade", "l2"]
record_market_updates_quote_sample_ms = 1000
record_market_updates_quote_sample_ms = 0
record_market_updates_event_scoped_quotes = true
skip_settlement_exits = true

Expand Down
9 changes: 8 additions & 1 deletion deployment/aliyun/polymarket-reference-collector.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ ConditionPathIsMountPoint=/data
Type=simple
User=hftcollector
Group=hftcollector
ExecStart=/opt/monday/bin/polymarket-raw-ops collect-reference
# --max-trade-polls-per-cycle 200: the 180-second cycle watchdog and the
# 100ms minimum Data API request spacing bound one cycle to 1800 request
# starts; 200 polls need at least 20 seconds of pacing, leaving ~160 seconds
# of headroom for metadata and settlement work inside the watchdog. Poll
# concurrency stays at the default 4, so the 672MiB/768MiB memory calibration
# is unchanged while historical trade backfill throughput rises from the
# default 112 markets per cycle to 200.
ExecStart=/opt/monday/bin/polymarket-raw-ops collect-reference --max-trade-polls-per-cycle 200
Restart=always
RestartSec=5
RuntimeMaxSec=21600
Expand Down
Loading