Blockchain Limit Order Markets: Dubey Mechanism, SPEEDEX

 76 min video

 11 min read

YouTube video ID: ruqjxyUsTlY

Source: YouTube video by MIT OpenCourseWareWatch original video

PDF

This article explores the intersection of computer science and economics, focusing on market mechanisms and alternative equilibria, particularly within the context of blockchain implementation. It delves into the complexities of computing Nash equilibria and introduces more tractable alternatives like correlated and coarse correlated equilibria, along with machine learning algorithms to improve efficiency.

Dubey's Limit Order Market Mechanism

The discussion begins with Dubey's limit order market mechanism, a specific game designed to be implemented on the blockchain.

Market Notation and Strategy

The market involves: - n players (i) - k goods - Each player has an endowment (a) and a utility function. - In each time period, a player submits a strategy defined by four quantities: p, q, p tilde, and q tilde. - p, q: Buy q units of good j if the price is p or less. - p tilde, q tilde: Sell q units if the price is p tilde or more. - Players can bid to buy and sell all goods, even the same ones, at chosen prices. - The only constraint is that players cannot sell goods they do not possess in their endowment. - The full strategy space (S) is the combination of all player strategies. - An outcome (x) is the bundle of goods each agent buys or sells. - The game (gamma) includes a penalty (lambda) for players with negative credit at the end of a period. Players can buy goods without immediate funds, but if their purchases exceed their sales plus endowed money, they incur a penalty weighted by lambda.

Mechanism Implementation

  • Each good has a separate trading post.
  • Players submit strategies, and bids are accrued at each trading post.
  • The highest buyer is matched with the lowest seller.
  • If the highest buyer's price is less than the lowest seller's price, no trade occurs.
  • If there's an intersection, trade executes at the buyer's quoted price.
  • Orders are filled sequentially; if a buyer wants two units and a seller offers four, the buyer takes two, and the mechanism moves to the next highest buyer for the remaining two units from the seller.

Efficiency and Equilibria

  • A mechanism is efficient if no subset of players (m) can deviate to an alternate strategy and find a Pareto-dominant outcome.
  • A non-cooperative equilibrium (NE) is efficient individually for each player, meaning no single player can deviate to a Pareto-dominating bundle given others' strategies. This is similar to a Nash equilibrium.
  • A strong non-cooperative equilibrium is efficient for any arbitrary coalition of players.
  • An NE is active if each trading post has at least two active buyers and sellers.
  • An NE is tight if all active buyers and sellers quote the same price.

Properties of Non-Cooperative Equilibria

  • For any market and negative credit penalty, active non-cooperative equilibria are competitive.
  • Tight active non-cooperative equilibria are also competitive.
  • Every tight active non-cooperative equilibrium is strong.
  • These outcomes coincide perfectly with competitive equilibria, making them very favorable.

SPEEDEX: A Blockchain Implementation

SPEEDEX is a decentralized limit order exchange built on blockchain technology, published in 2023, that implements many aspects of Dubey's mechanism. - Users submit limit orders (e.g., trading $100 for 110 euros). - In each blockchain block, the mechanism calculates market-clearing prices for each good and executes all outstanding orders at that price. - Key difference from Dubey's mechanism: SPEEDEX executes all trades at the market-clearing price (intersection price), whereas Dubey's mechanism executes at the buyer's quoted price. Dubey proved that executing at the intersection price breaks down assumptions and cannot guarantee competitive equilibria. - SPEEDEX uses a tatonnement iterative process to find clearing prices.

Outcomes and Advantages of SPEEDEX

  • Runtime: Order of (number of assets)^2 * log(number of outstanding orders). The logarithmic scaling with orders is crucial for efficiency.
  • Consistent Clearing Prices: No arbitrage opportunities between different currencies.
  • Eliminates Front-Running: All transactions in one block occur at the same prices. This prevents "miner-extractable value" (MEV) where powerful nodes reorder transactions to profit from others' bids.

Tractability Concerns: Finding Equilibria

A major challenge is the tractability of finding equilibria. - Neither SPEEDEX nor Dubey's proofs explain how to converge on a non-cooperative equilibrium. - Finding Nash or non-cooperative equilibria requires agents to rationally predict others' strategies, which is computationally intensive. - With many goods, continuous prices, and large quantities, the strategy space becomes extremely large, making it difficult for rational agents to reason effectively.

Complexity of Nash Equilibria

  • Nash equilibria computation is PPAD-complete.
  • All known algorithms are exponential; no polynomial-time algorithms exist for general cases.
  • Competitive equilibria are also PPAD-complete for general exchange economies.
  • PPAD (Polynomial Parity Argument in Directed Graphs) is a complexity class for search problems guaranteed to have a solution (like Nash's proof that every game has an equilibrium). The complete problem for PPAD involves finding a second unbalanced node in a directed graph given one.
  • Nash equilibria are proven to be complete for PPAD, meaning they are inherently difficult to compute and cannot be simplified further.

Alternative Equilibria: Correlated and Coarse Correlated Equilibria

Given the difficulty of computing Nash equilibria, alternative equilibrium concepts that require coordination among players are explored.

Correlated Equilibrium

  • A central coordinator chooses strategies for each player.
  • The coordinator maintains a joint probability distribution (p) over all player strategies.
  • For each game iteration, the coordinator draws a strategy profile from p and tells each player their selected strategy.
  • Players know the underlying distribution p and their own selected strategy, allowing them to reason about others' likely strategies.
  • A correlated equilibrium occurs when each player, knowing their signaled strategy and the distribution, has no incentive to deviate from the given strategy.
  • This involves (number of strategies)^2 constraints per player.
  • Correlated equilibria allow for correlation between player actions, favoring certain joint actions.

Coarse Correlated Equilibrium

  • An even weaker form of equilibrium.
  • Players do not learn their selected strategy before committing to the mechanism.
  • Players must, in expectation over all possible strategies, be better off than any fixed deviation.
  • This involves O(number of strategies) constraints per player, making it computationally simpler.

Relationship Between Equilibria

  • All Nash equilibria are correlated equilibria (a subset).
  • All correlated equilibria are coarse correlated equilibria (a subset).
  • Nash equilibrium is a special case of correlated equilibrium where player probabilities are independent.
  • The difference between correlated and coarse correlated lies in commitment:
  • Coarse correlated: Commit before learning your strategy.
  • Correlated: Learn your strategy, then decide.
  • These concepts simplify each player's optimization problem, as they no longer need to predict others' strategies but can assume others will follow the coordinator's signals.
  • Trust in the coordinator is crucial. Blockchain smart contracts can address this by making the distribution visible and verifiable.

Computational Advantages

  • Constraints for both correlated and coarse correlated equilibria are linear combinations of strategy probabilities.
  • This allows for the use of linear programming methods, which are polynomial-time algorithms.
  • For n players and k strategies:
  • Correlated equilibria: O(NK^2) constraints.
  • Coarse correlated equilibria: O(NK) constraints.
  • Linear programming also allows for optimization, such as maximizing the expected utility for players (e.g., Pareto planner's problem) at no extra computational cost.

Why Polynomial Time Algorithms Matter for Blockchain

  • Blockchain implementations (e.g., Ethereum) have strict limits on computational complexity.
  • Each node runs all transactions and smart contract calls.
  • To ensure frequent block additions, contracts cannot have non-deterministic loops or functions whose execution time cannot be determined at compile time.
  • Even low-factor polynomial time complexity can be expensive.
  • Therefore, polynomial-time algorithms are essential for blockchain-based mechanisms.

Challenges with Large Strategy Spaces

  • Even with polynomial-time linear programming, the number of variables (joint probability outcomes) grows exponentially with players and strategies.
  • Example: Two goods, two players, quantities/prices 0-9.
  • Each player has 100 million possible strategies.
  • Joint strategy outcomes: 10^16.
  • Adding a third player: 10^24.
  • This makes linear programming intractable for realistic market sizes.

No-Regret Learning: A Machine Learning Approach

No-regret learning offers an alternative to explicitly optimizing over joint probability distributions.

Concept of No-Regret Learning

  • An online algorithm where an agent makes actions to maximize reward.
  • It takes an action, gets feedback (cost), and updates itself.
  • At each time step t, it makes a decision without knowing future inputs.
  • It maintains a probability vector over strategies, randomly chooses one, and submits it.
  • Cost: A linear transformation of utility (high utility = low cost, 0-1 range).
  • These algorithms work well in multiplayer settings where agents optimize individually, and a central mechanism determines utility.

Evaluating No-Regret Algorithms: Regret

  • Instead of comparing to a "perfect" algorithm (which is impractical), no-regret algorithms are evaluated based on regret.
  • Regret compares what the algorithm did to what a "better" agent (from a restricted policy class G) would have done.
  • External Regret: Compares the algorithm's performance to the best fixed action that could have been played over all past time steps.
  • Algorithms like Randomized Weighted Majority minimize external regret, with a bound of sqrt(T log N) over T time steps (N is number of strategies).
  • This means regret per iteration decreases over time.

Randomized Weighted Majority Algorithm

  • A simple and efficient algorithm.
  • w: weight for strategy i at time T.
  • L: cost vector (adversary returns cost of all possible actions, not just the chosen one).
  • Costs are often normalized to 0 or 1 for simplicity.
  • Update rule: If cost is 1 (high), decrease weight by 1 - eta (learning rate). If cost is 0 (good), keep weight the same.
  • Strategies with consistently high costs see their weights decrease, reducing their probability of being played.
  • This process converges quickly in practice.

No-Regret Learning in Multiplayer Games

  • In a multiplayer setting, agents use the same no-regret learning algorithm.
  • The mechanism computes outcomes and informs each agent of the costs for all their possible actions.
  • If we take the time-average of all players' strategies over many iterations, the system converges to a coarse correlated equilibrium.
  • As players continue to play, their average regret per iteration decreases, leading to better approximations of the equilibrium.
  • This approach avoids optimizing over the prohibitively expensive joint probability distribution.

From Coarse Correlated to Correlated Equilibria: Swap Regret

  • To achieve correlated equilibria, a stronger comparison class called swap regret is used.
  • No-swap regret learning compares the algorithm's performance to what would have happened if, every time action i was played, action j had been played instead (for any i, j).
  • This is a more lenient comparison class than external regret.
  • Algorithms for swap regret are tractable and polynomial-time.
  • Time-averaged strategies from no-swap regret learning converge to a correlated equilibrium.

Advantages of No-Regret Learning for Equilibria

  • Estimates equilibria without computing the entire joint probability distribution.
  • Works well in multiplayer settings and has proven convergence properties.
  • Loss of ability to maximize an objective function (unlike linear programming).
  • For simplified games (e.g., two-player zero-sum), they can converge to Nash equilibria.
  • Individual probabilities may not converge, but their time-average does.

Information Settings for No-Regret Learners

  • Full Information: Agent learns the cost of all possible actions at each time step. This provides the most information and fastest convergence.
  • Partial Information: Agent learns the cost vector, but with noise or based on what others did, not expected costs.
  • Multi-Armed Bandit: Agent only learns the cost of the exact action it took. This is the most restrictive setting.
  • The choice of information setting depends on mechanism design and the cost/feasibility of providing information. Less information leads to slower convergence but may be easier to implement.

Application to Dubey's Mechanism and Future Work

The goal is to design regret learning agents and a training mechanism to efficiently estimate equilibria for Dubey's game. - Use this equilibrium as a distribution for a coordinator. - Deploy this coordinator with the mechanism on the blockchain. - Develop algorithms for no-regret learners that can compute equilibria under varying conditions (shocks to endowments, utility functions, new agents).

Outstanding Questions

  1. Efficiency of Outcomes: How optimal and efficient are the outcomes computed by no-regret learners, given the loss of explicit maximization? Can training algorithms be modified to improve outcomes?
  2. Dynamic Adaptation: How can agents adapt to shocks (changes in endowments, utilities, new market entrants)?
  3. Optimal Information Setting: What is the best trade-off between information provided to learners (faster convergence) and computational cost per iteration?

This research aims to create a functioning example of how advanced computer science and economic concepts can be effectively applied in real-world blockchain scenarios.

  Takeaways

  • Dubey's limit order market mechanism defines a game where players submit buy and sell price‑quantity pairs, face penalties for negative credit, and matches highest buyers with lowest sellers at the buyer’s quoted price.
  • SPEEDEX adapts Dubey’s design but clears all trades at a single market‑clearing price per block, eliminating front‑running and ensuring consistent prices across assets.
  • Computing Nash or non‑cooperative equilibria in these markets is PPAD‑complete, making exact solutions computationally infeasible for realistic numbers of goods and agents.
  • Correlated and coarse correlated equilibria replace the need for agents to predict each other by using a central coordinator’s probability distribution, allowing polynomial‑time linear‑programming solutions.

Frequently Asked Questions

Why does SPEEDEX execute trades at the market‑clearing price instead of the buyer’s quoted price?

SPEEDEX clears all orders at the market‑clearing price to prevent the price‑mismatch problem identified by Dubey, where using the buyer’s quoted price can break the assumptions needed for competitive equilibria. By fixing a single price per block, it removes arbitrage opportunities and eliminates front‑running, ensuring consistent, fair trades.

What does PPAD‑complete mean for computing Nash equilibria in blockchain markets?

PPAD‑complete indicates that finding a Nash equilibrium is as hard as the hardest problems in the PPAD class, for which no polynomial‑time algorithm is known. Consequently, exact equilibrium computation in blockchain market games is likely infeasible at scale, forcing designers to rely on approximate or alternative equilibrium concepts.

Who is MIT OpenCourseWare on YouTube?

MIT OpenCourseWare is a YouTube channel that publishes videos on a range of topics. Browse more summaries from this channel below.

Does this page include the full transcript of the video?

Yes, the full transcript for this video is available on this page. Click 'Show transcript' in the sidebar to read it.

tilde`. - `p`, `q`: Buy `q` units of good `j` if the price is `p` or less. - `p tilde`, `q tilde`: Sell `q` units if the price is `p tilde` or more. - Players can bid to buy and sell all goods, even the same ones, at chosen prices. - The only constraint is that players cannot sell goods they do not possess in their endowment. - The full strategy space (S) is the combination of all player strategies. - An outcome (x) is the bundle of goods each agent buys or sells. - The game (gamma) includes

penalty (lambda) for players with negative credit at the end of a period. Players can buy goods without immediate funds, but if their purchases exceed their sales plus endowed money, they incur a penalty weighted by lambda.

Helpful resources related to this video

If you want to practice or explore the concepts discussed in the video, these commonly used tools may help.

Links may be affiliate links. We only include resources that are genuinely relevant to the topic.

Full transcript is not shown on this page

This page focuses on the summary and original notes. For full verification, refer to the original YouTube video.

PDF