asgard-ai-platform/algo-ad-vcg
Implement VCG mechanism for incentive-compatible ad slot allocation with truthful bidding. Use this skill when the user needs to design a truthful auction mechanism, compute externality-based payments, or understand why platforms may prefer GSP over VCG — even if they say 'truthful auction design', 'VCG payments', or 'incentive-compatible mechanism'.
npx skills add https://github.com/asgard-ai-platform/skills --skill algo-ad-vcg
VCG allocates slots to maximize total social welfare and charges each winner the externality they impose on others. Truthful bidding is a dominant strategy. Runs in O(N log N + K × N) where N=bidders, K=slots.
Trigger conditions:
When NOT to use:
IRON LAW: VCG Guarantees Truthful Bidding BUT May Not Maximize Revenue
VCG payments are based on externality (harm to others), not competition.
This makes VCG payments often LOWER than GSP payments. Platforms
choose GSP because it typically generates higher revenue despite
strategic bidding. Truthfulness has a revenue cost.
Collect true valuations per click for each advertiser and CTR for each slot position. Valuations must be non-negative.
Gate: All valuations non-negative, slot CTRs decreasing by position.
Check: all payments ≤ valuations (individual rationality), truthful bidding is dominant strategy, allocation maximizes welfare.
Gate: IR satisfied, welfare is optimal.
Return allocation with VCG payments and welfare metrics.
{
"allocation": [{"advertiser": "A", "slot": 1, "vcg_payment_per_click": 1.80, "total_welfare_contribution": 500}],
"metadata": {"total_welfare": 1500, "total_revenue": 420, "mechanism": "vcg"}
}
Input: 3 bidders values [10, 8, 2], 2 slots CTRs [0.5, 0.3]
Expected: Allocation: Bidder1→Slot1, Bidder2→Slot2. VCG payments: Bidder1 = 8×(0.5-0.3)+2×0.3 = 2.20, Bidder2 = 2×0.3 = 0.60.
| Input | Expected | Why |
|-------|----------|-----|
| All same valuation | All pay 0 | No externality imposed — no marginal harm |
| One bidder, one slot | Pays 0 | No other bidder harmed |
| Bidders < slots | All win, all pay 0 | No competition = no externality |
references/revenue-comparison.mdreferences/combinatorial-vcg.mdTake asgard-ai-platform/algo-ad-vcg from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.