Learn how a Polymarket TWAP market maker can combine time-weighted reference prices, order-book state, inventory, and quote risk.
A conventional market maker asks a simple question: where should I quote relative to the current market?
A TWAP-aware market maker asks a harder question:
How should the quote change when the current market price temporarily diverges from a time-weighted reference price?
That distinction matters because a prediction-market order book can move faster than the information represented by a short-horizon reference price. Polymarket now documents Chainlink-computed 30-second and 60-second TWAP feeds through its real-time data infrastructure. These feeds can therefore become an additional input to a quote engine rather than merely another price feed. ([Polymarket Documentation][1])
The objective is not to predict the market. It is to determine whether the current executable price is sufficiently far from a reference value to justify providing liquidity.
Contacts
Nagi writes about Polymarket bots, algorithmic trading, quantitative strategies, Python automation, Web3, and prediction-market infrastructure.
Github: https://github.com/NagiPoly/poly-maker
Telegram: https://t.me/nagi_777x
The Core Question
Can a TWAP-derived fair-value anchor improve passive quoting without causing the market maker to become systematically stale?
The answer should be treated as a research hypothesis, not an assumption.
A useful market-making system separates three quantities:
- Reference value — what the underlying reference process suggests.
- Displayed market value — what the Polymarket order book currently implies.
- Execution value — the price at which inventory can actually be accumulated or reduced.
That separation is the foundation of a TWAP-aware quote engine.
What We Are Analyzing
Consider a short-horizon binary market with:
- best bid (B_t)
- best ask (A_t)
- midpoint (M_t=(B_t+A_t)/2)
- TWAP-derived reference (R_t)
- inventory (I_t)
- remaining trading horizon (T_t)
Polymarket's market-making documentation confirms that passive market makers quote around fair value, manage inventory through quote skew, cancel stale quotes, and use real-time market data to keep the local state current. GTC and GTD are the documented primary order types for passive market making, with post-only available when an order must add liquidity rather than execute immediately. ([Polymarket Documentation][2])
The interesting engineering problem is therefore not order submission. It is fair-value construction.
A TWAP-Aware Fair-Value Model
A simple starting point is:
F_t = M_t + \lambda(R_t-M_t)
where:
- (F_t) = estimated fair value
- (M_t) = current order-book midpoint
- (R_t) = TWAP reference
- (\lambda) = TWAP influence parameter
If (\lambda=0), the system ignores TWAP.
If (\lambda=1), it fully anchors fair value to TWAP.
In practice, a fixed (\lambda) is unlikely to be sufficient. A better research design makes it conditional on reference freshness, spread, volatility, and time remaining.
For example:
\lambda_t =
\lambda_0
\cdot
q_t
\cdot
e^{-\gamma \sigma_t}
where (q_t) represents reference-data quality and (\sigma_t) represents recent market volatility.
This creates an important principle:
TWAP should influence quoting, not blindly determine quoting.
Polymarket currently documents 30-second and 60-second Chainlink TWAP windows. The documentation also explicitly states that these are lookback windows rather than publication cadences, and recommends using the observation timestamp for freshness checks. ([Polymarket Documentation][1])
The Quote Engine
Once fair value is estimated, the market maker can construct inventory-aware quotes:
P_{bid}=F_t-s_t-kI_t
P_{ask}=F_t+s_t-kI_t
where:
- (s_t) = base half-spread
- (k) = inventory-skew coefficient
- (I_t) = normalized inventory
The inventory term moves both quotes in the direction that encourages inventory reduction.
A long position, for example, should generally make additional buying less attractive and selling more attractive.
But TWAP introduces another dimension: reference divergence.
Define:
D_t = R_t-M_t
A large positive (D_t) means the TWAP reference is above the current midpoint.
That does not automatically mean “buy.”
It means the quote engine should investigate whether the difference reflects temporary dislocation, stale reference information, changing market expectations, or simply a regime transition.
A Practical Architecture
flowchart LR
A[Polymarket Order Book] --> C[State Engine]
B[Chainlink TWAP] --> C
C --> D[Fair Value Model]
D --> E[Inventory Skew]
E --> F[Quote Engine]
F --> G[Passive Orders]
G --> H[Fill Events]
H --> C
Polymarket's real-time market stream provides book, price-change, last-trade-price, and other market events. The documented market stream can therefore maintain a local order-book state without repeatedly polling. ([Polymarket Documentation][3])
The key design choice is to make the state engine the source of truth. Quote generation should operate on a coherent snapshot of:
book + TWAP + inventory + timestamps + market constraints.
Example: Synthetic BTC Market
Suppose a hypothetical market has:
- midpoint: $0.56
- 30-second TWAP-derived reference: $0.59
- spread: $0.02
- inventory: moderately long
A naive market maker might quote around $0.56.
A TWAP-aware engine detects:
D_t=0.59-0.56=0.03
Instead of immediately moving its entire fair value to $0.59, it could partially incorporate the divergence:
F_t=0.56+0.4(0.03)=0.572
The resulting quotes could then be adjusted further for inventory.
This is a synthetic example, not an observed Polymarket result.
The experiment is not whether $0.572 predicts the eventual outcome. The research question is whether quoting around that value produces a better relationship between spread capture, adverse selection, and inventory risk.
What Can Go Wrong?
The largest danger is treating TWAP as ground truth.
A TWAP is deliberately slower than instantaneous price. During a genuine regime shift, that is a feature of the reference—not an error.
A market maker that anchors too strongly to TWAP can therefore continue quoting aggressively while the market has already repriced.
Other failure modes include:
- stale TWAP observations
- timestamp misalignment
- order-book snapshots arriving out of sequence
- inventory calculated from incomplete fills
- excessive quote cancellation
- spread compression during volatility
- confusing displayed liquidity with executable liquidity
- overfitting (\lambda) to historical markets
Polymarket specifically recommends canceling stale quotes, using price guards, monitoring fills, and maintaining inventory limits. ([Polymarket Documentation][2])
Production Considerations
A production quote engine should maintain separate clocks for:
- market-data observation time
- TWAP observation time
- local processing time
- order submission time
- fill time
That makes reference freshness measurable.
The TWAP feed itself should also be treated as a stateful stream. Polymarket documents that RTDS subscriptions begin with the next update and provide no snapshot, history, or replay after disconnects. A production system therefore needs explicit freshness and reconnect logic. ([Polymarket Documentation][1])
For execution, Polymarket documents cancel-and-replace behavior because existing orders cannot simply be edited in place. Batch submission can reduce submission overhead, but each order result must still be evaluated independently. ([Polymarket Documentation][2])
Testing the Hypothesis
Separate the research into four stages:
Hypothesis: TWAP divergence contains useful information for quote placement.
Experiment: Replay historical order-book and reference-price states while varying (\lambda), spread, and inventory limits.
Observed result: Measure fill probability, realized spread, adverse selection, inventory variance, and mark-to-market P&L.
Interpretation: Determine whether TWAP improves quoting after accounting for execution costs and regime changes.
Do not optimize solely for fill rate. A market maker can achieve an excellent fill rate by consistently quoting prices that informed traders want to trade against.
Advanced Extensions
An experienced implementation could extend the framework with:
- Regime-dependent TWAP weighting — reduce TWAP influence during rapid repricing.
- Order-book imbalance — combine reference divergence with liquidity asymmetry.
- Volatility-adaptive spreads — widen quotes as short-term uncertainty increases.
- Cross-market references — compare related Polymarket contracts before adjusting fair value.
- Online calibration — continuously estimate whether TWAP divergence predicts subsequent mid-price movement.
The most interesting extension is probably regime detection: the system should distinguish a temporary deviation from a structural repricing event.
Key Takeaways
- A TWAP should be treated as a reference, not a prediction.
- The important variable is the divergence between reference value and executable market value.
- Inventory should modify both quote price and quote size.
- Reference freshness must be part of the pricing state.
- Historical replay should evaluate adverse selection, not just fill rate.
- The best TWAP-aware market maker is likely adaptive rather than permanently anchored.
FAQ
What is a Polymarket TWAP market maker?
It is a market-making system that incorporates a time-weighted reference price into its fair-value and quoting process while still accounting for order-book conditions and inventory.
Does Polymarket provide TWAP data?
Yes. Current Polymarket documentation describes Chainlink-computed 30-second and 60-second TWAP feeds available through Polymarket RTDS. ([Polymarket Documentation][1])
Should a market maker quote directly around the TWAP?
Not necessarily. TWAP should be one input into fair-value estimation. Current midpoint, spread, volatility, reference freshness, and inventory can all affect the final quote.
Can TWAP reduce adverse selection?
That is a hypothesis that requires empirical testing. A TWAP can potentially identify temporary deviations, but it can also lag genuine repricing.
What order types are relevant to passive market making?
Polymarket documents GTC and GTD as primary passive-market-making order types and supports post-only behavior when an order must add liquidity rather than execute immediately. ([Polymarket Documentation][2])
Disclaimer
This article is for educational and research purposes only. Trading prediction markets involves market, liquidity, execution, model, and capital risk. No strategy discussed here guarantees profit.
Conclusion
A TWAP-aware Polymarket market maker should not be designed as a simple “trade toward the average” strategy. The more useful architecture treats TWAP as a slow-moving information layer alongside the live order book.
The research opportunity is to measure when that layer improves quote placement—and when its inherent lag becomes a liability. That turns TWAP from a static indicator into an experimentally testable component of a market-making system.
Top comments (0)