Skip to content

x/settlement — Settlement module

The x/settlement module turns metered usage into money. Provider daemons collect per-workload resource metrics on an hourly cadence, batch them into signed usage records, and submit them on-chain; the module validates each record against its lease, prices it by the lease terms, and converts it into a billable line item.

What providers report, tenants can contest; what survives the dispute window is what escrow releases — billing becomes auditable state instead of an invoice exchanged off-chain.

Provider daemons collect per-workload resource metrics on an hourly cadence and submit them on-chain as signed usage records (MsgRecordUsage). The module validates records against their leases and converts them into billable line items priced by the lease terms.

Every reported record sits in a 24-hour dispute window during which either party can raise corrections — anomaly detection on the provider side flags outliers before they ever reach the chain. After the window closes, line items settle against lease escrow and the agreed funds transfer to the provider under the governed fee policy. Reconciliation against platform metrics (default every 6 hours) cross-checks reported usage.

Metering and billing are where cloud customers get hurt and providers get stiffed. Making settlement a consensus function — signed records, public dispute window, automatic escrow release — replaces invoice trust with protocol guarantees for both sides.

ConceptDefinition
Usage recordA signed, per-lease report of metered resource consumption for a collection period.
Dispute windowThe 24-hour period after reporting during which corrections can be raised.
Line itemA priced billing entry derived from a validated usage record.
  1. Collect — Daemons meter hourly. Per-workload resource metrics gathered on schedule and reconciled against platform metrics every 6 hours by default.
  2. Submit — Signed records go on-chain. Batched usage records are validated against their leases and priced by lease terms into billable line items.
  3. Dispute — The window opens. Twenty-four hours for corrections from either party; fraud and support paths engage on escalation.
  4. Release — Escrow pays out. Cleared items transfer the agreed funds to the provider — full amount, no platform deduction.
MessagePurpose
Escrow lifecycleThe lease-escrow accounts settlement pays from, refunds, and disputes.
MsgCreateEscrowOpens a lease escrow account.
MsgActivateEscrowActivates a funded escrow account for use.
MsgReleaseEscrowReleases escrowed funds per the settlement outcome.
MsgRefundEscrowReturns escrowed funds to the tenant.
MsgDisputeEscrowPlaces an escrow account into dispute.
Usage & settlementMetered usage validated into billable line items.
MsgRecordUsageSubmits a signed, per-lease usage record on-chain.
MsgAcknowledgeUsageAcknowledges a submitted usage record.
MsgSettleOrderSettles cleared billing for an order against escrow.
RewardsDistribution and claiming of marketplace rewards.
MsgDistributeRewardsDistributes accrued rewards to their recipients.
MsgClaimRewardsClaims accrued rewards.
Financial casesOn-chain resolution of disputes over payments.
MsgOpenFinancialCaseOpens a financial case over a disputed payment.
MsgAddFinancialClaimAdds a claim to an open financial case.
MsgSubmitFinancialCaseForReviewSubmits a financial case for review.
MsgEscalateFinancialCaseEscalates a financial case for further review.
MsgResolveFinancialCaseRecords the resolution of a financial case.
MsgAppealFinancialCaseAppeals a financial case resolution.
MsgCancelFinancialCaseCancels a financial case.
MsgFinalizeFinancialCaseFinalizes a resolved financial case.
Fiat conversionObservations supporting fiat-referenced pricing.
MsgRecordFiatConversionObservationRecords an observed fiat conversion observation.
ParamsGovernance-only configuration.
MsgUpdateParamsGovernance-only update of module parameters.
QueryPurpose
Settlement / SettlementsByOrderSettlement records individually and by order.
UsageRecord / UsageRecordsByOrderUsage records individually and by order.
UsageSummaryAggregated usage across recorded periods.
UsageStreamStateThe current state of a usage stream.
Escrow / EscrowsByOrder / EscrowsByStateEscrow records individually, by order, or by state.
Payout / PayoutsByProviderPayouts individually and by provider.
FiatConversion / FiatConversionsByProviderFiat conversion observations individually and by provider.
FiatPayoutPreferenceA provider’s preferred fiat payout configuration.
FinancialCase / FinancialCases / FinancialCaseBySubjectFinancial cases individually, as a list, and by subject.
FinancialCaseLineageThe lineage trail of a financial case.
ClaimableRewards / RewardDistribution / RewardHistory / RewardsByEpochReward state — claimable balances, distributions, history, and per-epoch totals.
ParamsCurrent module parameters.
ModuleHow they interact
x/escrowSettled line items draw provider payouts from lease escrow.
x/takeThe governed settlement-fee policy is applied at payout time.
x/marketUsage records are validated against the lease they bill.
x/fraudDisputed or anomalous usage escalates before settlement completes.
x/oraclePrice feeds inform fiat-referenced pricing where leases use it.

A signed, per-lease report of metered resource consumption for a collection period — the atomic unit of marketplace billing.

A priced billing entry derived from a validated usage record — the thing escrow actually releases against.

Provider-side anomaly detection flags outliers before submission, reconciliation cross-checks reported usage every 6 hours by default, and the 24-hour dispute window gives both parties a final correction pass. See Escrow & settlement explained.