Expand description
Local fullness-based pricing algorithm for ant-node.
Mirrors the logarithmic pricing curve from autonomi’s MerklePaymentVault contract:
- Empty node → price ≈
MIN_PRICE(floor) - Filling up → price increases logarithmically
- Nearly full → price spikes (ln(x) as x→0)
- At capacity → returns
u64::MAX(effectively refuses new data)
§Design Rationale: Capacity-Based Pricing
Pricing is based on node fullness (percentage of storage capacity used),
not on a fixed cost-per-byte. This design mirrors the autonomi
MerklePaymentVault on-chain contract and creates natural load balancing:
- Empty nodes charge the minimum floor price, attracting new data
- Nearly full nodes charge exponentially more via the logarithmic curve
- This pushes clients toward emptier nodes, distributing data across the network
A flat cost-per-byte model would not incentivize distribution — all nodes would charge the same regardless of remaining capacity. The logarithmic curve ensures the network self-balances as nodes fill up.
Functions§
- calculate_
price - Calculate a local price estimate from node quoting metrics.