Algorithmcore
Uniform price auction
Also called multi-unit uniform price auction.
Sells k identical units to the k highest marginal bids at one price, the highest losing bid or the lowest winning bid. Truthful for unit demand; bidders who want several units shade their bids.
- Time
- O(d log d) worst
- Space
- O(d) extra
- Where
- d = the total number of marginal bids; k = the number of units; n = the number of bidders
- Model
- Word RAM
- Properties
- comparison baseddeterministiciterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Milton Friedman, Robert Wilson, Lawrence Ausubel, Peter Cramton, 1960
The uniform price auction sells identical units of one good. Each bidder reports a list of marginal bids, one for each extra unit it wants, and the auction accepts the highest marginal bids. Every unit sold costs the same price: the highest losing bid in one version, the lowest winning bid in the other. With the highest losing bid and bidders who want one unit each, it is the -th price auction, which is DSIC and a case of the VCG mechanism. When a bidder wants several units, its own losing bid can set the price of its winning units, so it gains by bidding less for its later units. This demand reduction makes the auction inefficient in equilibrium. Governments use the format for bonds and for some electricity and emission permit markets.
In plain words
A seller has many copies of the same thing. Each buyer says how much it would pay for a first copy, for a second copy, and so on. The seller gives the copies to the highest offers, and then everyone pays the same price per copy, set by the offers that just missed or just made it. If every buyer wants only one copy, honest offers are best, exactly as in a sealed second-price auction. A buyer that wants many copies has a reason to lie. Its offer for the last copy can become the price that it pays on all its other copies. By asking for fewer copies, it can make the price fall a lot and gain more than it gives up. This is why such auctions can sell to the wrong buyers.
The problem
There are identical units and bidders with quasilinear utility. Bidder has marginal values : it values units at . It reports marginal bids , in total numbers. The auction must choose how many units each bidder gets, with , and one price per unit, so that bidder pays . The aims are to give the units to the highest reported marginal bids, and to set a price at which no winning bid is below the price and no losing bid is above it.
The algorithm
UNIFORM-PRICE(b, k)- 1
E ← all triples (b_{i,j}, i, j) for every bidder i and unit j - 2
sort E by bid, highest first; ties go to the smaller i, then the smaller j - 3
q ← min(k, |E|) - 4
for each of the first q triples (·, i, ·): x_i ← x_i + 1 - 5
if the rule is HIGHEST-LOSING: p ← the bid of triple k + 1, or 0 if |E| ≤ k - 6
else (LOWEST-WINNING): p ← the bid of triple q, or 0 if q = 0 - 7
return x, p, and the payments p · x_i
The tie rule of line L2 puts a bidder's unit before its unit when the bids are equal, so every bidder wins a prefix of its list. Sorting is the simplest way to write line L2; a selection of the -th largest bid does the same work in linear time.
Example
Unit demand. Four bidders want one unit each and bid for units. The bids 7 and 5 win. Under the highest losing rule both winners pay 3, the best losing bid. Under the lowest winning rule both pay 5.
Demand reduction. Take , a bidder that values each of two units at 10, and a bidder that values one unit at 6. Use the highest losing rule.
| bids of | bid of | sorted triples | units of , | price | utility of |
|---|---|---|---|---|---|
| 6 | |||||
| 0 |
By giving up its second unit, makes its own bid 0 the highest losing bid, and the price falls from 6 to 0. The second profile is a Nash equilibrium. Its welfare is , while the optimum gives both units to for 20.
Correctness
The proof is in proofs/correctness.md. It shows these facts.
- The allocation is the best for the reports. Each bidder wins a prefix of its list, and the winning triples are the highest bids, so the allocation maximizes the sum of the accepted marginal bids.
- The price clears the market. Every winning bid is at least and every losing bid is at most . So at the price , each bidder's reported demand is the number of units it got, up to ties.
- Unit demand is truthful. If each bidder wants one unit, bidder wins when its bid is above the -th highest other bid and loses when it is below, and a winner pays under the highest losing rule. This is the threshold form of Myerson's lemma, and truthful bidding is a dominant strategy.
- The lowest winning rule is not truthful, even for unit demand: with one unit and bids 5 and 3, the winner pays its own bid and gains by bidding 4.
- Multi-unit demand is not truthful under either rule, by the demand reduction example.
Proof: The uniform price auction sells to the highest marginal bids at a clearing price, and it is truthful only for unit demandfull
We use the pseudocode of the page. Bidder reports a list of marginal bids , where is its offer for its -th unit. There are units. Line L2 sorts all triples by bid, highest first, then by , then by . Call the first triples winning and the rest losing.
Claim 1 (the allocation). Each bidder wins a prefix of its list: if wins and , then wins. The allocation maximizes the reported welfare over all allocations with and .
Proof. If , then , and on a tie the smaller unit index comes first in the order of line L2. So the triple of unit is earlier than the triple of unit , and it wins if that one wins. Any feasible allocation selects at most triples, one for each unit given out, and its welfare is the sum of their bids. The sum of at most entries of is at most the sum of the largest bids, because all bids are at least 0. Lines L3 and L4 select exactly the largest bids, and by the first part they form an allocation.
Claim 2 (the price clears the market). Under the highest losing rule (line L5), every winning bid is at least and every losing bid is at most . Under the lowest winning rule (line L6), the same holds when at least one unit is sold. Every winner pays for each unit, so a bidder that wins units pays (line L7).
Proof. The list is sorted. Under line L5, is the bid of triple , the first losing triple, or if no triple loses; in both cases every winning bid is at least (bids are at least 0) and every losing bid is at most . Under line L6, is the bid of the last winning triple, which is at most every earlier bid and at least every later bid.
So with truthful bids, the units go to the highest marginal values, and every bidder demands, at the price , the number of units it gets, up to ties.
Claim 3 (unit demand: truthful bidding is dominant under the highest losing rule). Suppose every bidder wants at most one unit and reports one bid. Fix bidder with value and the bids of the others. Then bidding gives at least the utility of any other bid, and at least 0.
Proof. Let be the -th highest bid of the other bidders, and if there are fewer than others. Bidder wins if and loses if : in the first case at most other bids are at least , and in the second case at least other bids are above . If bidder wins, at most other triples are ahead of it, so the winning triples are and the highest other bids, and the first losing triple is the -th highest other bid; if there are fewer than others, no triple loses and the price is . So the price is , which does not depend on . If , the bid wins and gives , and any other bid gives or 0. If , the bid gives 0, and a winning bid gives . If , every bid gives 0.
This is the -th price auction, the case of the VCG mechanism for identical units and unit demand.
Claim 4 (the lowest winning rule is not truthful, even for unit demand). With one unit and bids , the first bidder wins and pays its own bid 5, so its utility is 0. With the bid 4 it still wins and pays 4, so its utility is 1.
Claim 5 (demand reduction: with multi-unit demand, truthful bidding is not dominant). Take , a bidder with marginal values and a bidder with one value 6. Under the highest losing rule, truthful bids give both units at the price 6, so gets . If bids , the sorted bids are , so and win one unit each and the price is the losing bid 0. Then gets 10 > 8. The bids form a Nash equilibrium: already gets its whole value 6, and can get two units only with a second bid of at least 6, and then the losing bid 6 of sets the price to 6 and gets 8. With one unit, gets at most 10. The equilibrium welfare is , below the optimum 20.
The reason is that a bidder's own losing bid on a later unit can set the price it pays on its earlier units. With unit demand this cannot happen, because a bidder that wins has no losing bid.
Complexity
Sorting triples takes time and extra space, and lines L4 to L7 take time. With a linear-time selection of the -th and -th largest bids and a partition of the list around them, the time is . Ties at the boundary must still be broken by the rule of line L2.
Properties
- Clearing price. Every winner pays the same price per unit, and the price lies between the best losing bid and the worst winning bid.
- DSIC for unit demand under the highest losing rule, with the same threshold argument as the Vickrey auction.
- Not DSIC for multi-unit demand. A bidder's losing bids on later units can set the price of its winning units, so in equilibrium bidders shade their bids for later units (Ausubel, Cramton, Pycia, Rostek and Weretka 2014).
- Inefficient in equilibrium when bidders want several units, because demand reduction moves units from high to low marginal values.
- Low-price equilibria. In the model of a divisible good with bidders that submit demand curves, Wilson (1979) found equilibria in which the price is far below the values, because each bidder faces a steep supply from the others.
Variants and improvements
- Pay-as-bid (discriminatory) auction. Each winner pays its own winning bids. Bidders then shade all their bids, not only the later ones. Neither format dominates the other in revenue or efficiency in general (Ausubel, Cramton, Pycia, Rostek and Weretka 2014).
- Vickrey auction for identical units. Each bidder pays, for its -th unit, the -th highest losing bid of the others. This is the VCG mechanism for this setting and is DSIC for any nonincreasing marginal values, at the cost of different prices for the same good.
- Ascending clock auction. The price rises, and bidders report how many units they want at each price, until demand falls to . With straightforward bidding it ends at the uniform price; Ausubel's clinching auction changes the payments so that sincere bidding becomes an equilibrium.
- Reserve price. The seller adds bids of its own at the reserve, which bounds the price from below.
When to use it
Use it to sell many identical units when one public price matters, for example for government bonds, when buyers want a single price for fairness or for resale. With unit demand, use the highest losing rule, which is truthful. When large bidders want many units, expect demand reduction, and consider a clock auction with clinching or a Vickrey auction for identical units.
Pitfalls
- The price rule matters. "Uniform price" can mean the highest losing bid or the lowest winning bid. Only the first is truthful for unit demand.
- The bidder's own bids set the price. With multi-unit demand the price can be a losing bid of a winner. Do not treat the auction as a -th price auction in that case.
- Ties at the boundary. When several bids equal the -th bid, the tie rule decides who wins, but the price does not depend on who wins the tie.
- Marginal bids must not increase. A list with an increasing step does not describe a valuation with decreasing marginal values, and the prefix property of line L2 fails; the code rejects such a list.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/uniform-price-auction/. The authors are listed in prov/6TRC5Q.jsonl.
from fractions import Fraction
from typing import Sequence, Union
Number = Union[int, Fraction]
HIGHEST_LOSING = "highest-losing"
LOWEST_WINNING = "lowest-winning"
def uniform_price_auction(
bids: Sequence[Sequence[Number]], k: int, rule: str = HIGHEST_LOSING
) -> tuple[list[int], Number, list[Number]]:
"""Sell k identical units at one price.
bids[i] is the list of marginal bids of bidder i: bids[i][j] is what
bidder i offers for its (j + 1)-th unit. Each list must be nonincreasing.
The k highest marginal bids win one unit each. A tie between equal bids
goes to the smaller bidder index, then to the smaller unit index, which
for a nonincreasing list is the same as the earlier unit.
With rule HIGHEST_LOSING the price is the highest losing bid, or 0 if
every bid wins. With rule LOWEST_WINNING the price is the lowest winning
bid, or 0 if no bid wins. Every unit sold costs the same price.
Return (units, price, payments): units[i] is the number of units of
bidder i and payments[i] = units[i] * price.
"""
if k < 0:
raise ValueError("k must be nonnegative")
if rule not in (HIGHEST_LOSING, LOWEST_WINNING):
raise ValueError("unknown price rule")
for row in bids:
for j in range(1, len(row)):
if row[j] > row[j - 1]:
raise ValueError("marginal bids must be nonincreasing")
entries = [(row[j], i, j) for i, row in enumerate(bids) for j in range(len(row))] # @line L1
entries.sort(key=lambda e: (-e[0], e[1], e[2])) # @line L2
sold = min(k, len(entries)) # @line L3
units = [0] * len(bids)
for _, i, _ in entries[:sold]: # @line L4
units[i] += 1 # @line L4
price: Number = 0
if rule == HIGHEST_LOSING: # @line L5
if len(entries) > k: # @line L5
price = entries[k][0] # @line L5
elif sold > 0: # @line L6
price = entries[sold - 1][0] # @line L6
payments = [u * price for u in units] # @line L7
return units, price, payments # @line L7
def utility(
values: Sequence[Number], bids: Sequence[Sequence[Number]], i: int, k: int,
rule: str = HIGHEST_LOSING,
) -> Number:
"""Quasilinear utility of bidder i whose true marginal values are values.
The bidder gets values[0] + ... + values[u - 1] for u units and pays
u times the price.
"""
units, _, payments = uniform_price_auction(bids, k, rule)
return sum(values[:units[i]]) - payments[i]
test_uniform_price_auction.py 133 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/uniform-price-auction/. The authors are listed in prov/6TRC5Q.jsonl.
import itertools
import random
from fractions import Fraction
from uniform_price_auction import (
HIGHEST_LOSING,
LOWEST_WINNING,
uniform_price_auction,
utility,
)
def nonincreasing_vectors(grid, length):
for v in itertools.product(grid, repeat=length):
if all(v[j] >= v[j + 1] for j in range(length - 1)):
yield list(v)
def best_total(bids, k):
"""Largest sum of accepted bids, by brute force over unit counts."""
best = 0
for counts in itertools.product(*[range(len(row) + 1) for row in bids]):
if sum(counts) <= k:
best = max(best, sum(sum(row[:c]) for row, c in zip(bids, counts)))
return best
def test_example() -> None:
bids = [[10, 10], [6]]
assert uniform_price_auction(bids, 2) == ([2, 0], 6, [12, 0])
assert uniform_price_auction(bids, 2, LOWEST_WINNING) == ([2, 0], 10, [20, 0])
assert uniform_price_auction([[10, 0], [6]], 2) == ([1, 1], 0, [0, 0])
assert uniform_price_auction([[7], [5], [3], [3]], 2) == ([1, 1, 0, 0], 3, [3, 3, 0, 0])
def test_edges() -> None:
assert uniform_price_auction([], 3) == ([], 0, [])
assert uniform_price_auction([[4]], 0) == ([0], 4, [0])
assert uniform_price_auction([[4]], 0, LOWEST_WINNING) == ([0], 0, [0])
assert uniform_price_auction([[4, 1]], 5) == ([2], 0, [0])
assert uniform_price_auction([[4, 1]], 5, LOWEST_WINNING) == ([2], 1, [2])
assert uniform_price_auction([[5], [5], [5]], 2) == ([1, 1, 0], 5, [5, 5, 0])
half = Fraction(1, 2)
assert uniform_price_auction([[half], [Fraction(1, 3)]], 1) == ([1, 0], Fraction(1, 3), [Fraction(1, 3), 0])
try:
uniform_price_auction([[1, 2]], 1)
except ValueError:
pass
else:
raise AssertionError("an increasing bid list must be rejected")
def test_allocation_and_clearing_price() -> None:
rng = random.Random(1)
for _ in range(1500):
n = rng.randrange(0, 4)
bids = [sorted((rng.randrange(0, 8) for _ in range(rng.randrange(0, 4))), reverse=True) for _ in range(n)]
k = rng.randrange(0, 6)
for rule in (HIGHEST_LOSING, LOWEST_WINNING):
units, price, payments = uniform_price_auction(bids, k, rule)
total = sum(len(row) for row in bids)
assert sum(units) == min(k, total)
assert sum(sum(row[:u]) for row, u in zip(bids, units)) == best_total(bids, k)
assert payments == [u * price for u in units]
# Every winning bid is at least the price, and every losing bid is
# at most the price (when a unit is sold or the rule uses losers).
for row, u in zip(bids, units):
assert all(b >= price for b in row[:u])
if rule == HIGHEST_LOSING or sum(units) > 0:
assert all(b <= price for b in row[u:])
def test_unit_demand_truthful_is_dominant() -> None:
grid = range(0, 5)
for k in (1, 2):
for others in itertools.product(grid, repeat=2):
for i in range(3):
for value in grid:
truthful = [[b] for b in others[:i]] + [[value]] + [[b] for b in others[i:]]
u_true = utility([value], truthful, i, k)
assert u_true >= 0
for lie in grid:
bids = [[b] for b in others[:i]] + [[lie]] + [[b] for b in others[i:]]
assert u_true >= utility([value], bids, i, k)
def test_lowest_winning_price_is_not_truthful() -> None:
# One unit, values 5 and 3: the winner pays its own bid, so shading helps.
assert utility([5], [[5], [3]], 0, 1, LOWEST_WINNING) == 0
assert utility([5], [[4], [3]], 0, 1, LOWEST_WINNING) == 1
def test_demand_reduction() -> None:
values_a, values_b = [10, 10], [6]
truthful = utility(values_a, [values_a, values_b], 0, 2)
reduced = utility(values_a, [[10, 0], values_b], 0, 2)
assert (truthful, reduced) == (8, 10)
# The reduced profile is a Nash equilibrium over a grid of bids.
grid = range(0, 13)
profile = [[10, 0], [6]]
u_a = utility(values_a, profile, 0, 2)
u_b = utility(values_b, profile, 1, 2)
for lie in nonincreasing_vectors(grid, 2):
assert utility(values_a, [lie, [6]], 0, 2) <= u_a
for lie in grid:
assert utility(values_b, [[10, 0], [lie]], 1, 2) <= u_b
# The equilibrium allocation is not efficient: welfare 16 against 20.
units, _, _ = uniform_price_auction(profile, 2)
welfare = sum(values_a[:units[0]]) + sum(values_b[:units[1]])
assert (welfare, best_total([values_a, values_b], 2)) == (16, 20)
def test_multi_unit_bidders_gain_only_by_lowering_bids() -> None:
# With two units of demand, a profitable lie exists in some profiles, and
# in each profile some best lie bids no more than the value on each unit.
grid = range(0, 5)
found = False
for values in nonincreasing_vectors(grid, 2):
for other in nonincreasing_vectors(grid, 2):
for k in (1, 2, 3):
u_true = utility(values, [values, other], 0, k)
best = max(utility(values, [lie, other], 0, k) for lie in nonincreasing_vectors(grid, 2))
shaded = max(
utility(values, [lie, other], 0, k)
for lie in nonincreasing_vectors(grid, 2)
if lie[0] <= values[0] and lie[1] <= values[1]
)
assert shaded == best
found = found or best > u_true
assert found
History
Milton Friedman argued around 1960 that the US Treasury should sell its securities at one price rather than at the bids, so that small bidders would not need to guess the market. Wilson (1979) modeled the sale of a divisible good to bidders who submit demand curves and found equilibria of the uniform price rule in which the price is far below the values. Theory and evidence on demand reduction followed in the 1990s and 2000s, and Ausubel, Cramton, Pycia, Rostek and Weretka (2014) compared the uniform price and pay-as-bid formats, showing that demand reduction makes both inefficient and that their ranking in revenue and efficiency depends on the setting.
References
- Lawrence M. Ausubel, Peter Cramton, Marek Pycia, Marzena Rostek and Marek Weretka, Demand reduction and inefficiency in multi-unit auctions, Review of Economic Studies 81(4) (2014), 1366-1400, demand reduction in the uniform price auction, the inefficiency it causes, and the comparison with the pay-as-bid auction
- Robert Wilson, Auctions of shares, Quarterly Journal of Economics 93(4) (1979), 675-689, equilibria of the auction of a divisible good at one price, with prices far below the values
- Vijay Krishna, Auction Theory, 2nd edition, Academic Press, 2010, the chapters on multiple-unit auctions (the uniform price, discriminatory and Vickrey auctions of identical units, and demand reduction)
- Tim Roughgarden, Twenty Lectures on Algorithmic Game Theory, Cambridge University Press, 2016, Lecture 9 (budget constraints and the uniform-price multi-unit auction)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 6TRC5Q Edit this page History Report an error Markdown