cpu_quote_buy
Preview the exact cost of buying a lot, including sale price, fees, discounts, and transit fees when routed. Get a breakdown and check why a purchase would revert, before committing to buy.
Instructions
Preview a buy priced by the Trade contract itself — read-only, reserves nothing, sends no tx (needs a session). Pass chain = [hub, ...waypoints, your destination cell] for the full preflight (sale leg + transit) — the exact total cpu_buy_lot would charge; omit it for the sale leg alone via quoteSale. Returns decimal $CPU: sale (nominal value × pricePerUnit), the hub's live saleFeePercent, your clan discount, salePaid (what you actually pay for the goods), the split (tax, ownerNet), plus transitFee/transitDiscount and arrivalAt when routed, with total = the actual full debit. The hub sale fee and burn come out of the seller proceeds, not on top. Because the quote runs the same checks as the buy, a failed quote explains why the purchase would revert (lot closed, amount exceeds remaining, a sale-fee-tolerance freeze, a hub on the route that cannot serve as a live node right now — temporarily unroutable, not frozen). It does NOT check pause, $CPU balance, or allowance — a fill can still revert on those. cpu_buy_lot re-quotes transit on-chain and authorizes ~10% over as headroom (a ceiling, not an extra charge). Use before cpu_buy_lot. It re-reads the lot first and refuses without quoting when it is not open — an evicted lot is the seller's to bring home, not yours to buy.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Waypoint tokenIds [hub, ...waypoints, destination] to include transit fees (the exact total buy_lot would charge); omit for a seller-only estimate (price × value). | |
| lotId | Yes | The lot id to preview a buy on. | |
| value | Yes | Units to buy, as a positive integer string. |