Go to the Trade page and connect your wallet. If you have VNL v1.0 tokens you should see a banner at the top of the page. Click on "Convert Now" to start the migration process.

More detailed instructions can be found here.

Vanilla is a meritocracy of the best investors. Investors who make profitable trades through Vanilla Trade receive VNL governance tokens and thus increase their influence over the network.

We hypothesize that a dynamic meritocracy will consistently outperform any other governance system.

Profit mining is a novel token distribution mechanism, where you "mine" VNL tokens by making a profit calculated in ETH. The more profit you make and the longer you've held your positions before selling, the more VNL you mine. Mining difficulty also increases over time, making early mining more lucrative.

You can see which tokens are eligible for profit mining on the Trade page.

Simply go to the trade page, choose a token and execute the purchase with ETH using Metamask or WalletConnect. The Vanilla contracts will execute the purchase on Uniswap and the tokens will be stored in the Vanilla smart contract. You can sell the tokens at any time to claim profit mining rewards and once sold, the ETH, including any profit you've made, will be returned to your wallet along with the VNL tokens you've mined.

Not right now. We will be adding this capability in the future, but it makes calculating profit mining rewards more difficult so we have left it out of scope for now.

Yes. VNL is the native asset of the Vanilla ecosystem. VNL is created by profit mining and is used for governance of the protocol.

No. The entire initial supply of VNL was created via profit mining by the community. Later the community collectively decided to fund the VanillaDAO alongside the Vanilla v1.1 launch by minting an amount equal to 15% of total supply to the Vanilla Treasury.

Vanilla was developed by Equilibrium and the initial smart contracts were deployed by an anonymous community member to the Ethereum blockchain.

The Vanilla system has been security audited extensively by Peckshield and Least Authority and there is an active bug bounty, but it is still experimental beta software as with most things built on Ethereum. We take the safety of your funds extremely seriously, but perfect security doesn't exist so tread carefully.

Yes. Most of Vanilla's contract logic is non-upgradable and thus can't be changed by anyone. The only exception to this is the dynamic safelist which is controlled by the VanillaDAO.

The VanillaDAO is a community controlled 4-out-of-7 ethereum multi-sig wallet, which hosts the VanillaDAO treasury and is used for deploying some parts of the Vanilla protocol. Equilibrium controls 3 of the 7 signers and the remaining 4 signers are the largest VNL holders from the community who volunteered.

No. Vanilla incorporates a dynamic *safe-list* of tokens, which is controlled by the VanillaDAO and defines the ERC-20 tokens that are eligible for profit mining rewards. The safelist allows the community to ensure that only legitimate tokens with enough liquidity can be traded through Vanilla Trade.

To calculate mining rewards in trade `i`

which sells tokens, Vanilla uses the following algorithm:

$R_{i}=P_{i}∗H_{i}$

where

- $R_{i}$ is the amount of VNL reward the trader gets.
- $P_{i}$ is the amount of rewardable Ether profit made in the trade.
- $H_{i}$ is the
*Holding/Trading Ratio (Squared)*

Absolute profit is determined by the positive difference of how much WETH the trader used to buy tokens and how much WETH the trader got back when selling those tokens. For example, buying 1000 USDC with 1 WETH, and selling them all for 2 WETH would equal 1 WETH profit.

To calculate the profit of the trade, the Vanilla contract must keep track of the purchase price. However, if the trader buys 1000 USDC for 1 WETH, then 1000 USDC for 0.5 WETH, and finally sells 1500 USDC for 1.5 WETH, what is the profit? Unfortunately, the traditionally used pricing conventions (FIFO and LIFO) are impractical to implement in smart contracts due to the gas costs of keeping track of all purchases. Instead, Vanilla uses a *Weighted Average Exchange Rate* to maintain the average purchase price for all token inventory in a fair and gas efficient way.

Weighted Average Exchange Rate after `i`

trades is calculated using two variables, ($E_{i}$) which represents the adjusted sum of WETHs used in trading and ($T_{i}$) which represents the trader's token balance.

When buying $Q_{token}$ tokens with $Q_{eth}$, Vanilla updates the variables as:

$T_{i}E_{i} =T_{i−1}+Q_{token}=E_{i−1}+Q_{eth} $

When selling $Q_{token}$ tokens for $Q_{eth}$, Vanilla calculates the absolute profit as:

$P_{i}=max(Q_{eth}−T_{i−1}Q_{token}∗E_{i−1} ,0)$

and updates the variables for the next trade as

$T_{i}E_{i} =T_{i−1}−Q_{token}=T_{i−1}E_{i−1}∗T_{i} $

For reference, the quote for the average purchase price is calculated simply as a ratio of the two variables:

$price_{i}=E_{i}T_{i} $

Finally, the rewardable Ether profit is calculated as the positive difference of average purchase price and the rewardable price.

$P_{i}=max(P_{i}−price_{i},0)$

Price manipulation is one of the biggest risks for VNL value. If a malicious trader can manipulate the token's ETH price in Uniswap at will, then they can easily rig the VNL supply. Price oracles are commonly used to mitigate this.

Uniswap v3 introduced robust price oracles which enable the pool to store variable amount of price observations on-chain. Integrating smart contracts can then use the observations to calculate a time-weighted average price (TWAP) across a time interval. Larger the time interval, the costlier it becomes to manipulate the average price.

The *observation cardinality* is the maximum number of the price observations in the Uniswap pool. Growing it requires someone to pay the fees and it's not incentivized in any way, which is probably why many pools still have the initial cardinality 1. When the cardinality is 1, it effectively means the pool doesn't keep enough price observation history to calculate any robust price average.

Vanilla uses the pool oracle in profit mining calculations to compute a TWAP across a 5-minute interval, which is the *rewardable price* $P_{i}$. If the pool doesn't have enough observations to compute the full 5-minute TWAP, then the rewardable price is weighted proportionally based on longest available TWAP interval ( $P_{i}$ across $t$ seconds):

$P_{i} =300P_{i}∗t+price_{i}∗(300−t) $

If the price observation history is not available at all (i.e. observation cardinality = 1), then the rewardable price will equal to the average purchasing price, meaning there's no rewardable profit and VNL will not be rewarded. This is also why the cardinality warning is displayed in the trading UI.

For each token you trade, Vanilla maintains the *Weighted Average Purchase Block* (WAPB) or $B_{i}$.
The WAPB after $i$ trades is calculated by using two variables, $A_{i}$ which represents the token-volume weighted sum of block numbers of the purchases and $T_{i}$, which represents the trader's token balance, used already in Weighted Average Exchange Rate- calculations.

When buying $Q_{token}$ tokens in a block number $B_{i}$, Vanilla updates the $A_{i}$ as:

$A_{i}=A_{i−1}+Q_{token}∗B_{i}$

When selling $Q_{token}$ tokens, Vanilla updates the $A_{i}$ proportionally to token balance change as:

$T_{i}A_{i} =T_{i−1}−Q_{token}=T_{i−1}A_{i−1}∗T_{i} $

The Weighted Average Purchase Block is then calculated as a ratio of these two variables:

$B_{i}=T_{i}A_{i} $

Knowing this average block, The Holding/Trading Ratio (Squared) is calculated as:

$H_{i}=(B_{sell}−B_{epoch}B_{sell}−B_{i} )_{2}$

where

- $B_{sell}$ is the block number, when a sell-transaction happens.
- $B_{epoch}$ is the immutable
*epoch block*12134736, in which the Vanilla contracts were deployed to the mainnet.

The Holding/Trading Ratio (Squared) component can be interpreted as a ratio of two times:

- Nominator $B_{sell}−B_{i}$ is the
*holding time*, the number of blocks the token has been held before selling. Keeping the trade open longer will yield higher rewards. If the duration is zero, i.e. the trade is closed in the same block it was initiated, the profit will be zero. This ensures that no flash loan attacks can be carried out. - Denominator $B_{sell}−B_{epoch}$ is the
*total trading time*, the number of blocks the Vanilla system itself has been operational. The total trading time will always increase.

In other words, the Holding/Trading Ratio (Squared) is just a ratio of times: The time the trade has been open compared to the time the system has been open. The times are measured in Ethereum blocks.

The following charts and tables depict simple heuristics of the incentive mechanisms. In all heuristics we vary one input in the VNL reward formula while keeping the other inputs unchanged and plot the amount of VNL in each case.

The first case observes the VNL attribution as a function of profits. We keep the Holding/Trading Ratios constant and inspect what happens to the attributed VNL. As we increase the sell price of the trade, while keeping the WAER constant, our profits increase. As profits increase 5-fold from 2 ETH to 10 ETH or 10-fold from 2 ETH to 20 ETH, there is a linear relationship with the increase associated with the VNL reward.

The second case observes the VNL attribution when we keep profits constant, but vary the Holding/Trading Ratio (Squared). The ratio is determined by how early the trader is participating in the Vanilla system and how long they are keeping their positions before closing them. The following chart depicts a case in which we vary the sell block number and keep the weighted average block constant.

We can easily see that when the Holding/Trading Ratio (Squared) increases from 25 % to almost 100 % (factor of 4) also the VNL rewards increase accordingly.

A trader can increase VNL rewards by:

- Making higher percentage returns on his trades or trading larger ETH positions, i.e. making higher absolute ETH returns -> Higher profit component $P_{i}$
- Opening trades early as possible -> Higher Holding/Trading Ratio (Squared) $H_{i}$
- Holding the trades longer -> Higher Holding/Trading Ratio (Squared) $H_{i}$