Get started
DocumentationConcepts

Reference rate

Source

One number per product per day: the median list price among the providers publishing one, by a rule with no judgement in it.

bash
curl https://vitna.ai/api/v1/rates

The rule

  1. A series exists for a product that at least three distinct providers publish a confirmed price for on the day.
  2. The rate is the median of those prices: the middle one, or the mean of the two middle ones, with the halfway case rounded up.
  3. Arithmetic is exact, in whole millionths, the precision the record stores.
  4. A price read once and not yet confirmed by a second read does not count.
  5. A series is never restated. A day is published once, and a correction is a new row on a later day.

Rule 5 is the one that gives the series its value. A benchmark that can be quietly recomputed after the fact is not a benchmark, it is an opinion with a timestamp.

What a rate is not

Published inside the API response itself, in an isNot array, because all three are things a reader could reasonably assume and none is true:

  • not a price anyone can buy at. It is a median of list prices. No seller is obliged to be at it.
  • not a volume-weighted average. The record holds no volumes. Vitna sees published prices, not transactions.
  • not a forecast. It is a statement about a day that has already happened.

Why the method travels with the numbers

The rule is served in the same response as the rates rather than linked from it. A benchmark whose method a reader has to go and find is one most readers will use without reading, and the entire claim being made here is that the rule is fixed and checkable.

Recomputing

bash
npm run witness:rates -- --verify

Recomputes every day ever published and reports disagreement. --dry-run writes nothing.

Because inputs are append-only and the rule has no free parameters, an independent implementation reading /api/v1/skus/{slug}/history should arrive at the same series. That is the intended check.