Workspace IndexMath › Day 12

Auctions: First- and Second-Price, and Revenue Equivalence TODO

Math · Day 12 / 52 · August — Game Theory & Protocol Economics (Day 11-17)

Concept

In a first-price sealed-bid auction, the highest bidder wins and pays their own bid; in a second-price (Vickrey) auction, the highest bidder wins but pays the second-highest bid. Under private-value assumptions, bidding your true value is the dominant strategy in a second-price auction, so bidders never need to guess at their competitors' strategies. In a first-price auction, by contrast, the equilibrium strategy is to shade your bid below your value, and how much you shade depends on the number of competitors and the value distribution. The revenue equivalence theorem says that when values are independent and identically distributed, bidders are risk-neutral, and both formats share the same allocation rule (highest value wins) and the same expected payoff for the lowest possible type, the seller's expected revenue is identical between the two. So the real difference between formats shows up not in revenue but in strategic complexity and robustness when those assumptions break.

Many points in protocol design — block-space allocation, MEV bidding, token sales, liquidation auctions — are auctions in substance, and the format choice changes participant strategy and the potential for collusion or manipulation.

Code & Formula

# 경매(1·2위가격, 수입동등정리) — 균등분포 가치를 가진 입찰자들로 1위가격/2위가격 경매를
# 몬테카를로 시뮬레이션해, 판매자 기대 수입이 이론대로 수렴하는지 확인.

import random

random.seed(42)
N_BIDDERS = 4
N_TRIALS = 200_000

def second_price_bid(value):
    return value   # 2위가격 경매: 자기 가치 그대로 입찰이 우월전략

def first_price_bid(value, n):
    # 균등분포[0,1], 위험중립 n명 대칭 균형 shading: b(v) = v * (n-1)/n
    return value * (n - 1) / n

total_revenue_2nd = 0.0
total_revenue_1st = 0.0

for _ in range(N_TRIALS):
    values = [random.random() for _ in range(N_BIDDERS)]

    # 2위가격: 최고 낙찰, 지불액 = 두 번째로 높은 "입찰액"(=가치, 우월전략이므로) 이 낙찰자가 냄.
    sorted_vals = sorted(values, reverse=True)
    revenue_2nd = second_price_bid(sorted_vals[1])
    total_revenue_2nd += revenue_2nd

    # 1위가격: 각자 shading 한 입찰액 중 최고가가 낙찰, 그 금액을 지불.
    bids = [first_price_bid(v, N_BIDDERS) for v in values]
    revenue_1st = max(bids)
    total_revenue_1st += revenue_1st

avg_2nd = total_revenue_2nd / N_TRIALS
avg_1st = total_revenue_1st / N_TRIALS

print(f"입찰자 수 = {N_BIDDERS}, 시행 횟수 = {N_TRIALS:,}")
print(f"2위가격 경매 판매자 평균 수입: {avg_2nd:.4f}")
print(f"1위가격 경매 판매자 평균 수입: {avg_1st:.4f}")
print(f"차이: {abs(avg_2nd - avg_1st):.4f}  (수입동등정리대로 서로 근접해야 함)")

# 이론값: n명 균등분포[0,1]에서 최고 두 순서통계량의 기댓값 = (n-1)/(n+1)
theoretical = (N_BIDDERS - 1) / (N_BIDDERS + 1)
print(f"이론적 기대 수입 (n-1)/(n+1) = {theoretical:.4f}")

Exercise

Simulate first-price and second-price auctions by Monte Carlo for n bidders with uniformly distributed values, and check whether the seller's expected revenue actually converges between the two.

Practical Connection

When looking at block-builder auctions or priority-fee structures, identifying which parts resemble first-price and which resemble second-price lets you predict much more precisely why participants bid the way they do.

If you study this on a given day, add a note link and a ✅ to this line in the source curriculum (docs/knowledge/math-50-curriculum.md) and this spot will lead straight to the note body. You can also write directly on this page — but regenerating overwrites it, so it's safer to keep anything you want to save as markdown under docs/algorithms/.


한국어

경매(1·2위가격, 수입동등정리) TODO

Math · Day 12 / 52 · 8월 — 게임이론·프로토콜 경제학 (Day 11–17)

개념

1위 가격 밀봉 경매는 최고 입찰자가 낙찰받고 자기 입찰액을 지불하는 방식이고, 2위 가격(비크리) 경매는 최고 입찰자가 낙찰받되 두 번째로 높은 입찰액을 지불하는 방식이다. 사적 가치 가정 아래 2위 가격 경매에서는 자기 가치를 그대로 쓰는 것이 우월전략이라, 입찰자가 경쟁자의 전략을 추측할 필요가 없다. 반면 1위 가격 경매에서는 가치보다 낮게 쓰는 shading이 균형 전략이며, 얼마나 깎을지는 경쟁자 수와 가치 분포에 의존한다. 수입동등정리는 가치가 독립적이고 동일한 분포를 따르며 입찰자가 위험 중립적이고, 두 형식이 같은 배분 규칙(가장 높은 가치가 낙찰)과 같은 최저 유형의 기대 이득을 가질 때, 판매자의 기대 수입이 동일하다는 결과다. 따라서 형식 선택의 실질적 차이는 수입이 아니라 전략적 복잡성과 가정이 깨졌을 때의 강건성에서 나타난다.

블록 공간 배분, MEV 입찰, 토큰 세일, 청산 경매 등 프로토콜 설계의 여러 지점이 사실상 경매이고, 형식 선택이 참여자 전략과 담합·조작 가능성을 바꾼다.

코드 · 수식

# 경매(1·2위가격, 수입동등정리) — 균등분포 가치를 가진 입찰자들로 1위가격/2위가격 경매를
# 몬테카를로 시뮬레이션해, 판매자 기대 수입이 이론대로 수렴하는지 확인.

import random

random.seed(42)
N_BIDDERS = 4
N_TRIALS = 200_000

def second_price_bid(value):
    return value   # 2위가격 경매: 자기 가치 그대로 입찰이 우월전략

def first_price_bid(value, n):
    # 균등분포[0,1], 위험중립 n명 대칭 균형 shading: b(v) = v * (n-1)/n
    return value * (n - 1) / n

total_revenue_2nd = 0.0
total_revenue_1st = 0.0

for _ in range(N_TRIALS):
    values = [random.random() for _ in range(N_BIDDERS)]

    # 2위가격: 최고 낙찰, 지불액 = 두 번째로 높은 "입찰액"(=가치, 우월전략이므로) 이 낙찰자가 냄.
    sorted_vals = sorted(values, reverse=True)
    revenue_2nd = second_price_bid(sorted_vals[1])
    total_revenue_2nd += revenue_2nd

    # 1위가격: 각자 shading 한 입찰액 중 최고가가 낙찰, 그 금액을 지불.
    bids = [first_price_bid(v, N_BIDDERS) for v in values]
    revenue_1st = max(bids)
    total_revenue_1st += revenue_1st

avg_2nd = total_revenue_2nd / N_TRIALS
avg_1st = total_revenue_1st / N_TRIALS

print(f"입찰자 수 = {N_BIDDERS}, 시행 횟수 = {N_TRIALS:,}")
print(f"2위가격 경매 판매자 평균 수입: {avg_2nd:.4f}")
print(f"1위가격 경매 판매자 평균 수입: {avg_1st:.4f}")
print(f"차이: {abs(avg_2nd - avg_1st):.4f}  (수입동등정리대로 서로 근접해야 함)")

# 이론값: n명 균등분포[0,1]에서 최고 두 순서통계량의 기댓값 = (n-1)/(n+1)
theoretical = (N_BIDDERS - 1) / (N_BIDDERS + 1)
print(f"이론적 기대 수입 (n-1)/(n+1) = {theoretical:.4f}")

연습

균등분포 가치를 가진 입찰자 n명에 대해 1위 가격과 2위 가격 경매를 몬테카를로로 시뮬레이션하고, 판매자 기대 수입이 실제로 서로 수렴하는지 확인하라.

실무 · Verex 연결

블록빌더 경매나 우선순위 수수료 구조를 볼 때 어느 부분이 1위 가격에 가깝고 어느 부분이 2위 가격에 가까운지 구분하면, 참여자가 왜 그렇게 입찰하는지를 훨씬 정확히 예측할 수 있다.

공부한 날 원본 커리큘럼(docs/knowledge/math-50-curriculum.md)의 이 줄에 노트 링크와 ✅ 를 붙이면, 이 자리는 노트 본문으로 바로 이어집니다. 노트 없이 이 페이지에 바로 적어도 됩니다 — 다만 다시 생성하면 덮어쓰이므로, 남길 글은 docs/algorithms/ 의 마크다운으로 쓰는 편이 안전합니다.

← 11. 내시균형·죄수의 딜레마13. 메커니즘 디자인(VCG 개념) →