pages / example / market_match
canister coord://offchain/genie/program/market_match@v1/781cb2d53ac4a39b · v1 · artifact root 0x781cb2d53ac4a39b21dfe55cd4d833ef3cac776b59248fc42fc1db9b7a41cd9c · previous none (first version) · superroot at publish not sealed yet
sealed cases that reached it: 0 — sealed cases that reached this word (the store counts, never reads)
market match (a .genie program) in the studio: 7 symptoms, 7 fixes
// _MARKET_MATCH_v1_ (owner 2026-10-27: "adapt the genie in our setting here to define the reliable market matching"). The matcher of the // one market protocol (taifoon-agents packages/resale/runtime/automatch-edges.mjs) computes the facts of one (demand, best offer) pair — // the gates (class fit, the buyer's model, the price at our 20 % over the seller, resale terms, a payee, a route card), whether the buyers' // venue costs money to list on, whether an edge is already quoted — and walks THIS machine with them: from each state the first move whose // `when` holds is taken, so the order of the moves is the order of precedence. The final state is the match's one action; its `say` is // what the action means. The machine decides; the runtime only measures. Nothing here posts, signs or pays. genie market_match v1 about "Match one outside buyer's demand to the best offer of the book and end in exactly one action: sell, reach, write the edge, held, classify, supply, priced out or fix" use venue x402-base agent book_match is "one observed demand of the market protocol and its best offer, from observed to its one action" states observed classified gated quoted sell reach write_edge held classify supply priced_out fix start observed final sell reach write_edge held classify supply priced_out fix read GET /v1/match/offers as offers // the buyers' venue first: listing there costs money before a buyer paid (market-protocol enter, _ZERO_DOLLAR_HELD_v1_) move observed -> held when venue.held == true // a class only the model proposed never writes an edge: a source must name it move observed -> classify when class.from == "lm" move observed -> classified hop classify effect read // the gates: every one passes, or the first that fails names the action move classified -> gated when gates.ok == true move classified -> supply when gate.failed in "model,route_card" move classified -> priced_out when gate.failed == "price" and price.over == true move classified -> fix // passing: an edge already quoted, our own offer, or an onboardable seller move gated -> quoted when edge.counted == true hop listed venue x402-base op POST /v1/exchanges/auto effect record move gated -> reach when offer.ours == true and demand.bound == true move gated -> sell when offer.ours == true move gated -> write_edge when auto.eligible == true move gated -> fix // a quoted edge sells on the buyers' venue; a buyer bound to its supplier is reached with the offer move quoted -> reach when demand.bound == true move quoted -> sell refuse no_facts "a match is walked with its facts (venue.held, class.from, gates.ok, gate.failed, price.over, edge.counted, offer.ours, demand.bound, auto.eligible)" say observed "An outside buyer's demand was read from its venue" say classified "The demand's class was named by its source and the best offer of the book gated against it" say gated "Every gate passes: class, the buyer's model, our price under theirs, resale terms, a payee" say quoted "An edge is quoted for it: the buyers can buy through it" say sell "Sell: the edge or our own offer serves the buyers on their venue" say reach "Reach: the buyers are bound to a seller host; offer that host our supply (a draft from info@taifoon.io, the owner sends it)" say write_edge "Write the edge: POST /v1/exchanges/auto on the next pass, within the day's cap" say held "Held: listing on the buyers' venue costs money before a buyer paid (zero-dollar rule)" say classify "Classify: the class was proposed by the model only; a source must name it before an edge is written" say supply "Supply: no resellable offer of the model the buyers name, or no route card of the gateway serves it" say priced_out "Priced out: our price, the seller's price plus 20 %, is over what the buyers pay" say fix "Fix: the gate that failed names the file that closes it" next observed classified "The source names the class; the book's offers of that class are quoted and gated" next classified gated "The gates decide; the model never promotes a candidate a gate refused" next gated quoted "An onboardable seller or our own supply gets its edge" knowledge symptom "a match passes every gate but no edge is written" caused_by "the seller's door is not one POST /v1/exchanges/auto onboards (mcp and a2a only)" fixed_by "the action is fix with the door named; our own supply is sell or reach instead" symptom "a buyer of one model is matched to another model" caused_by "the match was made on the class alone" fixed_by "the model gate: a demand that names exact models takes only an offer of one of them" symptom "the next route is one nobody may build" caused_by "listing on its venue costs a stake, a bond or a fee" fixed_by "the venue is held by the zero-dollar rule and leaves next"