Posted on Jan 18, 2023Read on Mirror.xyz

birth of twAML

This article will serve as the defining scripture on Pearl Labs Time Weighted Escrowing, and Average Magnitude Lock, colloquially together known as twAML. As twAML is a novel and complex system, the goal of this article is to help convey the research, design, and implementation of twAML, and its use cases within the Tapioca protocol.

The twAML whitepaper:

For the twAML whitepaper, click here.


When Pearl Labs began the development of TapiocaDAO in early 2022, one of the largest goals was to conceptualize a new economic growth model in DeFi. Why? Employing virtually any current incentive system would do nothing more than propagate models that are bound for failure. Tapioca needed to be the agent of change.

To summarize, our primary issue with liquidity mining is “receiving something for nothing.” Liquidity Mining chases TVL, which is not locked as LPs can withdraw at any time, nor is there arguably any value. Liquidity Mining programs effectively “spray and pray” reward tokens, hoping as many LPs as possible will rent out as much liquidity as possible to the protocol. You cannot sustain giving something for nothing, and at some point that something (incentives) will mirror the value of what's received in return, nothing- worthless*.* This leaves the protocol economically disabled.

Liquidity Mining in short is unsustainable, unprofitable, and highly paradoxical

Users of today demand real yield. Forks of years-old codebases made relevant by laughably high emissions are increasingly short-lived in relevancy. For a more in-depth history of liquidity mining and our research of current DeFi economic models, read our Nobel Degen Prize-winning research article, Death of Liquidity Mining

With Liquidity Mining’s obituary in the annals of time, we embarked on creating what would become twAML. 

The first step was to decide upon the broad goals of this new economic model:

  1. Sustainable Method to Stimulate Economic Growth: Incentives are typically dolled out with no mechanism of calculating the ROI (return on investment) of the incentive, or the impact on the token value of the inflation. Issuance happens haphazardly with no estimable price floor, as the tokens are dished out at the low price of free. Thus, all parties besides mercenary LPs quickly become diluted, creating a misalignment of interests. Incentive programs quickly become maintenance programs in attempts to retain the rented capital. Monetary death spirals generally occur from mercenary capital providers farming and dumping the incentives, leaving the system in a failure state- incapable of maintaining or recapturing its short lived glory. Lastly, these mechanisms have secondary effects of creating plutocratic governance systems.

  2. Near Positive Cost/Benefit of Economic Stimulus: Observing emissions as capital expenditures, fee generation as revenue, and liquidity in the treasury as assets on a balance sheet, we quickly noted the majority of DeFi protocols expenditures (emissions) far outweighed their revenues (fees), on-hand assets (treasuries), and tangible user base increases. Many protocols after years of operation with Liquidity Mining programs have found out the hard way that no real value was being created. Thus, Tapioca’s incentives needed to generate and create tangible value in harmony with TAP’s issuance/inflation.

  3. Promote & Reward Loyalty: Generally, participants who are loyal to the system get the short end of the stick, as mercenary capital providers reap all of the benefits. This is one tenet Vote Escrowing (ve) met by implementing loyalty tiers via CRV escrow durations. Lock for 4 years? Get one veCRV per CRV. Lock for 1 year? Get 0.25 veCRV per CRV, etc. The more loyal you are to Curve (via how long you’re willing to escrow for), the more you are rewarded.

  4. Create Protocol Owned Liquidity (POL): Protocols become highly dependent on token value to stabilize their ecosystem, and thus are fragile- being easily affected by external factors like the market sentiment. Capturing POL would enable Tapioca to be stabilized by itself, resilient from these external factors. 


With these goals in mind, we began the research stage. There were a number of existing systems that had properties that were crucial in conceptualizing Time Weighted Escrowing (tw) & Average Magnitude Lock (AML). Our central goal was answering the question: “What should be rewarded and how should it be rewarded?”

ve3,3’s lock position being represented as an NFT created a semi-liquid representation of an escrowed position. Quite literally an entire industry (liquid locking) was born out of this misstep of ve. This practice is highly beneficial as it keeps value within the system instead of with 3rd party liquid lock providers (such as Aura & Convex). Additionally, it allows the system to force the tokens to remain illiquid during the escrow (no early exits, which is self-defeating anyway), but allows for the creation of secondary markets to trade lock positions. Another interesting property of ve3,3 was the dynamic modulation of emissions- however, this mechanism being tied against veTKN lockup did not seem optimal to us.

OHM had many attributes that were crucial in the ideation phase of twAML. While the focus of Tapioca’s model is completely different from OlympusDAO, many OHM concepts remain novel and were important in the ideation for a new model- credit where credit’s due. Firstly, its incentives (bonds) being employed to create POL was and still is a groundbreaking concept, an incentive that is traded for real value- permanent liquidity. This would give the Tapioca DAO the ability to be its own capital provider and remove the need of renting liquidity altogether. This secondarily stops external factors from affecting system stability. Secondarily, OHM’s measurable price floor with RFV (Risk-Free Value) was yet another concept of great importance. Lastly, Olympus’s use of game theory was a second foundational concept- the ability to scientifically optimize a system is how real flywheels are made.

GMX, among the many other real yieldoors had many formative concepts, even though real yield shouldn’t be a feature but the norm. Through the real yield meme movement, we realized our lockers receiving ETH was much more effective than paying out lockers in TAP token(s)- there always must be a point that profit exits the system, just with as minimal negative impact as possible. It also creates an additional extrinsic motivation to lock, as ETH is undoubtedly the most attractive asset in DeFi. “Reflected Buybacks” may seem like a great idea to create consistent buy pressure on the incentive token in theory, however when distributed, these rewards are typically sold, and the system ends up in a net loss.

Vote Escrowing (ve) as aforementioned implemented a loyalty mechanism which was one of the few significant improvements in economic design in DeFi in the last several years. However, we didn’t like the fact that ve is static- in that, a one-year lock with an input of 1.00 CRV would always = 0.25 veCRV, two years = 0.5, four years = 1.0, etc. We wanted a system that was dynamic in that the free market would decide the value of time.

Convex & Aura’s offerings of staking Curve & Balancer LP sprouted a grander idea in answering the question of “what should be rewarded?”. We formulated the idea of adapting the escrow model to liquidity provision (think “veLP”). Being a money market, Tapioca needs sufficient liquidity reserves for borrowers to maximize the utilization of the system. Thus, the goal of our incentive program was incentivizing capital to not only be provided but locked as well (like if TVL was actually locked value- imagine that).

Through this research, the eight core tenets of our system were now in place:

  1. Generate POL

  2. Incentivize Capital Escrowing

  3. Provide Real Yield

  4. Semi-Liquid (NFT) Represented Escrow Position(s)

  5. Dynamic Response to Economic Activity

  6. Minimize Negative Impact of Stimulating Growth

  7. Sustainable Inflation

  8. Employ Game Theory


First, we needed to design the base token economy. We decided on a hard-capped / fixed total token supply. It’s easy to put a “soft cap” on a token supply and pretend the supply is capped until the incentive program ends to only continue infinite inflation, but you cannot turn this spigot off once it’s been turned on. This was observed with Compound’s COMP Rewards Adjustment Step Two Proposal- since mercenary capital providers controlled Compound’s governance, they cannot end the emissions as that would be against the self-interests of capital providers. 

The real reason however why most token economies require infinite inflation is that there’s no real value being captured. Once the emissions dry up in one way or another, the users and liquidity follow suit. We felt inflation must end at some point. We made the hard decision that if the inflation did not stimulate enough economic growth and value in the system (POL) by the time the incentives had run out, the system failed- no safety nets. Additionally, research has found fixed supplies scarcity is more attractive than non-fixed supplies to market participants, makes sense.

The next step was to design the issuance of TAP. Protocols like Convex have run into the problem of runaway inflation, in that CVX will hit its max supply cap earlier than expected…than what? We set a pre-calculated inflation schedule so that TAP could not be issued faster than what was predetermined. The inflation schedule would in actuality act as the maximum inflation schedule. We wanted to ensure issuance was done in a trade of intrinsic value, which would occur through the incentives themselves creating POL. If POL was not captured, TAP would not be issued.

We then sought to employ a “veLP” like system as to what the incentives would be issued for, so that Tapioca as a money market would always have deep capital reserves that could not be destabilized by external factors. Users would lend capital and receive a tOLP LayerZero ONFT reciept (Tapioca Omnichain Liquidity Provider Receipt). Users would then lock the tOLP, and receive incentives for each epoch their tOLP was locked. This serves to maximize the on-hand inventory for borrowers to utilize in the creation of loans, which in turn creates fees through debt repayments, borrowing fees, and yield performance fees. More liquidity = more revenue and more users.

On designing the incentive itself, we toyed with employing bonding as the incentive design for users escrowing capital, with bonding being the most well-known mechanism for creating POL. However, we quickly realized bonding was an inefficient solution. Bonds set no predictable price floor for the incentive, or an estimable trade of the capital provided for the expenditure of the incentives, as it’s a constant discount against the incentives’ market price. PoolTogether actually noted they had more sell pressure using bonding than regular liquidity mining. Bots were programmed to buy $POOL/ETH LP to obtain the discounted $POOL to be sold for a profit- it encouraged mercenary capital providers’ behavior even further. As PoolTogether notes, it would have been more efficient to OTC sell their tokens, or even to simply sell $POOL tokens on an AMM to generate POL.

The end goal of our issuance was to create enough POL that issuance was no longer necessary- Tapioca would thus become its own capital provider to its own LP pairs (using Arrakis vaults to manage the LP) as well as to Tapioca’s lending/borrowing markets. Lockers would share in fees generated from the platform, receiving Omnichain ETH (tETH) as the unit of reward. The DAO would always act in the best interest of itself, unlike mercenary capital providers. This stabilizes the Tapioca ecosystem from external factors. 

One question remained: how do we issue TAP to create POL if not with bonding?

A New Option:

On a chance evening, we stumbled upon Andre Cronje’s Keep3r Network’s Option Liquidity Mining (OLM), and the reward token mechanism was quickly cemented - call options. Call options are the right, but not the obligation, to purchase the underlying asset at a specified price (strike price = market price - discount) within a specified duration (one week in our case). If the market price of TAP were to fall from sufficient sell pressure, the call options would become OTM or out of the money (unprofitable) and would be left to expire. This minimizes the negative impacts of incentivization of economic growth. Call options also create intrinsic value when exercised. 

This also allowed us to reuse this system to create the first sustainable airdrop, in Tapioca’s “Call Option Airdrop”. Airdropping call options offer loyal community members an appreciable and estimable reward, and airdrop hunters' negative impacts are minimized.

This is when the name for our incentive program was created; DSO, or DAO Share Options, which was named after ESO, or Employee Stock Options. With ESO, rather than a company granting shares of their stock directly, the company gives derivative options on the stock instead. This is identical to DSO, except with lenders instead of employees, and tokens instead of stocks. 

In contrast, Liquidity Mining can be looked at as a call option with a 100% discount, and an infinite expiry. With call options, they set an estimable price floor, as TAP Price Floor = TWAP - Average Discount % per Epoch.

Due to non-circulating TAP only being injected into the supply through exercised call options, the preset inflation schedule becomes the max amount of TAP that can be redeemed each week instead of the actual amount of inflation that will occur. With the nature of call options going out of the money (unprofitable to execute) and having an expiration, this ensures we can issue incentives over a long time horizon due to TAP that is not redeemed through call options each week being held in the multisig to remain uncirculated.

While stumbling onto OLM was a eureka moment, there remained two distinct problems the OLM model did not solve

  1. Keep3r’s oK3PR’s redemptions were redistributed to lockers- meaning most of the liquidity captured from redemptions of call options went right back out of the system

  2. The discount and expiry were fixed- while the expiry we felt should be fixed, the discount being fixed we felt was inefficient- no dynamic modulation of the system during economic decline, growth, or stagnation.

The plan was set. We could easily reconfigure these call options, now known as oTAP* *to capture POL through a redirection of the redemptions to the DAO Treasury (to then be deployed into Arrakis Vaults). The Arrakis Vaults act as a decentralized market maker, and the DAO Treasury earns fees from the trading of its own tokens. If that’s not a flywheel, I don’t know what is.

Users would receive oTAP for each epoch their tOLP was locked. When a user would receive the call option (oTAP), they would redeem it OTC (over the counter) from the DAO- thus creating POL. The user then could choose to sell this discounted TAP on an AMM for a guaranteed profit, or escrow it to receive shares of protocol revenue (and governance). As ITM (in the money) call options, they could be viewed as a more attractive incentive than what liquidity mining offers, as the value of liquidity mining incentives can, and usually does rapidly fall, thus lowering the profit amount. With oTAP call options, users are receiving the ability to purchase TAP below its current market value- thus how it is a guaranteed and predetermined profit. 

The larger issue remained, the fixed discount of oKP3R. We wanted to create a system that dynamically modulated the discount to economic activity within it, and thus- the creation of the Average Magnitude Lock.


(no FBI, not money laundering)

As aforementioned, varying the call options discount was our motivation behind the creation of Average Magnitude Lock (AML). We first set two boundaries, a minimum discount of 5%, and a maximum discount of 50%. The expiry was left fixed at one-week epochs, as we felt weekly distributions were typical. When users lock their tOLP for any period of time they wish, the escrow duration and capital amount are measured by AML, which offers the appropriate discount level. This discount level is then locked in for the entire duration of the user's escrow period.

When the system is stagnating or declining (users stop escrowing liquidity), AML will offer higher discounts for lower time commitments to trigger growth. Conversely, when the system is experiencing economic growth (many users are escrowing capital), AML will lower the discount for the average escrow duration. Even during times when it may be a small time commitment to receive a large discount, a user would still be incentivized to lock longer than necessary to lock in the maximum discount for longer periods of time.

Thus, the modulation of the discount allowed us to modulate the reward size for any duration of lock time and capital amount used as an input. Users locking capital, or not locking capital, would “steer” the system's time reward ratio- serving to always offer an optimal reward level. AML was created to be easier to push higher than back down, to prevent manipulation from bad actors.

When many users are locking capital, the system will give smaller and smaller rewards to each subsequent user for the average time commitment. When few users are locking capital, the system will receive less in capital lock time, but give out larger and larger incentives (decaying) until it triggers users to begin locking new capital. Thus, the Tapioca protocol and its users are always in perfect harmony with one another's desires, and allocative efficiency is reached.

AML also implements an extrinsic motivation based on the human psychology of competition. Competition occurs from users competing over discount levels offered by the current average magnitude lock (AML). One study of competition found that nearly half of the people surveyed would rather make $50,000 in a world where the average salary is $25,000 than make $100,000 in a world where the average is $200,000; that is, they prioritize making more relative to other people rather than having a higher overall income. 

As this example outlines, humans are incredibly competitive. The ability for one user to receive a better reward than the subsequent user acts as a strong motivator in of itself.

For example, If Bob locks 100 usd0 for one year and receives a 30% discount, and Sally then goes to lock the same amount for the same duration and sees she’ll only receive a 15% discount, half of Bob’s, she is incentivized intrinsically and extrinsically (profit & competitiveness) to double her lock time to get the same discount as Bob.

This means, unlike most systems (like Liquidity Mining) where it is “Player vs. System,” AML creates a “Player vs. Player” environment that leads to higher efficiency through competition. This led us down a path Olympus once trotted, the path of game theory, and how best to optimize our mechanism in a scientific fashion.   

Game Theory 101:

To start, we first analyzed liquidity mining through the lens of game theory to scientifically determine where the core issue lies in Liquidity Mining, as Game Theory provides a mathematical way to compare the benefits of self-interest and cooperation. The goal of Game Theory is to study the behavior of decision-makers, called players, whose decisions affect each other. 

We quickly noticed that the dire issue with liquidity mining was it incentivizes all participants to employ a strategy of yield farming- a “pure strategy”. This pure strategy in Liquidity Mining is precisely what we observe in mercenary capital provider’s behavior. Supply Capital > Receive Rewards > Withdraw Capital & Sell Rewards

In a pure strategy, players adopt a strategy that provides the best payoffs. In other words, a pure strategy is one that provides the maximum profit or the best outcome to players. Therefore, it is regarded as the best strategy for every player in the game.

Unfortunately, this strategy is the worst outcome for the system itself.

OlympusDAO is well known for its effective employment of game theory with its memetic 3,3 mechanic, and thus we sought to analyze it as well. 

In Olympus, each “player” had three options: stake, bond, or sell:

If Ohmie One and Ohmie Two stake, +6 (+3,+3).

If Ohmie One and Ohmie Two sell, -6 (-3,-3)

If Ohmie One sells, and Ohmie Two stakes, 0 (-1, +1)

Under the microscope of game theory, we wanted to determine how Olympus accomplished its meteoric rise, and what caused its subsequent downfall. We quickly saw Olympus created a cooperative variant of the “Prisoner’s Dilemma,” featuring Nash Equilibrium

In economic theory, the Nash equilibrium is used to illustrate that decision-making is a system of strategic interactions based on the actions of other players. When players do not need to change their strategies, you have found the Nash Equilibrium. The Nash equilibrium is a part of game theory, and models economic behaviors that maximize outcomes for each participant.

The Prisoner’s Dilemma applied to economics is a scenario in which the gains from cooperation are larger than the rewards from pursuing self-interest. Thus, via cooperation between Ohmies, rewards are maximized and economic alignment is found. 

But what actually is the Prisoner’s Dilemma?

Prisoner’s Dilemma:

Let’s imagine that the police lack sufficient evidence to convict two prisoners. The police then simultaneously offer each prisoner a bargain: either testify against your accomplice and stay free, or stay silent and run the risk of betrayal and going to prison.

The possible outcomes in this scenario are:

Both Sam and Caroline snitch- 2,2 (both receive 2 years in prison with no vegan food)

Caroline betrays Sam, and Sam stays silent- 0,3 (Caroline receives 0 years in prison, Sam receives 3 years in prison and is called a simp)

Sam and Caroline stay silent- 1,1 (both receive 1 year in prison and lose their Adderall prescriptions). 

Look familiar?

Unlike the prisoners in our hypothetical game, OHM stakers can communicate- meaning they can theoretically reach a consensus and continue cooperating (staking) because that is the most optimal action for everyone to take. By staying staked (3,3), OHM holders are essentially cooperating to withhold OHM supply from the market, therefore raising the OHM price and increasing OHM’s market capitalization.

Therefore, the premise of 3,3 is if all users cooperate and stake, and no users sell- everyone will definitely become rich.

So, why didn’t they? 

“Ohmies Dilemma”: 

The Prisoner's Dilemma is a counterintuitive decision-making paradox. The rational decision is to blame the other prisoner in an act of self-interest, while the optimal decision is for the prisoners to cooperate and remain silent in an act of collective interest. However, individuals will almost always act in self-interest, and will rarely choose the optimal strategy.

Applying this to 3,3- during the beginning of the game, profit motivation to sell was small, thus participants' self-interest would be meaningfully aligned with the system to cooperate and drive the value of OHM up through staking (3 + 3 = 6).

However, as participants continued choosing the optimal choice of staking, the potential profit grew and grew. Thus, it became more and more profitable for players to deviate strategies, and act in self-interest to sell. (-3 + -3 = -6).

“But I thought the Prisoner’s Dilemma and 3,3 found Nash Equilibrium and Nash Equilibrium would be lost if it became better to deviate strategies?”

Correct, thus a second Game Theory concept, Subgame Perfect Nash Equilibrium (SPNE). A Nash equilibrium is said to be subgame perfect only if it has Nash equilibrium in every subgame of the game. While Olympus, like an infinitely repeated Prisoner’s Dilemma, achieves Nash Equilibrium, Olympus fails to achieve SPNE like the Prisoner’s Dilemma, in that, as the game goes on into many sub-games, it becomes better to deviate strategies- acting against the interest of the collective and OHM itself, and to act in self-interest (sell, or -6).

Pareto Optimal:

When applying game theory to situations, like the Prisoner's Dilemma, sometimes Game Theory yields outcomes that are not optimal, thus why it is a dilemma- there can be better outcomes that theoretically provide better payoffs to both players. There are several ways to observe that the Nash Equilibrium in OlympusDAO (and the Prisoner’s Dilemma) are strictly Pareto Inefficient. 

An outcome is Pareto Optimum if you cannot find another outcome that simultaneously improves the payoffs of both players. As already pointed out, the solution of cooperative staking (+6), (which also corresponds to Nash Equilibrium), does not constitute a Pareto Optimum insofar as the two Ohmies would achieve a better result if they were to betray the collective and sell (-6) during later stages of the game, just like both prisoners would have a better outcome individually by snitching, which is what was observed in the “real life game of OHM”.

Thus, the ultimate goal behind twAML was for it to focus on achieving a level of Pareto Efficiency to maximally align players and the system itself, ensuring all participants receive outcomes that improve the payoffs of all actors (and the system itself).  

Pareto efficiency implies that resources (in our case, incentives) are allocated in the most economically efficient manner, but does not imply fairness. An outcome is Pareto efficient if there is no other outcome that increases at least one player's payoff without decreasing anyone else's.

Thus, with twAML, when one player chooses to escrow their capital for the duration required to maximize their incentives (oTAP) discount level, the next player applying the same escrow arrangement will receive half the reward as the player before, and this is observed again and again in sub-games. This is a variant of Rubinstein’s Bargaining Model*.*

Both the optimal (collective outcome strategy) and rational (self-interested strategy) is to lock enough capital for the amount of time necessary to receive an equitable reward. Therefore, twAML also reaches subgame perfect Nash Equilibrium.

When the lock time becomes perceived as too long to receive a reward level that is perceived as equitable, or in more scientific terms when the system is no longer allocatively efficient, the system will “decay” or decrease the lock time required to receive an equitable reward until allocative efficiency is once again reached. What users view as an equitable reward individually does not matter, the collective always decides what is in the best interest of themselves and the system itself.

As Game Theory is incredibly complex and would require an extremely verbose explanation to fully explain twAML’s basis in it, check out:

Perfect Equilibrium in a Bargaining Model by Ariel Rubinstein.

Time for Time Weighted Escrowing:

twTAP, or time-weighted escrowed TAP, also employs AML (our Average Magnitude Lock) like oTAP, with one difference. The boundaries are not 0.05 to 0.50, as in the maximum and minimum discounts seen in oTAP, but 0.10 and 1.0. This is the ratio of twTAP received for an input. twTAP Output = AML (TAP Amount + Time Duration).

In Curve’s Vote Escrowing (ve), if a user locks CRV for 4 years, they’ll receive 1 veCRV for each CRV locked. If the user instead locks for 1 year, they’ll instead receive 0.25 veCRV for each CRV input. The user’s veCRV balance decays linearly until the completion of the lock, at which point they will have zero veCRV. Curve’s veCRV allows users to receive shares of fees, and participate in multiple forms of governance, such as Gauge voting and Snapshot voting.

We felt applying AML instead of fixed values would offer much higher efficiency for twTAP. Thus, If Tapioca’s protocol revenue was high, users would be incentivized to lock TAP, in turn steering AML to the lower boundary of 0.10 twTAP per TAP locked. If protocol revenue was low, users would be incentivized to lock as AML would be steered to the maximum boundary of 1.0 twTAP per TAP. 

Imagine if, during the height of the Curve Wars, you had to lock longer than four years to get the best outcome. Then during periods of stagnation, like the current bear market, you could lock shorter amounts of time to get the best outcome. That’s the point of twTAP.

In short, what if users were willing to lock longer because there was so much value in the system? Or, what if there was so little value in the system that these fixed values were unattractive? This elasticity would beget higher economic efficiency.

twTAP would also be transferable and represented by a LayerZero ONFT-721 (like oTAP). This allows for the creation of secondary markets to trade lock positions but forces the underlying TAP to remain illiquid for its escrow duration. This system additionally offers voting power for loyalty, the more loyal you are to Tapioca (in lock time), the more voting power you receive.

twTAP also offers a constant balance, in that a user’s twTAP share will not diminish over time like ve, or increase like ve3,3. At the end of the lock, the NFT will burn, and the user will receive the original TAP balance back.


After a year of development into Time Weighted Average Magnitude Lock (twAML) and DSO (DAO Share Options), 0xRektora and I feel we have conceptualized and developed a full-scale revamp of the economic modeling in DeFi. twAML meets the goals of offering a sustainable and cost-effective approach to economic growth stimulation that retains economic alignment of all participants, plus a democratic and loyalty-based governance system, and the first airdrop mechanism that frankly doesn’t suck.

I hope the time you waited was worth it! (sorry, I had to)

Pearl Labs Member #0, twMatt, signing off.


Follow TapiocaDAO:

Discord Twitter Docs