Auction
A player puts tradable items up for auction with a starting bid and a duration from a minute to a week. Other players bid, and every bid is paid at once, so an outbid player gets the money back the moment someone bids higher. When the time is up the winner receives the goods and the seller the winning bid minus the fee. Requires Inventory.
await rudder.auction.start({ item: 'iron-sword', start: { asset: 'gold', amount: 50 }, duration: 3600,});Settings
Section titled “Settings”Develop → Modules → Auction → Settings, one row for the project.
| Field | Meaning |
|---|---|
fee | The percent of the winning bid the platform keeps, 0 to 100, 5 by default. |
The winner pays the bid in full; the seller receives the bid minus the fee.
Functions
Section titled “Functions”| Function | Kind | Caller | Arguments | Result |
|---|---|---|---|---|
start | mutation | client | {item, count?, id?, start, duration} | The auction |
bid | mutation | client | {auction, amount} | The auction |
view | query | client | {auction} | The auction |
browse | query | client | none | {auctions}, at most 50 running auctions |
start takes the goods out of the seller’s inventory and holds them for the auction. count is
how many of a stackable item (1 by default); id names one unique piece instead of item;
start is the amount and asset bids are made in; duration is in seconds, from 60 to 604800.
An auction has auction (its id), seller, goods, start, bid, bidder and endsAt;
bid and bidder are empty until the first bid. The id is the only handle of an auction: the
module does not list the auctions of a player.
How an auction runs
Section titled “How an auction runs”- A bid must reach the starting bid and beat the highest bid. There is no minimum step, so one unit more is a valid bid.
- Every bid is paid when it is made. The previous highest bidder is refunded at once, and a player may outbid themselves: the old bid comes back and the new one is charged.
- The seller does not bid on their own auction and cannot cancel it: the goods stay held until the auction closes.
- A bid in the last second does not extend the auction.
- At the deadline the winner receives the goods and the seller the money. An auction nobody bid on returns the goods to the seller.
- If the winner’s inventory is full the goods wait until there is room. Keep room for the winners of the items you auction.
Errors
Section titled “Errors”| Code | Meaning |
|---|---|
no_auction | There is no such auction; it has closed. |
ended | The auction has ended. |
own_auction | The seller does not bid on their own auction. |
low_bid | The bid does not reach the starting bid or does not beat the highest bid. |
invalid_start | The starting bid must be positive. |
invalid_duration | An auction runs from a minute to a week. |
insufficient | The bidder does not hold the bid. |
unknown_item, not_tradable, invalid_count, not_enough, stack_full | From Inventory: the goods of start, or the winner’s room at the end. |
Events
Section titled “Events”| Event | Payload | When |
|---|---|---|
outbid | {auction, money} | The highest bidder is outbid; the money is the bid that comes back. |
won | {auction, goods} | The auction closes with a bid; the goods go to the winner. |
paid | {auction, money} | The auction closes with a bid; the money goes to the seller. |
unsold | {auction, goods} | The auction closes without a bid; the goods go back to the seller. |
In the Dashboard
Section titled “In the Dashboard”- Develop → Modules → Auction → Settings: the fee.
- Activity: every
startandbid, with its arguments and how it ended. - A player card shows the inventory and the wallet the goods and the money pass through.
Limits
Section titled “Limits”- No cancel, no reserve price and no buy-now price.
- No anti-sniping: a late bid does not extend the deadline.
browsereturns at most 50 running auctions. With more running at once a player may not find an auction in the list, though its id still opens it.- The goods sit outside the inventory for the whole auction, and the money of the highest bid is gone from the bidder’s wallet until the auction ends. A long auction on a small stack limit is the safe pattern.