Auction first price shading

From lyndonkl/claude · View interactive version

Auction first price shading is an AI agent skill from the GitHub repository lyndonkl/claude. Computes the optimal shaded bid for a first-price sealed-bid auction given a true private value, an estimate of the number of competing bidders N, and a value-distribution assumption. Implements the `(N-1)/N` equilibrium shading rule for uniform private values, adjusts for log-normal or empirical va

How to use this skill

Skill file

Auction First-Price Shading

Table of Contents

Example

Scenario: Domain-neutral sealed-bid auction. A bidder must submit a blind bid for an item whose private value to them is 28 units of budget currency. Six other bidders are expected to compete. Values across bidders look roughly uniform. The bidder is mildly risk-averse (0.2) and has 89 units of budget remaining.

Inputs:

Core computation:

shade_fraction_base = (N - 1) / N = 5 / 6 = 0.833
shaded_bid_base     = true_value x shade_fraction_base = 28 x 0.833 = 23.33

Risk-aversion adjustment (raise the bid toward true value to boost win probability):

shade_fraction' = shade + risk_aversion x (1 - shade) x 0.4
                = 0.833 + 0.2 x (1 - 0.833) x 0.4
                = 0.833 + 0.0133
                = 0.847
shaded_bid'     = 28 x 0.847 = 23.72

Budget + safety cap:

cap = min(shaded_bid', 0.9 x true_value, budget_remaining)
    = min(23.72, 25.2, 89)
    = 23.72  -> round to 24

Output:

Workflow

Copy this checklist and track progress:

Auction Shading Progress:
- [ ] Step 1: Validate inputs (true_value > 0, 1 <= N <= 12, distribution known)
- [ ] Step 2: Compute base shade from (N-1)/N
- [ ] Step 3: Apply distribution adjustment (uniform / log-normal / empirical)
- [ ] Step 4: Apply risk-aversion adjustment
- [ ] Step 5: Apply budget and safety caps
- [ ] Step 6: Emit shaded_bid, shade_fraction, rationale, assumptions_flagged

Step 1: Validate inputs

Reject or flag bad inputs before computing. See resources/template.md for the full input contract.

Step 2: Compute base shade from (N-1)/N

For risk-neutral bidders drawing values from a uniform distribution on [0, v_max], the symmetric Bayes-Nash equilibrium bidding strategy is b(v) = v x (N-1)/N. See resources/methodology.md for the derivation.

Step 3: Apply distribution adjustment

Uniform values give the clean (N-1)/N rule. Real-world value distributions are often clustered (log-normal) or empirically lumpy. See resources/methodology.md.

Step 4: Apply risk-aversion adjustment

Risk-averse bidders accept a smaller expected surplus in exchange for a higher win probability. They bid closer to true value (shade less). See resources/methodology.md.

Step 5: Apply budget and safety caps

The final bid is clamped three ways:

Step 6: Emit outputs

Return the four-field output:

Validate using resources/evaluators/rubric_auction_first_price_shading.json. Minimum standard: weighted score of 3.5 or above.

Common Patterns

Pattern 1: Generic sealed-bid auction (uniform values, risk-neutral)

Pattern 2: Clustered values (log-normal or empirical)

Pattern 3: Risk-averse bidder

Pattern 4: Budget-constrained bidder (corner solution)

Guardrails

  1. (N-1)/N is a symmetric-equilibrium result, not a universal truth. It assumes all bidders use the same bidding function and draw values from the same distribution. If one bidder systematically overbids, optimal response shifts. Flag in assumptions_flagged whenever the user has signals that rivals are not symmetric.
  1. N is an estimate, not a datum. Most callers do not know N exactly. Small errors in N matter little (the shade function is smooth), but mistaking N=2 for N=6 changes the bid from 50 percent to 83 percent of value. Always flag n_bidders_estimate as an assumption.
  1. Clamp N to [1, 12]. Values below 1 are nonsense. Values above 12 rarely improve the bid materially (shade at N=12 is 0.917 vs. 0.875 at N=8) and are usually overconfident. Clamping protects against upstream errors.
  1. Never bid above 0.9 x true_value. This is a hard cap. Even with heavy risk aversion or very large N, crossing 0.9 reduces expected surplus below the point where shading has economic value.
  1. Never bid above budget_remaining. The shaded bid is clamped to available budget. If the clamp binds, the output flag must say so — the downstream consumer may prefer to skip rather than bid the full budget on a single item.
  1. N = 1 is a corner case. With no competition, the dominant strategy is to bid the minimum increment (often 1 unit, sometimes 0). The skill returns shaded_bid = max(1, floor_bid) and flags "no competition — minimum bid wins." Callers supplying their own floor should pass it explicitly; this skill defaults to 1.
  1. Risk aversion does not dominate the math. The adjustment shade' = shade + risk_aversion x (1 - shade) x 0.4 is bounded by the 0.4 scaling factor. The final bid is still capped at 0.9 x true_value. Do not let a risk-averse user bid true value.
  1. This skill is domain-neutral. It knows nothing about baseball, prediction markets, or procurement. Downstream consumers (e.g., mlb-faab-sizer for fantasy baseball, or a procurement agent for sealed supplier bids) wrap this skill with domain-specific value estimation, urgency multipliers, and winner's-curse haircuts.

Quick Reference

Key formulas:

Uniform-value risk-neutral equilibrium:
  shade_fraction = (N - 1) / N
  shaded_bid     = true_value x shade_fraction

Log-normal / empirical-cluster adjustment:
  shade_fraction_adj = 1 - 1 / (N x spread)     # spread >= 1 (CoV proxy)
  default spread = 1.5

Risk-aversion adjustment:
  shade_fraction_ra = shade + risk_aversion x (1 - shade) x 0.4

Final bid (all caps applied):
  shaded_bid = min(true_value x shade_fraction_final,
                   0.9 x true_value,
                   budget_remaining)

Shade table (uniform, risk-neutral):

| N | shade_fraction | Example: bid on true_value = 100 |

|---|----------------|-----------------------------------|

| 1 | 0.00 | 1 (minimum increment) |

| 2 | 0.50 | 50 |

| 3 | 0.67 | 67 |

| 4 | 0.75 | 75 |

| 5 | 0.80 | 80 |

| 6 | 0.83 | 83 |

| 8 | 0.875 | 87 (then capped at 90) |

| 10 | 0.90 | 90 (exactly at cap) |

| 12 | 0.917 | 90 (cap binds) |

Input contract:

Output contract:

Key resources:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.