Diving into Velodrome, the Feature-Rich & Aesthetic DeFi Hub of Optimism

Mackenzie Patel
Mackenzie Patel
save time
August 23, 2023

Related articles

Browse all articles

Diving into Velodrome, the Feature-Rich & Aesthetic DeFi Hub of Optimism

August 23, 2023
DeFi

Here at Hash Basis, getting into the knots of a new protocol is our idea of a marvelous time. We recently went deep into Velodrome, a leading automated market maker (AMM) on Optimism. Besides having brilliant branding (the rainbow ring icon is 🔥), Velodrome is intuitive, cleverly structured and a public good for the Optimism ecosystem. As of mid-August 2023, the TVL is around $198m, and there are ample pool options for all types of DeFi users.

Our goal was to deconstruct the guts of Velodrome into its accounting & tax events - we’re talking swaps, liquidity providing, locking governance tokens, “bribing”, etc. So we gathered all of our loose tokens, used Hop Exchange to bridge them over to Optimism and started experimenting. 🧪

There are two types of native tokens on Velodrome:

  • VELO - the ERC-20 utility token
  • veVELO - a governance NFT that represents locked VELO on the protocol (“ve” stands for “vote-escrowed”)

They play different roles in terms of rewards and voting power, but they both contribute to the streamlined, interlocking ecosystem that is Velodrome.

Note: Velodrome just upgraded from v1 to v2, and this article is covering the current v2 state. Read more about the protocol redesign here.

Swaps

The first interaction a user is likely to have with Velodrome is the swap feature. Similar to Uniswap or Sushiswap, the user can choose what token they want to swap into (and for Velodrome specifically, they support Optimism-based tokens like OP, LDO and ACX). Even though the feature is a basic cornerstone of DeFi, Velodrome also includes transparency into the sequencing of swap events. The slippage, exchange rate and minimum tokens to receive are displayed in a “next steps” panel to the right:

An example of what a swap transaction looks like on optimistic.etherscan can be found here (4 VELO swapped for 0.213 OP).

Accounting & Tax Treatment for Swaps

On the accounting side, a swap of two tokens gives rise to a gain or loss equal to the difference between the current price (FMV) and cost basis of the token being swapped. It’s easiest to view in journal entry form:

Debit Digital Assets → USD value of 0.2134 OP
Debit/credit Gain or Loss → USD gain or loss depends on the cost basis and FMV,
calculated by your crypto subledger
Credit Digital Assets → Cost basis of 4 VELO

It’s a similar calculation on the tax side: FMV - cost basis = a taxable gain or loss. An important concept here is the cost basis methodology. Whatever method you choose (i.e. FIFO, LIFO, Spec ID) will determine the amount of gain or loss you are able to claim on your return (more info on cost basis methods here).

Liquidity Providing

Liquidity pools go hand-in-hand with swap functions since it allows the user to earn a yield on their assets while still retaining control over them. The simplified token flows for LPing on Velodrome are:

  • Use the swap feature so you have a pair of tokens (i.e. the “underlying pair”)
  • Deposit the pair of tokens into the relevant liquidity pool (i.e. VELO / OP pool) and receive an LP token in return
  • Stake the LP token into a gauge
  • Earn rewards in VELO (the “emissions”)
  • Once you’re finished LPing, you can unwind your position and receive the underlying tokens back (likely at different amounts)

There are a few important terms to define here:

  • Gauge: a farming smart contract that accepts deposits of LP tokens
  • Emissions: the rate at which a project distributes its native tokens as rewards to users

In exchange for providing liquidity to a pool, LPs receive emissions (rewards) in VELO. This VELO is freely transferable and can be swapped, locked into the veVELO NFT or used in another pool.

Velodrome has a flexible liquidity pool interface and allows the user to toggle between different LP pool conditions (i.e. active, stable, volatile, incentivized, low TVL, etc). This makes it easy for users to see which pools are offering the best rates (often the volatile pools since they carry higher risks & rewards) and which ones are less desirable. And if you don’t see your preferred pool in the UI, you can create your own pool with a few clicks:

What the heck is the BOB token?!
Accounting & Tax Treatment for Liquidity Providing

Although there’s no official guidance from the FASB or IRS on how liquidity providing should be treated, there are generally accepted treatments.

On the accounting side, the deposit of the pair and receipt of the LP token is typically treated as a trade (identical to the swap accounting above). In this v2 example, 25 VELO and 0.00115 WETH are deposited in exchange for 0.1696 vAMMV2-WETH/VELO (a long-winded way of saying “LP token”).

The deposit of vAMMV2-WETH/VELO into the gauge is an internal transfer from the liquid wallet into a “staked position”. There’s no gain or loss associated with this movement since we’re keeping this position on our balance sheet. The VELO rewards are treated as income either when claimed or earned (depending on your accounting policy of cash versus accrual basis). The accrued rewards can be viewed on the Dashboard tab under the "Liquidity Rewards'' section:

Debit Digital Assets → USD value of 0.1184 VELO
Credit LP Income → USD value of 0.1184 VELO

On the tax side, the gain/loss is capital and any claimed VELO rewards are ordinary income (taxed at the FMV at the time of claiming). An example claim of VELO tokens looks like this (check the logs for the ClaimRewards function):

Locking VELO & Voting

Once you’ve earned VELO from liquidity providing, the next step is to “lock” your VELO into the protocol and receive veVELO (an ERC-721 NFT, also called a veNFT) in return. The NFT represents the VELO you have locked and the duration of time it’s being locked for. It also determines your “voting power”, which is proportionally increased by locking your VELO for a longer period of time. Users can lock VELO anywhere from 3 days to 4 years, with the 4-year lock giving you 100% voting power of what you locked (i.e. if you locked 5 VELO for 4 years, your voting power is 5 VELO. However, if you locked 5 VELO for 1 year, the voting power would decrease to 1.25 VELO).

Velodrome separates time into epochs, which are roughly seven days. Each epoch, holders of veNFTs can vote for various liquidity pools and decide how emissions will be distributed amongst those pools. Voting also allows veNFT holders to get a cut of transaction fees and incentives (more on those below). The transaction fees are earned in the underlying pair of the pool, so for the VELO / OP pool, voters will receive rewards in VELO and OP, in addition to any incentives that are posted by other users.

A quick note on locking VELO - it’s extremely flexible and new locks can be opened or existing locks amended at any time. For example, I opened two locks with small amounts of VELO, but I can choose to increase my voting power for either by depositing more VELO.

Accounting & Tax Treatment for Locked VELO

There’s no clear guidance on this (the theme for this article!), but in reconstructing the token flows, we can arrive at a reasonable truth.

When locks are created, VELO leaves the users wallet and in return, a veNFT is minted:

However, similar to protocol staking, the underlying VELO is still owned by the user. It’s simply converted into a “locked” form that takes on new abilities like voting and earning rewards. On the block explorer, you can also see the exact index of the NFT that you own - in my case, my unique veNFT is the 16,156th one that has been minted so far.

On the accounting side, there’s not a straightforward treatment. The send of the VELO and mint of the NFT could be construed as a trade, but we would want nonrecognition of the gain/loss if we’re saying we still own/have rights to the underlying VELO (i.e. the veNFT would take on the cost basis of the VELO so gain/loss = $0). In that case, the treatment is similar to depositing a LP token into a gauge.

After creating the initial lock, more VELO can be added to the lock to increase its voting power (so the user can earn more fees and incentives for more pools). In this example, my wallet is adding 1 VELO to my existing lock through the Increase Amount function.

The logs contain how much is being deposited, the amount of time the VELO is being locked, the veNFT index that is affected, and the new supply of veNFTs. The logs can get hairy (especially with the v1 to v2 upgrade), so here’s a Loom video that dissects them in more detail.

Adding more VELO to the lock is also an internal transfer from the main wallet to a “staked” wallet that we’re artificially creating on the balance sheet (no gain or loss recognized). The final accounting piece is the rewards earned via transaction fees and incentives. These are booked as LP income as the rewards are accruing in the dashboard (see the Claim Fees function).

Tax is more straightforward: rewards are treated as ordinary income when claimed and the creation/addition to locks are nontaxable (since we’re going with the internal transfer treatment). In Koinly, the crypto tax software we’ve used for Velodrome, we use the “send to pool” treatment to reflect the VELO that is tied up in the NFT:

This treatment creates a “virtual pool” wallet in Koinly that represents the underlying VELO.

Incentivizing / Bribing

Deemed “bribing” in v1 and “incentivizing” in v2, this feature oils the machine of liquidity pool voting and emissions. The app says it best:

“By providing incentives for a pool, you may drive more votes towards it. Votes are a decisive factor on how much emissions a liquidity pool will get next epoch. The more emissions are flowing to a liquidity pool, the more rewards for those who provide liquidity for the pool.”

Incentives are extra rewards that are posted for a given pool and distributed to its voters. The more votes received, the more emissions (aka VELO rewards) that are allocated to LPs. The incentive must be added during the current epoch to be distributed when the epoch concludes and has to be an ERC-20 token (so plain ETH can’t be a bribe).

Accounting & Tax Treatment for Incentivizing

When incentives are posted, the tokens exit the user’s wallet and land in the BribeVotingReward contract. An example transaction looks like this:

From the perspective of the briber, this is an expense that offsets any LP rewards that are earned:

Debit Incentives Expense → FMV of 0.001 OP
Debit/Credit Gain or Loss → difference
Credit Digital Assets → Cost basis of 0.001 OP

Flipping over to tax, this could be a deductible expense if the entity posting the bribe is a business (however, this is not deductible on your personal return unless you file Schedule C). Any gain or loss that arises from sending the bride is capital in nature.

And that’s a wrap on Velodrome V2! 🥙 It was so much fun diving into this protocol and testing out all its functionality, from posting bribes to locking our VELO. Velodrome is core infrastructure for the Optimism ecosystem and has everything a robust DeFi protocol needs. And the accounting for it is fascinating!

Need assistance getting your Velodrome taxes together? Reach out to us at gm@hashbasis.xyz.

Mackenzie Patel

Related Content

BACK TO BLOGBACK TO BLOG