Applied Game Theory & Prediction Markets — The Future of DeFi

Rahul Rai
Gamma Point Capital
9 min readJan 28, 2021

--

Photo by Ravi Kumar on Unsplash

Disclaimer:

  1. The above reflects the views of the investor and should NOT be construed as investment advice, financial advice or legal advice.
  2. This information is purely educational and is NOT meant to be taken as a recommendation to buy or sell any product or service. Please do your own research before making any decisions.
  3. Where relevant, direct quotes & passages have been taken from the sources, whitepapers, and blog posts mentioned.

A recent wave of Decentralized Finance (DeFi) protocols have cleverly combined game theory based incentive & coordination mechanisms with prediction markets to enhance liquidity and enable free-market price discovery.

In this post, we’ll dive into four protocols in particular — Keeper DAO, Numerai, Charm and Cover. Each of these protocols leverages game theory and/or prediction markets and showcases the immense power of these simple concepts.

Keeper DAO

Whitepaper: https://github.com/keeperdao/whitepaper
Image Sources (where not specified): https://medium.com/keeperdao/introducing-keeperdao-an-on-chain-liquidity-underwriter-dbb63731f4a5

KeeperDAO is a game-theory protocol designed to capture the maximum possible on-chain profit through arbitrage and liquidations. Priority Gas Auctions (PGA) gambits cause keepers to engage in a “race to the bottom”, with incremental bids diminishing profits to zero. As an alternative to minimizing profit by competing with each other, KeeperDAO incentivizes keepers to pool their liquidity and share their profits.

The Queen’s Gambit is one of the oldest known chess openings. A gambit (from ancient Italian gambetto, meaning “to trip”) is a chess opening in which a player sacrifices material, with the hope of achieving a resulting advantageous position. Source: https://bit.ly/2VruE8x

Before we deep dive into it, let’s briefly go over some important topics.

Mempool
A mempool (a contraction of memory and pool) is a cryptocurrency node’s mechanism for storing information on unconfirmed transactions. It acts as a sort of waiting room for transactions that have not yet been included in a block.

In Ethereum is a Dark Forest, a blog post written by Dan Robinson and Georgios Konstantopoulos, they highlight how deadly arbitrage bots that lurk on the Ethereum blockchain mempool can actually be.

“If the chain itself is a battleground, the mempool is something worse: a dark forest.”

Miner Extractable Value (MEV)
MEV is a general term for profit that can be extracted by miners. This extraction can happen when miners reorganise blocks, reorder transactions, front-run, and tailgate.

Flashboys 2.0
Flashboys 2.0 is a fantastic paper that highlighted front-running, transaction re-ordering, and consensus instability in decentralized exchanges. They document and quantify the widespread deployment of arbitrage bots, that engage in priority gas auctions (PGAs), competitively bidding up transaction fees in order to obtain priority ordering for their transactions.

Now back to Keeper DAO. By incentivizing collaboration, KeeperDAO is able to avoid the wastefulness of gas wars and maximize the profit for all participants. Liquidity providers are also able to deposit liquidity and share in the profits generated by keepers. And for those that do not cooperate, its grim-triggering strategy is guaranteed to erase all profitability.

Grim-triggering is an adversarial PGA strategy where if the pool detects another bid on the same liquidation/arbitrage, it will grim trigger by setting the gas price to the value such that the liquidation opportunity would no longer be profitable for anybody.

Assumptions

  • There is one competitor for a liquidation opportunity.
  • The liquidation opportunity has a maximum payoff of M.
  • If the competitor joins the pool, there will be n parties that a liquidation profit will be shared amongst.
  • The pool can respond to external gas bids with delay Δ.

The block time D is exponentially distributed with rate parameter λ=0.1 (this corresponds to the average block time of Ethereum being 12.5 seconds).

Let’s consider the case that the competitor competes with the pool. The only way that the competitor can make money is if they bid and the block is mined before the pool can react and grim trigger.

The payoff for the competitor, which we will assume submitted a bid at time t, in this instance would be M times the probability that the block gets mined before time t+Δ. For an exponential distribution, this probability is

Thus the expected payoff is

Now, if instead, the competitor joined the pool, it would simply get an equal share of the maximum payoff, and hence the expected payoff is

We are interested in the case that this latter payoff is greater than the former; in this case, it makes more sense to join the pool than to compete against it. Solving this inequality for Δ gives:

Alternatively, we can solve for n:

As an example, if Δ=100ms, then it is more profitable for the competitor to join the pool if there are not more than 100 parties in total sharing in the profits.

To conclude, any competitor to KeeperDAO faces the bleak reality of the grim trigger. There are theoretically only 2 outcomes: either nobody makes a profit again or everyone joins the system.

Numerai

Medium: https://medium.com/numerai/building-the-last-hedge-fund-introducing-numerai-signals-12de26dfa69c
Image Sources (where not specified): https://numer.ai/whitepaper.pdf

Numerai is an AI-run, crowd-sourced hedge fund. At its core, Numerai incentivizes the creation of signals with predictive orthogonal components — the original part of the signals that we don’t already have. Numerai rewards people how the market should reward them: for the marginal predictive value of the non-redundant component of their signal.

Source: Numerai

The primary issue with any machine learning competition is intentional overfitting. Numerai solves this problem by introducing a new ERC-20 token called Numeraire (NMR), which data scientists can stake in amounts proportional to their confidence level in their model to compete in tournaments.

An overfitting curve where the test error continues to decrease with more submissions from data scientists, but the error on new data increases.

Every tournament has a staking prize pool, which is some fixed number of dollars. Data scientists can submit bids to the auction. Bids are tuples (c, s) where c is confidence defined as the number of NMR the data scientist is willing to stake to win 1 USD and s is the amount of NMR being staked.

For some time t, s is locked in the Ethereum contract and is inaccessible to anyone, including Numerai. Performance is evaluated after time t, and its evaluation metric is logloss, a suitable metric for binary classification problems like Numerai’s machine learning competition.

A model is considered to have performed well if logloss< -ln(0.5), and badly if logloss > -ln(0.5). The data scientists are ranked in descending order of confidence until the prize pool is depleted; data scientists are awarded s/c dollars if their models performed well or they lose stake s if they perform badly. Once the prize pool is depleted, data scientists no longer earn dollars or lose their stakes.

Analysis of Staking
Let p be the probability that the model achieves logloss < -ln(0.5) on new, unseen data. A low p would imply a high probability that a model is overfit. Let s be a data scientist’s total Numeraire staked. Let e be the exchange rate of Numeraire per dollar. c is the confidence.

A data scientist will stake Numeraire if the expected value of staking Numeraire is positive. The expected value in dollars of staking s with confidence c is

A data scientist will stake if

This implies

This result speaks for itself. The beauty of this game theory based coordination incentives is that solely in the interest of maximizing winnings, they move participants to reveal their true knowledge of their models’ abilities to generalize to new, unseen data. Brilliant.

Cover

Whitepaper & Image Sources (where not specified): https://www.coverprotocol.com/Cover%20Product%20Paper.pdf

Cover leverages prediction markets to provide peer to peer coverage with fungible tokens, allowing the market to set prices.

Fungible cover tokens are created and maintained on a 1:1 basis with their collateral when a user deposits collateral into a Cover smart contract. Each Cover contract specifies the protocol to be covered (eg. Curve), the preferred collateral (eg. DAI), the amount to deposit, and then the expiration date of coverage.

For each DAI deposited the user receives 2 tokens: a CLAIM token and a NOCLAIM token. The NOCLAIM token represents rights to receive the deposited collateral in the event that a claim payout is NOT awarded during the designated coverage period. The CLAIM token represents a right to receive the deposited collateral (or a fraction thereof) in the event that a claim payout is awarded by the claim’s management process.

Source: Whitepaper

There are three types of participants in the Cover Protocol market: Market Makers (MMs), Coverage Providers, and Coverage Seekers. Market makers hold both CLAIM and NOCLAIM tokens and provide liquidity for both fungible tokens. Coverage providers hold and provide liquidity for only NOCLAIM tokens. Coverage seekers hold only CLAIM tokens. The goal is to cover the exposure to the protected product.

Both the CLAIM and NOCLAIM tokens can be deposited into Balancer pools (or any AMM/ centralized exchange). This allows liquid markets, with free price-discovery of the fair value of protection, and allows MMs/ LPs to accrue fees on the deposited tokens.

Charm

Litepaper: https://www.notion.so/Charm-Litepaper-92c6ce47ec804cfe925549ac2c814fd3

Charm is a decentralized options protocol that leverages the LS-LMSR (liquidity-sensitive logarithmic market scoring rule)prediction market AMM.

The method consists of two steps:

  1. Take a pair of options whose payoffs sum up to a fixed amount.
  2. Use a prediction market AMM to create liquidity for this pair.

Step 1 pairs up options which are negatively correlated and whose liabilities can be matched up with each other. The property that their payoffs sum up to a fixed amount means they can be viewed as a prediction market — a market where prices correspond to probabilities that sum up to one.

The elegance of this is that the LS-LMSR sets the price purely based on supply and demand and doesn’t rely on a fixed formula like Black-Scholes.

How the LS-LMSR Works
Let’s consider the case of a covered call option the same underlying asset, strike price K and expiration date. The payoffs of these two options are guaranteed to sum up to the underlying price S.

Pairs of call and covered call options with the same strike/expiration can therefore be viewed as a prediction market since their payoffs sum up to one (in terms of the underlying).

The price quoted by the LS-LMSR only depends on q1 and q2, the current total supply of call options and covered call options with the same strike/expiration. The price can be described by the following cost function, which determines the amount of the underlying held by the AMM given q1 and q2:

Users can buy options by paying the underlying to the AMM. The cost of the incremental amount of options can be represented as:

Overall, these new waves of protocols exemplify Ethereum’s core values — coordinating diverse and untrusting participants on a global scale. As DeFi continues to scale, we are likely to see more protocols like these come up that enforce powerful coordination mechanisms through game theory based incentives and leverage prediction markets to increase liquidity and enable free-market price discovery.

--

--

Rahul Rai
Gamma Point Capital

Finance, Tech, Crypto. Formerly FX at Morgan Stanley. Wharton ‘19.