[!WARNING] Work in progress
The rates and constants on this page are placeholder values for development and testing. Final pricing, rate ratios, and economic parameters are still under design review and will change before production.
Lease pricing is fully deterministic. The cost is computed from the resource dimensions, the duration, and the provider's certificate price multiplier, using integer arithmetic in micro-XUSD (1 XUSD = 1,000,000 µXUSD). The ledger validates that every lease block carries the exact cost produced by this formula -- no negotiation, no rounding errors.
The rates are already denominated in micro-XUSD per hour, so the unscaled product lands directly in micro-XUSD. The provider's price multiplier is applied last, with a single ceiling divide:
perHourMicro = vCPUs x 20_000 + ceil(memoryMB / 1024) x 10_000 + diskGB x 1_000hours = ceil(duration / 3600)costMicro = perHourMicro x hourscost = ceil(costMicro x multiplierMilli / 1000) // minimum 1 µXUSD
multiplierMilli is the provider's price multiplier scaled ×1000 (1000 = 1.000×), read from the performance certificate the lease block references. See Performance Evaluation.
[!NOTE] Rounding
Memory is rounded up to the nearest GB: 1025 MB counts as 2 GB. Duration is rounded up to the nearest hour: 3601 seconds counts as 2 hours. The multiplier scaling is ceiling-divided. All rounding uses integer ceiling division and always rounds up, consistently.
The stake uses ceiling division (LeaseStake): a cost of 7 µXUSD yields a stake of 2 µXUSD. The minimum stake is 1 µXUSD regardless of cost. The XE emission is not the same number as the cost — it scales the cost by the emission rate R that was locked onto the lease at acceptance. See Economics.
const ( LeaseVCPURate = 20_000 // micro-XUSD per vCPU per hour LeaseMemGBRate = 10_000 // micro-XUSD per GB memory per hour LeaseDiskGBRate = 1_000 // micro-XUSD per GB disk per hour LeaseStakeDivisor = 5 // stake = ceil(cost / 5), min 1 LeaseMaxDuration = 31536000 // maximum 365 days)// Genesis-pinned; the value below is the production default (#524).DefaultLeaseMinDuration = 60 // minimum 1 minute
[!IMPORTANT] Minimum duration is a network parameter
LeaseMinDuration is pinned by the genesis block, defaulting to the production value of 60 seconds. A network can pin a different value at genesis, so read the live value from GET /node (lease_timing.min_duration_secs) rather than assuming a compiled-in constant. LeaseMaxDuration is a protocol constant and is not genesis-pinned.
Multiplication uses safeMul() with overflow detection via bits.Mul64
Integer arithmetic
All calculations use uint64 -- no floating point
[!WARNING] Overflow protection
The cost calculation uses bits.Mul64 to detect overflow. If perHourMicro * hours (or the multiplier scaling) would exceed uint64 max, the lease is rejected. This prevents absurdly large resource requests from wrapping around.