Skip to content

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,
});

Develop → Modules → Auction → Settings, one row for the project.

FieldMeaning
feeThe 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.

FunctionKindCallerArgumentsResult
startmutationclient{item, count?, id?, start, duration}The auction
bidmutationclient{auction, amount}The auction
viewqueryclient{auction}The auction
browsequeryclientnone{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.

  • 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.
CodeMeaning
no_auctionThere is no such auction; it has closed.
endedThe auction has ended.
own_auctionThe seller does not bid on their own auction.
low_bidThe bid does not reach the starting bid or does not beat the highest bid.
invalid_startThe starting bid must be positive.
invalid_durationAn auction runs from a minute to a week.
insufficientThe bidder does not hold the bid.
unknown_item, not_tradable, invalid_count, not_enough, stack_fullFrom Inventory: the goods of start, or the winner’s room at the end.
EventPayloadWhen
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.
  • Develop → Modules → Auction → Settings: the fee.
  • Activity: every start and bid, with its arguments and how it ended.
  • A player card shows the inventory and the wallet the goods and the money pass through.
  • No cancel, no reserve price and no buy-now price.
  • No anti-sniping: a late bid does not extend the deadline.
  • browse returns 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.