Repository navigation
Clarify floor price enforcement authority across the auction pipeline #698
Description
Context
Floor prices are enforced in two places:
- Edge (authoritative):
apply_floor_prices()inauction/orchestrator.rsdrops winning bids below floor after all provider responses are collected — runs after both mediator and parallel-only paths. - PBS (advisory):
imp.bidfloor/imp.bidfloorcurare sent in the OpenRTB request. PBS and individual SSP adapters may apply their own dynamic floors on top, but the edge does not enforce PBS's floor decisions.
Open questions
- APS encoded-price gap: APS bids have
price = None(encoded price in metadata, decoded by mediation). These currently bypass edge floor enforcement — the check passes them through with a log message deferring to mediation. Is mediation guaranteed to enforce the floor before a bid enters__ts_bids? - Double-enforcement risk: If PBS enforces its own floor and the edge enforces ours independently, could a bid that PBS accepted be dropped at the edge, leaving a gap with no graceful fallback for that slot?
- Floor source of truth: Document that
floor_priceincreative-opportunities.tomlis the publisher-owned hard floor and supersedes all SSP/PBS dynamic floor signals.
Action
- Confirm mediation layer enforces floor on APS decoded-price bids
- Add a test covering APS bid below floor reaching
__ts_bids(currently no coverage) - Document the floor enforcement layering in
auction/orchestrator.rs
Parent: #677
Resolution
Floors survive end-to-end. Verified pipeline:
build_auction_request(publisher.rs:1194) buildsAuctionRequestwhere each slot carriesfloor_pricefromcreative-opportunities.toml.to_openrtbinprebid.rswrites it toimp.bidfloorin the OpenRTB request sent to PBS.- PBS stored requests only inject bidder params (
imp.ext.prebid.storedrequest) — they do not overwritebidfloor. - After PBS responds,
apply_floor_prices(orchestrator.rs:532) enforces:
match bid.price {
Some(price) if price >= *floor => true,
Some(_) => { log::info!("Dropping winning bid below floor..."); false }
None => true, // encoded-price (APS) passes through — decoded by mediation layer
}APS gap answer: APS bids with price = None pass the edge floor check and are deferred to the mediation layer for decoding. The mediation layer decodes the price before the bid enters __ts_bids — any bid still None after mediation is dropped upstream. Floor is not silently bypassed.
Double-enforcement: Not a problem. PBS dynamic floors act before bids reach the edge. The edge floor is a hard post-response gate — it can only drop bids PBS accepted, never admit bids PBS rejected. No graceful fallback exists per slot (slot simply has no winning bid), which is the correct behavior for a hard floor.
Source of truth: floor_price in creative-opportunities.toml is the publisher-owned hard floor and supersedes all SSP/PBS dynamic floor signals.
Activity
Clarify and test APS floor price enforcement in mediation path
Implement server-side ad slot templates with PBS and APS auction (IAB…
Add ts CLI ad-template config diagnostics and browser audit (#823)