Skip to content

SuperInstance/bid-engine-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

bid-engine-rs

<<<<<<< HEAD Rust port of bid-engine — auction engine with English, Dutch, Sealed-bid, and Vickrey auctions.

Features

  • English auction — ascending open-cry
  • Dutch auction — descending price, first bidder wins
  • Sealed-bid auction — first-price sealed-bid
  • Vickrey auction — second-price sealed-bid (incentive-compatible)
  • BidEvaluator — scoring, ranking, filtering bids
  • ResourceAllocator — single-winner, proportional, fixed-bundle allocation
  • AuctionHistory — append-only log with leaderboard and revenue tracking ======= Rust port of bid-engine — auction resolution engine.

Features

  • First-price auction: winner pays their bid
  • Second-price / Vickrey auction: winner pays second-highest bid
  • Multi-unit auction: uniform price for N items
  • Reserve price filtering
  • Bid statistics: mean, median, std dev, spread
  • Bid shading detection: identify suspiciously low bids

318a237 (Initial Rust port: auction bid engine)

Usage

<<<<<<< HEAD
use bid_engine::{Auction, AuctionType, Bid};

let mut auction = Auction::new(AuctionType::Vickrey).with_reserve(50.0);
auction.open().unwrap();
auction.place_bid(Bid::new("alice", 100.0)).unwrap();
auction.place_bid(Bid::new("bob", 150.0)).unwrap();
auction.close().unwrap();
let result = auction.settle().unwrap();
// Bob wins, pays Alice's bid (second price) = 100
assert_eq!(result.winner.as_deref(), Some("bob"));
assert_eq!(result.winning_amount, 100.0);
=======
use bid_engine::{resolve_auction, AuctionType, Bid};

let bids = vec![
    Bid::new(1, 100.0),
    Bid::new(2, 150.0),
    Bid::new(3, 120.0),
];

let result = resolve_auction(&bids, AuctionType::SecondPrice);
assert_eq!(result.winner_id, Some(2)); // highest bidder wins
assert!((result.clearing_price - 120.0).abs() < 0.01); // pays second price
>>>>>>> 318a237 (Initial Rust port: auction bid engine)

License

MIT

About

Auction bid engine — first-price, second-price, multi-unit, bid shading detection

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages