Assay
$ASSAYSoon

Concepts

The assay

How Assay measures the gap between a stock token and its stock.

The formula

d = Pwrapper / (Pstock × RR) − 1
  • 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:

ReadingWhere in the boxUsed for
d_lowrapper at its lowest, stock and ratio at their highestthe most depegged reading
d_midevery price at its centredisplay: this is “the assay”
d_hiwrapper at its highest, stock and ratio at their lowestthe 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_hi is at or below −X.
  • Pass: even d_lo is above −X.
  • Inconclusive: the box straddles −X. It changes nothing.
Fail: extends the streakbox −2.12% to −2.06%
−X = −2%

Drag the box, or focus it and use the arrow keys.

A reading is a confidence box, here set to 0.06% wide for the illustration. The label comes from the SDK’s classify(), the same rule the program runs.

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.