Days-of-Cover Bidding: PDV’s Inventory‑Aware Amazon PPC Engine
The Problem
Manual Amazon PPC ignores inventory reality. Teams keep bidding when SKUs are low, bleeding rank and cash, then slam budgets when stock finally arrives—missing the window to scale. Spreadsheet pulls from SP-API and Ads console happen days late. Human rules drift, turnover resets tribal knowledge, and every OOS event nukes placement momentum you paid for.
The Engineering Solution
We wire n8n, Supabase, and Amazon’s SP-API/Advertising API into a single, inventory-aware control loop that changes bids and budgets before humans would notice.
-
Orchestration (n8n)
- Sub-workflows per marketplace and brand. Queue mode and rate-limit aware HTTP Request nodes for SP-API and Amazon Ads. Code nodes for math and guardrails. Binary Data for report files.
- Idempotent design: entity+date+rule_version keys prevent double writes. Exponential backoff on 429s.
-
Data Spine (Supabase)
- Tables: sku_map (asin, sku, campaign, ad_group, account_id), inventory_snapshots, sales_7d, ads_metrics, bid_actions, rule_sets.
- Days-of-cover (DoC) computed in SQL so it’s explainable: days_of_cover = GREATEST(1, on_hand / NULLIF(trailing_7d_units/7, 0)).
- Row-Level Security isolates each account_id. Triggers maintain last_known_state for instant rollback.
-
Inventory & Sales Ingest (SP-API)
- Pull FBA inventory summaries plus Sales & Traffic to get on_hand, reserved, inbound, and trailing units. Normalize to per-ASIN daily facts in Supabase.
-
Ads Ingest (Amazon Advertising API)
- Sync campaigns, ad groups, keywords/product ads, and search term performance. Map to ASINs via sku_map.
-
Decision Logic (n8n Code Node)
- DoC < 7: cut bids up to −50%, pause product ads on at-risk SKUs, block new keywords. If on_hand == 0, hard-pause related entities.
- 7 ≤ DoC < 14: moderate down-bid (−10% to −20%), protect rank with placement caps off.
- 14 ≤ DoC ≤ 45: hold bids; prune waste by applying negative terms from recent search queries.
- DoC > 45 and meets ROAS/ACOS target: scale (+15% to +30%) and open budgets up to ceiling in rule_sets.
- Safeties: campaign floors/ceilings, daily change caps, and cooling periods per entity.
-
Writebacks (Amazon Ads API)
- Batch updates with retries. All changes logged to Supabase.bid_actions with before/after, actor=n8n, reason=rule.
-
Optional Intelligence (Gemini)
- Summarize search term reports and propose negatives when DoC < 10 or when queries fail ROAS. Human-approve step in n8n keeps control with the operator.
-
Deployment & Reliability (GCP + Docker)
- Any custom adapters are containerized and deployed on Cloud Run (images in Artifact Registry). n8n calls them via HTTP for long-running or specialized tasks. Health checks and structured logs flow back into Supabase for audits.
-
Operator Visibility
- Supabase views: wasted_spend_avoided, doc_breach_events, bid_change_impact_7d. Filters by brand/marketplace. Every rule is editable—no black box.
The PDV Advantage
- Inventory-aware by design: We don’t just "optimize"—we synchronize bids and budgets with DoC so you never pay to advertise tomorrow’s stockout.
- One brain, one database: n8n orchestrates; Supabase persists decisions, proofs, and rollback. No vendor sprawl, no brittle spreadsheets.
- Operator-first controls: Floors, ceilings, cooling periods, and market-specific rules you can change in minutes—not sprints.
- Fast time-to-value: Typical brand integration in 10 business days. Pilot-ready without ripping out your current ad structure.
- Proven stack only: n8n, Supabase, Amazon Ads/SP-API, GCP Cloud Run/Docker, and Gemini—tools we deploy, not buzzwords.
Ready to stop lighting spend on low-stock SKUs and scale what’s actually on the shelf?
Book a 30‑minute working session. In 14 days, we’ll wire DoC‑based bidding into your catalog. If it doesn’t cut waste and stabilize rank, we roll it back—no hard feelings.