daitchain

x/compute_market Real (skeleton)

Reverse Dutch auction marketplace. Five logical sub-areas live in this single module: deployment, market, provider, audit, escrow. Block-by-block streaming escrow with auto-close on funds exhaustion.

State machine

Deployment {active, closed}
    Group {open, ordered, matched, paused, closed}
        Bid {open, active, lost, closed}
            Lease {active, insufficient_funds, closed}

Genesis params

ParamDefaultNotes
bid_duration_blocks30 (~30s)auction window length
bid_min_deposit100 DAITmandatory DDoS guard, NOT optional
lease_min_deposit50 DAITtenant deployment escrow floor
take_rate_bps100 (1.00%)protocol fee per streamed block
auditor_whitelistgenesis-suppliedfoundation, csuite-operated, community DAO

Auction matching

The matcher iterates open bids for a group, applies the deployment's attribute filter (audited attributes only), then selects the lowest price_uDAIT_per_block. Ties break by earliest created_at_height, then by lexicographic provider_addr. The full path lives in keeper/auction.go and is real today.

Streaming escrow

keeper/escrow.go implements per-block accounting. On every EndBlocker tick:

spent_this_block = lease.price_uDAIT_per_block
take            = spent_this_block * Params.take_rate_bps / 10000
to_provider     = spent_this_block - take
lease.spent_amount += spent_this_block
lease.escrow_balance -= spent_this_block

if lease.escrow_balance < lease.price_uDAIT_per_block:
    lease.status = INSUFFICIENT_FUNDS
    schedule auto-close at next block

Audited attributes

Tenants don't trust providers' self-claimed attributes. Instead, providers register attributes; whitelisted auditors attest to those attributes (region: na-east, gpu_class: hopper-or-newer, etc.). The matcher filters only on audited entries.

Messages (13)

// Deployment side
MsgCreateDeployment       MsgUpdateDeployment       MsgCloseDeployment
MsgCreateGroup            MsgPauseGroup             MsgUnpauseGroup

// Bid / lease side
MsgCreateBid              MsgCloseBid
MsgCreateLease            MsgCloseLease

// Provider + audit side
MsgCreateProvider         MsgAuditAttribute
MsgUpdateParams           // gov-only

What's wired today

Real KV store layout (12 prefixes, sortable big-endian id keys, owner indexes), ID counters, iterators (by-owner, by-group, attribute index), ValidateBasic for all 13 msgs, Params.Validate with positive bid_min_deposit guard, the auction matcher, escrow streaming math, genesis init/export.

Phase 1 Bank movements (deposits, refunds, lease settlement payouts), pagination over the existing iterators, StakingTiersKeeper.HasTierForProvider tier check on MsgCreateProvider, typed events.

See also