cpu_create_lot
Create an on-chain sale lot at a Hub by shipping resources from your source cell, setting a per-unit price, and choosing the maximum sale fee you accept. Buyers can buy once escrow arrives.
Instructions
List units of a resource for sale at a Hub, on-chain (needs a session — cpu_authenticate first). One atomic tx: ships the goods from your source cell to the listing Hub (chain = [source, ...waypoints, hub]) and opens a lot at pricePerUnit $CPU, plus gas. A route through a foreign Hub costs a $CPU transit fee (auto-approved once); over only your own cells it is free. The hub owner charges a sale fee on every sale, carved out of the seller proceeds (the buyer still pays exactly price × value). maxSaleFeePercent is your tolerance: the highest rate you accept — omit it to lock in the live rate at listing (read on-chain). The hub settles its live rate each sale (never above your tolerance); if it later rises above the tolerance the lot freezes and buys revert until the hub lowers it — you can send the unsold remainder home at any time, which owes no sale fee but still owes transit for the route you pick. Read the live window, your live-lot count and any evicted remainder you owe with cpu_get_lot_terms first: this tool re-reads the same terms and refuses before any approval or transaction. The lot is DELIVERING and becomes buyable (OPEN) only after its escrow arrives — call cpu_finalize_delivery on the returned deliveryId (or wait). Returns the lotId and the locked-in maxSaleFeePercent; track with cpu_list_my_lots / cpu_get_lot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | Waypoint tokenIds [source, ...waypoints, hub] — first node is your source cell, last is the listing Hub. A route through a foreign Hub is paid in $CPU. Scout waypoints with cpu_next_hops. | |
| value | Yes | Units to list, as a positive integer string. | |
| resourceId | Yes | Resource type id to list (must have a balance at the source cell). | |
| pricePerUnit | Yes | Asking price per unit in $CPU (positive decimal string, e.g. "0.5"). Must be > 0. | |
| maxSaleFeePercent | No | Optional seller tolerance: the highest sale-fee percent (0–100) you accept the hub charging on each sale. Omit to lock in the hub's live rate at listing time as the tolerance. The hub settles its live rate on every sale (never more than the tolerance); if the owner later raises it above the tolerance the lot freezes — buys revert until the rate drops back to the tolerance or below. Sending a frozen lot home costs no sale fee, but still costs transit for the route you choose. |