Concepts
The assay
How Assay measures the gap between a stock token and its stock.
The formula
- P_wrapper is the Pyth price of the token, per raw (unscaled) whole token.
- P_stock is the Pyth price of the share, for example
Equity.US.AAPL/USD. - RR is the redemption ratio: how many shares one raw token stands for.
d is zero when the token trades exactly at its redemption value. At −1% it trades 1% below it.
Why the ratio matters
xStocks and Ondo tokens are Token-2022 mints with the Scaled UI Amount extension. Wallets show raw amount × multiplier, and the multiplier grows when dividends are reinvested. Pyth prices both tokens per raw token, so the ratio in the formula is shares per raw token. Leaving it out would read a reinvested dividend as a depeg. How each wrapper’s ratio is sourced is in Wrappers and ratios.
Confidence, and the edge that counts
Every Pyth price comes with a confidence interval. Assay evaluates d at three points of the box those intervals make:
| Reading | Where in the box | Used for |
|---|---|---|
d_lo | wrapper at its lowest, stock and ratio at their highest | the most depegged reading |
d_mid | every price at its centre | display: this is “the assay” |
d_hi | wrapper at its highest, stock and ratio at their lowest | the trigger: the conservative edge |
The trigger uses d_hi, the conservative edge: the least depegged point of the box. Price noise alone cannot make a pool pay.
Three outcomes per reading
A pool’s trigger level is −X. Each observation is judged on its whole box:
- Fail: even
d_hiis at or below −X. - Pass: even
d_lois above −X. - Inconclusive: the box straddles −X. It changes nothing.
Drag the box, or focus it and use the arrow keys.
Inconclusive readings exist so that the same standard of proof applies to both sides. A buyer cannot trigger a pool on noise, and an underwriter cannot reset a real streak with the one lucky snapshot that pokes above the line.
Where the numbers come from
Pyth Pro signs the prices of the stock, each wrapper and the xStocks ratio in one message, together with the stock’s market session. The Assay program verifies that signature inside the transaction, so no one has to be trusted to relay the prices.