cpu_create_lot
List resource units for sale at a Hub in one transaction: ship goods from your cell, set a price per unit, and optionally cap the max sale fee. Returns a lot ID.
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 — cpu_cancel_lot is always fee-free and returns the escrow. 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 — and cpu_cancel_lot is always fee-free. |