Skip to content

Switch price optimizer to get_media_buy_snapshot when available #253

@bokelley

Description

@bokelley

Context

The price optimization poller (src/services/price-optimization-poller.ts) currently uses adapter.getMediaBuyDelivery() to fetch delivery metrics for pacing decisions. This works for the managed adapter (synchronous, simulated data) but will be suboptimal for real upstream platforms where get_media_buy_delivery has 4+ hour reporting lag.

Depends on: adcontextprotocol/adcp#1160 (get_media_buy_snapshot)

When get_media_buy_snapshot is available

  1. Add getMediaBuySnapshot() to PlatformAdapter interface
  2. Update price-optimization-poller.ts to prefer getMediaBuySnapshot() over getMediaBuyDelivery()
  3. Use staleness_seconds from the snapshot response to inform the warmup check — if staleness_seconds is low and impressions are zero, that's a real signal to step up price
  4. Fall back to getMediaBuyDelivery() for adapters that don't implement snapshot

Warmup short-circuit (build now or later)

Separate from the snapshot endpoint, the pacing calculator should detect zero delivery after the reporting lag window and step up more aggressively (to p75) rather than waiting for a full 24-hour window. This can be built against the current getMediaBuyDelivery() and will work better once snapshots are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions