#131: A Matching Algorithm for an AdCP Stable Market
How the AdTech Context Protocol (AdCP) can turn Gale–Shapley’s 1962 matching algorithm into a framework for agentic market stability.
Advertising Economic Forum NYC, March 18–19, 2026. Where the advertising world joins together to understand its world. Advertising Economic Forum returns to New York for a two-day experience that unites finance, economics, and advertising across the decision-makers, investors, founders, and thinkers shaping what comes next.
Day 1 features our high-energy Founder + VC pitch competition hosted at Horizon Media. Day 2 is our “Davos of Advertising” experience, a closed-door, off-the-record forum where leaders reassess the probabilities of who’s winning (or losing) in a rapidly changing market. If you’d like to attend, register your interest today!
A Matching Algorithm for an AdCP Stable Market
In 1962, David Gale and Lloyd Shapley published a paper with a deceptively romantic title: College Admissions and the Stability of Marriage. It’s one of those rare academic works that quietly changed the world. Along with fellow game theory economist Alvin E. Roth, Shapley won the 2012 Nobel Memorial Prize in Economic Sciences for his theory of stable allocations and market design.
Buried inside the paper’s equations was a simple question that has since shaped how we assign medical residents, college acceptances, and school placements:
How can a market be structured so that every participant reaches their optimal match such that neither side has an incentive to deviate?
They called this problem the stable matching problem. The solution is called the deferred acceptance algorithm, which has become the cornerstone of modern market design. And now, six decades later, as agentic AI systems are beginning to represent buyers and sellers in real time, their seminal work can help shape the matching of buyer/seller agents toward a new and better programmatic frontier.
From college acceptance to the adtech market
At its core, the Gale–Shapley algorithm coordinates two sides of a market that need each other but don’t necessarily trust each other. Here’s how it works using the original college admissions version of the problem:
Each participant lists their preferences: students rank colleges, and colleges rank students.
During the process, students apply to their top-choice colleges.
Each college tentatively accepts the best applicants it has received so far, deferring final admission decisions until better candidates stop arriving.
The result is a stable matching whereby no other student and college match would both prefer to be paired with each other over their current match.
The elegant twist is how the proposing side (students) always achieves the best possible stable outcome, while the receiving side (colleges) must accept the least favorable stable configuration. It’s an asymmetric advantage determined by who makes the first move.
Sound familiar? That’s the same invisible force that has shaped digital advertising into markets ever since programmatic began.
In the programmatic ad world, the sell side makes the first move when publishers, via exchanges and SSPs, send out (propose) a bid request that says, “here’s what I have for sale.” On the other side of the market, buy-side advertisers evaluate proposals and either accept (bid) or reject (pass) them through DSPs.
Unfortunately, the result has been an ecosystem of unstable matches where billions of impressions are traded daily, with little to no shared understanding of value, preference, or even trust.
A word on what trust really means: Readers of Quo Vadis already know that we define “trust” as maximized confidence in a counterparty’s intent.
Enter the Agents and AdCP
Buyers and sellers are now poised to operate on AdCP with autonomous agents. It’s a massive game-changer toward total transaction efficiency. In essence, these are pieces of software that can declare, negotiate, decide, and adapt on behalf of their principals (advertisers and publishers).
Buy-Side Agents: In an AdCP market mechanism, buy-side agents work for advertisers and optimize bids across channels based on constraints (budget, timeframe, standards), campaign objectives, and learned experience. As far as we can tell today, buy-side agents will formulate bid prices based on one known value and two probability estimates.
The price ( Pₖ ) that the buyer is willing to pay for the ideal ad opportunity (a known buyer value but unrevealed to the sell-side). In an ideal world, this “anchor” price should get updated based on prior learning.
The real-time probability ( Pᵢ ) that the ad opportunity offered by the sell-side is ideal, updated and based on prior learning.
The real-time probability ( Pₒ ) that the ad opportunity will result in the desired outcome, also based on prior learning. The buyer’s desired outcome is revealed as a preference to seller agents.
Sell-side Agents: On the other side of the trade, sell-side agents represent publishers, managing access to audiences, inventory, context, and pricing. They aim to optimize yield. Sell-side agents formulate dynamic floor prices based on one known value and two probability estimates.
The “rate card” price ( Pᵣ ) that the seller is willing to sell a given ad opportunity (a known seller value but unrevealed to the buy-side), which should be updated based on prior learning. Note that the selling price is easy for the publisher to calculate because the publisher’s CFO has a known profit margin target and can easily estimate its variable and fixed costs, and can also easily estimate audience traffic and usage to back into the desired price.
The real-time probability ( Pₛ ) that the ad opportunity will be suitable for the buyer, updated and based on prior learning.
The real-time probability ( Pₒ ) that the ad opportunity will result in the desired outcome, also based on prior learning.
Over time, the objective for both sides is to minimize their probability error rates toward zero. Here’s a simple example.
A buy-side agent reveals its goal to find sports enthusiasts with high purchase intent on high-attention metric placement opportunities.
A sell-side agent reveals that it has a sports enthusiast ad opportunity (the ad unit could be open web display, search, social, CTV, audio, DOOH, etc.)
The buyer has a $10 ideal price ( Pₖ ) and estimates ( Pᵢ ) at 80% and with an outcome probability ( Pₒ ) of 50%. Therefore, the buy-side agent offers $4.00 for the ad opportunity.
The seller with a $10 price ( Pᵣ ) believes it has a suitable ad opportunity with a probability ( Pₛ ) of 90% and estimates the outcome probability ( Pₒ ) at 30%. Therefore, a dynamic floor price is set at $3.00.
In this case, the sell-side agent gets a $4.00 “in-the-money” bid and achieves a 25% alpha (aka margin spread) of $1.00. The sell-side agent will get bids from other buy-side agents, consummate a deal with the highest bidder (assuming a first-price auction), and the ad will be served. Interestingly, one can imagine how a seller agent can declare itself as a first-price auction, second-price, or any other auction type.
After the ad serves, both the buy-side and sell-side agents will check actual outcomes vs. their previous probabilities and update their registries for the next cycle between each other.
Rethinking “Rent” in the Agentic Era
Rents won’t disappear. They simply become proportionate to the value of trust, precision, outcomes, and speed delivered by the agents.
Each agent knows its own pricing parameters and also has a set of known preferences (e.g., “here’s what I have for sale,” “here’s what I am looking for”). For AdCP to work out as a greatly improved market structure, each agent will need to reveal its preferences to the other party. Such a system of exchanging preferences acts as a reinforcement mechanism to maximize the confidence that each side has about the other’s intent.
However, what seems to be missing is a matching framework for these autonomous entities to find one another efficiently and stably, without an intermediary extracting rent. This is precisely where Gale and Shapley’s work becomes a blueprint for a new kind of programmatic market. One that can be both agentic and stable across the entire $758 billion digital ad market.
To appreciate how this framework reshapes intermediation, we first need to revisit how adtech rents became justified. Historically, the structure of programmatic disintermediation was built on the willingness of buyer and seller principals to rent ad technology, where both end up paying high rents in exchange for ad technology.
It was a rational choice given the lack of alternatives. Advertisers rent the pipes of agencies, DSPs, verification tools, and data providers to reach audiences. On the other side of the trade, publishers rent SSPs, yield optimizers, and verification tools to monetize inventory.
In an agentic market, where autonomous agents negotiate directly on behalf of each side, the economics of rent could shift dramatically. Instead of paying for layers of middleware that collectively take 50% (or much more) of media spend, principal participants will likely pay directly based on agent performance and outcomes. Instead of high fees and low working media, it could end up looking much more like low-friction Visa or Mastercard fees with a transactional fee structure closer to 5% or less.
Deferred Acceptance for Digital Ads
Imagine a marketplace of sell-side and buy-side agents, each equipped with preference functions that rank potential counterparties.
A sell-side agent might prioritize buyers with high reliability and consistent pricing behavior.
A buy-side agent might prefer publishers with high contextual alignment, strong audience quality, and proven performance.
Both sides keep a running confidence score of the counterparty’s intent, and both sides aim to minimize probability error rates. Instead of the sell-side information asymmetry that dominates, diminishes, and hinders programmatic today, we end up with near-perfect symmetry.
Importantly, sell-side agents could and should trade information about buyer agents, and vice versa. For instance, a buy-side agent might ask another all kinds of questions, such as, “Have you dealt with seller-agent123? Are they reliable?”
At the start of each auction cycle, a sell-side agent proposes offer details about inventory, audience, context, etc. to one or more buy-side agents. The buy-side agents get offers from one or more sell-side agents and tentatively accept the most attractive offers, but remain open to better ones as additional proposals arrive. Rejected sell-side agents adjust their offers or move to their next preferred buyers.
This process of deferred acceptance iterates in milliseconds until no agent wants to deviate from its current match. The resulting state is stable, whereby no buyer–seller pair would prefer to trade with each other outside the current agreement. In other words, buyers and sellers end up with a new programmatic market that reaches equilibrium, along with the added benefit of middleware tech minimization.
From Matching to Market Design
One of the most profound findings of the Gale–Shapley model is that the proposing side controls the equilibrium. If sellers propose, the system will yield a seller-optimal stable matching. If buyers proposed, it would be buyer-optimal.
This has obvious implications for the adtech power balance. If the sell side can manifest itself as the proposing side through intelligent, autonomous agents capable of optimizing across increasingly interconnected data signals, then the equilibrium could shift in their favor. Not only could we see rebalanced economics, but this new market structure could restore truth toward true value, where inventory is priced not by opacity, but instead by preference alignment.
To make this work, the market will need a few things:
Expressed preferences: Both sides must translate qualitative goals into quantitative ranking functions, a kind of utility model that evolves through learning and by minimizing expected value probability error rates.
Transparent signals: Shared state variables that allow agents to evaluate each other’s fit (context, performance, reliability, etc).
Iterative negotiation protocols: Mechanisms for deferred acceptance to play out in real time across a vast number of micro-markets simultaneously.
While the Gale–Shapley model will guarantee stability under these conditions, it doesn’t guarantee efficiency or fairness. Achieving efficiency and fairness requires design choices such as weighting mechanisms, registries, and governance rules that define the economic texture of the marketplace in the pursuit of information symmetry.
In practice, this means code becomes policy because whoever defines the matching logic defines the flow of value. As far as we can tell, that’s the big job ahead for AdCP.
What AdCP Can Learn from Dating Apps
Dating apps such as Tinder, Bumble, or Hinge are living, large-scale implementations of the Gale–Shapley logic that AdCP could learn from. Both systems depend on two sets of agents — proposers and receivers — who reveal preferences, make offers, and find stable matches.
Dating platforms demonstrate how the direction of initiation defines equilibrium. When one side (say, the sell side) makes the first move, it controls the flow and framing of proposals. The receiving side (the buy side) filters, evaluates, and re-prioritizes based on revealed intent and accumulated feedback.
What’s powerful about this analogy is that both systems thrive on preference data and behavioral feedback loops. A dating app learns from swipes, likes, ratings, and responses to refine its match rankings. Agentic buyers and sellers could similarly learn from inventory/audience quality, attention metrics, transaction completions, and outcomes to update each agent’s probability estimates.
In essence, AdCP doesn’t just need to become a matching protocol. It’s a market relationship engine, learning continuously from every “proposal” and “response.” Like dating apps, it will need to balance efficiency (fast and accurate matches) with stability (quality matches).
Conceptual mathematical formulation for agentic adtech with the sell-side as the proposing party
Let:
S = {s₁,…sₙ} be sell-side agents (publishers).
B = {b₁,…bₙ} be buy-side agents (advertisers)
Each has capacity q(a,b) ≥ 1 (e.g., concurrent opportunities per time window)
Each seller S has a preference order ≻s over buyers
Each buyer B has a preference order ≻b over sellers
A matching μ satisfies:
μ (s) ∈ B ∪ {∅} for sellers
Each sell-side agent either finds a buyer to trade with or remains unmatched for that cycle.
μ (b) ⊆ S with | μ(b) | ≤ q for buyers
Each buy-side agent can accept offers from several sell-side agents, but only up to a defined limit. For example, if a buyer can handle Y number of simultaneous inventory sources, then it can’t take more than Y matches in that round.
s ∈ μ (b) ⇔ μ (s) = b
If a sell-side agent is paired with a particular buy-side agent in the matching, then that buy-side agent’s list of accepted sellers also contains that same sell-side agent (e.g., no one-way matches)
Blocking Pair Test
A matching is stable if no blocking pair exists. A pair (s,b) is a blocking pair if:
b ≻s μ(s) means the seller prefers b to its assigned buyer, and
| μ(b) | < q(b) or ∃s′ ∈ μ(b) s≻b s′ means the buyer prefers (s) to another seller that the buyer is already matched with. The buyer agent might already be connected to several seller agents, but if a new seller shows up with a more attractive opportunity (e.g., higher quality, better context, lower fraud risk, or overall higher probabilities), the buyer might replace one of its existing sellers with this new one.
Because sellers are the proposing party, the outcome is seller-optimal among all stable matchings. You can flip the roles to achieve a buyer-optimal outcome.
Python code for your trial and error pleasure
from collections import deque
def deferred_acceptance_sellside(sellers_prefs, buyers_prefs, buyer_caps):
# Precompute buyer ranking maps (lower is better)
rank = {b: {s: i for i, s in enumerate(buyers_prefs[b])} for b in buyers_prefs}
match_seller = {s: None for s in sellers_prefs}
match_buyer = {b: set() for b in buyers_prefs}
next_idx = {s: 0 for s in sellers_prefs}
free = deque([s for s in sellers_prefs])
while free:
s = free.popleft()
prefs = sellers_prefs[s]
if next_idx[s] >= len(prefs):
continue
b = prefs[next_idx[s]]
next_idx[s] += 1
if len(match_buyer[b]) < buyer_caps[b]:
match_buyer[b].add(s); match_seller[s] = b
else:
worst = max(match_buyer[b], key=lambda x: rank[b].get(x, float(’inf’)))
if rank[b].get(s, float(’inf’)) < rank[b].get(worst, float(’inf’)):
match_buyer[b].remove(worst); match_buyer[b].add(s)
match_seller[s] = b; match_seller[worst] = None; free.append(worst)
else:
free.append(s)
return match_seller, match_buyer
def is_stable_sellside(sellers_prefs, buyers_prefs, buyer_caps, match_seller, match_buyer):
rank = {b: {s: i for i, s in enumerate(buyers_prefs[b])} for b in buyers_prefs}
def buyer_would_prefer(b, s):
if len(match_buyer[b]) < buyer_caps[b]: return True
worst = max(match_buyer[b], key=lambda x: rank[b].get(x, float(’inf’)))
return rank[b].get(s, float(’inf’)) < rank[b].get(worst, float(’inf’))
for s, prefs in sellers_prefs.items():
current_b = match_seller[s]
for b in prefs:
if b == current_b: break
if buyer_would_prefer(b, s): return False, (s, b)
return True, None
Run Code Results
Sellers’ (proposers) preferences:
S1: B1 > B2 > B3
S2: B2 > B1 > B3
S3: B2 > B3 > B1
S4: B1 > B3 > B2
Buyers’ (receivers) preferences and capacities:
B1: prefers S4 > S1 > S2 > S3 (cap 1)
B2: prefers S3 > S2 > S1 > S4 (cap 2)
B3: prefers S1 > S2 > S3 > S4 (cap 1)
Outcome:
Matches (seller → buyer):S1→B3, S2→B2, S3→B2, S4→B1
Buyer rosters:B1:{S4}, B2:{S2,S3}, B3:{S1}
Stable? Yes.
Blocking pair? None.If you like topics like the one you just read, where advertising, finance, and economics intersect, then you’ll love the Advertising Economic Forum NYC 2026 on March 18–19. Be part of the conversation shaping what’s next!
Disclaimer: This post, and any other post from Quo Vadis, should not be considered investment advice. This content is for informational purposes only. You should not construe this information, or any other material from Quo Vadis, as investment, financial, or any other form of advice.

