Expand description
Quadratic storage-pricing formula shared by node and client (ADR-0004). Quadratic pricing with a baseline floor.
Formula: price_per_chunk_ANT(n) = BASELINE + K × (n / D)²
The non-zero BASELINE makes empty nodes charge a meaningful spam-barrier
price, and K is anchored so per-GB USD pricing matches real-world targets
at the current ~$0.10/ANT token price. An earlier formula produced ~$25/GB
at the lower stable boundary and ~$0/GB when nodes were empty — both
unreasonable.
This is the single source of truth both the node (when pricing a quote)
and the client (when verifying ADR-0004’s forced price before paying) must
agree on. It lives here, in the shared wire/contract crate, so the two sides
can never drift: ant-node re-exports calculate_price from this module
rather than defining its own.
§Parameters
| Constant | Value | Role |
|---|---|---|
| BASELINE | 0.00390625 ANT | Price at empty (bootstrap-phase spam barrier) |
| K | 0.03515625 ANT | Quadratic coefficient |
| D | 6000 | Lower stable boundary (records stored) |
Functions§
- calculate_
price - Calculate storage price in wei from the number of close records stored.
- derive_
records_ stored_ from_ price - Derive the quoted record count from a quote price.