[Temperature Check] - Activate Uniswap Protocol Governance

Edits and Addendums

Friday, March 1, 2024: Snapshot Link

TL;DR

  • The UF is proposing a large-scale upgrade to Uniswap protocol governance to incentivize active, engaged, and thoughtful delegation. Specifically, we propose to upgrade the protocol such that its fee mechanism rewards UNI token holders that have delegated and staked their tokens.
  • This proposal describes the motivation for this change alongside detailed descriptions of the technical changes and logistics required to implement it.
  • Multiple appendices provide additional context.
  • Assuming no major blockers arise, a Snapshot vote for this proposal will be posted on March 1, 2024 and an on-chain vote will be posted on March 8, 2024.

Introduction: Invigorating Uniswap Governance

This proposal seeks to invigorate and strengthen Uniswap’s governance system by incentivizing active, engaged, and thoughtful delegation. Specifically, we propose to upgrade the protocol so that its fee mechanism rewards UNI token holders that have delegated and staked their tokens.

The UF team is often asked what success looks like for Uniswap governance. Quite simply, success for governance equates to the long-term sustainability and continued growth of the Protocol. Governance controls the Uniswap Treasury, and core parameters related to the Protocol’s long term sustainability (for instance, fees). In 5, 10, 20 years, Uniswap’s continued success – and whether it actually becomes the liquidity layer of the Internet – will have been the result of its delegates and the decisions they make.

Over the past year, the UF has prioritized improvements to the delegation experience. We have provided delegates with the opportunity to launch their platforms (the Delegate Race), and with information they need to make good decisions (the Bridge Report). Next week at ETHDenver we are launching GovSwap, the first of a series of in-person gatherings oriented around producing good governance outcomes by defining a common purpose. Subsequent GovSwaps will take place at ETHcc and Devcon. For delegators, we funded and launched Agora, a platform that allows delegators to find delegates that will best represent their interests.

As a result of these efforts, delegate activity has picked up, as evidenced by the increasing number of community-driven governance initiatives. For example, in the last three months:

  • There is a successful vote ending soon to pilot a program to incentivize the adoption of Uniswap V3 on non-mainnet chains (there are 16 non-mainnet deployments).
  • 10m tokens from the Protocol’s treasury were delegated across 7 different delegates.
  • Delegate-run Governance Calls have begun to happen on the second Tuesday of the month.

However, there is much more that can be done. Free-riding and apathy remain existential risks to the Uniswap Protocol’s sustainability. Less than 10% of circulating UNI is used to vote on a given proposal. Further, a large portion of existing delegation is “stale”. As of February 1 2024, 14 of the top 30 delegates by voting power had not voted over the last 10 proposals, and only 7 of these delegates have ever created a proposal.

We’re excited to invigorate governance – incentivizing not only delegation but thoughtful and active delegation – by tying delegation to protocol fees. Specifically, we believe UNI token holders will be incentivized to choose delegates whose votes and engagement with the protocol will lead to the Protocol’s growth and success. If this proposal succeeds we believe we will see an influx of new delegation. And because existing delegators will be required to re-delegate to stake their tokens, we will see a shift of “stale” existing delegation to delegates who have proven their commitment to supporting the protocol. Further, this mechanism can run on its own into the future - continuing to incentivize engaged delegation, without requiring any additional facilitation.

Summary of proposed technical changes

The Uniswap Foundation has funded the research and development of the various components that are required to implement this proposal. Specifically, we have funded two new smart contracts which are designed to be deployed into and interact with the existing ecosystem of Uniswap contracts operating on-chain. If implemented by this governance proposal, they would:

  1. Upgrade Uniswap Protocol Governance to enable the permissionless and programmatic collection of protocol fees
  2. Distribute any protocol fees pro-rata to UNI token holders who have staked and delegated their votes
  3. Allow for governance to continue to control core parameters: which pools which are charged a fee, and the magnitude of the fee

Below we provide a brief overview of the two new contracts. More technical detail can be found in the Appendix.

The two new contracts are V3FactoryOwner.sol and UniStaker.sol.

  1. V3FactoryOwner.sol allows for the programmatic, permissionless collection of protocol fees, and includes a mechanism which incentivizes the conversion of those fees into a common ERC20 for distribution to stakers, who have deposited UNI in Unistaker.sol. In order for this contract to work, it will need to become the owner of the UniswapV3Factory.
  2. UniStaker.sol manages delegation and fee distribution. Actors responding to the mechanism in V3FactoryOwner.sol deposit an ERC20 into UniStaker.sol to be distributed to stakers. UniStaker.sol is modeled after Synthetix’s battle-tested StakingRewards.sol but extends that contract’s functionality in two key ways: 1) It requires accounts that stake to delegate their tokens, and 2) It enables (but does not require) accounts that stake to assign staking rewards to any other account.

Next steps

If governance is supportive of this initiative, we will move forward with this vote. Specifically, a successful on-chain vote would update the owner of the mainnet UniswapV3Factory to be a deployment of V3FactoryOwner.sol, enabling the programmatic fee collection mechanism described above.

The next steps are:

  1. Today, February 23: Per the governance process, this post will remain open for conversation for a minimum of 7 days.
  2. Today, February 23: A Code4rena audit contest begins and will run for 10 days. Details on that contest can be found here.
  3. Next Friday, March 1: The UF will post a Snapshot with the options “Yes, upgrade the owner of the UniswapV3Factory”, “No, do not upgrade the owner of the UniswapV3Factory”, and “Abstain”
    Following the conclusion of the Code4rena contest and any mitigations, instances of the V3FactoryOwner and UniStaker will be deployed and verified on Etherscan. This post will be updated with links to the deployed and verified contracts.
  4. March 7: Assuming a successful Snapshot, the UF will post an on-chain vote whose successful execution would call the UniswapV3Factory’s setOwner function passing it the v3FactoryOwner address.
  5. An Immunefi bug bounty will go into effect before the conclusion of a successful on-chain vote. Details of this bounty including a link will be available prior to the on-chain vote being proposed.

These dates are subject to change based on audit results and community conversation.

Assuming a successful on-chain vote, the community will then have the option to turn on fees. To that end, Gauntlet is preparing a proposed roll-out process that they will post in the forum. Only at the completion of that separate governance process will fees begin to be collected and distributed in accordance with the contracts adopted in this proposal.

We want to thank the many grantees who have helped make this proposal possible: Scopelift, Gauntlet, Avantgarde Finance, Agora, Trail of Bits, Code4rena, and Immunefi. We also want to recognize Getty Hill for first suggesting the idea to update the owner of the V3FactoryOwner to allow for more flexible, programmatic fee collection in a May 2023 forum post.

For those who are excited by this proposal and other work the UF is taking on, we encourage you to check out our open roles. We’re currently hiring for a General Counsel and a Protocol Product Lead and would love to hear from you.

Appendix A: Uniswap Protocol fee technical overview

A detailed description of protocol fee mechanics as they currently exist can be found on the Uniswap Foundation blog, here.

The TL;DR is:

  1. Protocol fees are expressed as a fraction of LP fees (which themselves range from 1 to 100 bps). The specific fraction is adjustable by governance, and could be 0, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, or 1/10. They are currently set to 0.
  2. Protocol fees are set on a pool by pool basis, and fees are accrued in both tokens that comprise the pool.
  3. The UniswapV3Factory is the core contract of Uniswap V3; it spins up individual pool contracts to which users can add liquidity and swap back and forth. The Owner of the Factory is the only contract which can turn on fees in a pool, and collect fees when they’ve been turned on. Currently, the owner is Uniswap Governance’s Timelock contract.

The proposed vote would change the owner of the UniswapV3Factory to be a deployment of V3FactoryOwner.sol.

Appendix B: New contract descriptions and parameters

The smart contract piece of our proposed solution consists of two custom-built contracts, designed and written by Scopelift. This appendix discusses each of them.

V3FactoryOwner.sol
This contract allows for the programmatic, permissionless collection of protocol fees from the pools where they accrue while maintaining Uniswap Governance’s control over whether fees are turned on and their levels.

The mechanism that enables fee collection sets up a continuous “race” wherein external parties (we contemplate this will include MEV bots, arbitrageurs, etc.) compete to claim the fees accrued by each pool once it becomes profitable to do so. The external party that claims the fee is required to deposit (in our recommended implementation) 10 WETH to a deployment of UniStaker.sol (detailed below). In other words, once the value of accrued fees exceeds 10 WETH (plus gas), a rational actor is incentivized to convert accrued fees to 10 WETH, which is sent directly to the UniStaker.sol contract.

Additionally, V3FactoryOwner is configured to pass through the function calls from Uniswap Governance that are required to turn on and adjust protocol fees in any pool deployed from the Uniswap V3 Factory contract. Governance votes will still be required for these adjustments.

In order for this contract to work, it will need to become the owner of UniswapV3Factory. This first vote, the Upgrade vote, will update the Owner of UniswapV3Factory to the address of a deployed instance of V3FactoryOwner.sol.

V3FactoryOwner has four parameters that are configured at contract deployment.

Parameter Updateable by governance? Description UF Recommended parameter
Payout Token No The ERC20 used to pay out rewards to stakers. WETH
Payout Amount Yes How much of the Payout paid in each discrete deposit. This is the amount third parties will “pay” in order to collect the fees of any given pool. Rational actors would thus not call the method until the value of accrued fees plus gas is worth this amount. 10 WETH
Reward Receiver No The address to which third parties will send the Payout Amount of the Payout Token. UniStaker
Admin Yes The address that can pass through function calls to the V3FactoryOwner to adjust fees. Uniswap Timelock

UniStaker.sol
This contract manages delegation and fee distribution. Actors responding to the mechanism in V3FactoryOwner.sol deposit an ERC20 into UniStaker.sol to be distributed pro-rata to delegators.

UniStaker.sol is modeled after Synthetix’s battle-tested StakingRewards.sol. UniStaker extends StakingRewards.sol’s functionality in two key ways:

  1. It requires accounts to delegate their tokens in order to earn a share of protocol fees.
  2. It enables (but does not require) accounts that stake to assign staking rewards to any other account.
Parameter Updateable by governance? Description UF Recommended parameter
Admin Yes The address that can add addresses to the list of RewardsNotifiers. Uniswap Timelock address
RewardsNotifiers Yes A list of addresses that defines where rewards can come from. V3FactoryOwner added to the list of RewardsNotifiers
RewardsToken No The token UniStaker expects to be deposited and distributed to stakers. WETH
StakeToken No The token users must deposit and delegate to be eligible to earn RewardsTokens. UNI
Reward Duration No The timeframe over which rewards are distributed. This is a parameter that comes with the Synthetix staking model. Effectively, when a reward is distributed it is spread out over this time frame (unless/until the next reward comes in). Primarily, this impacts the reward rate. A longer duration will drip rewards more slowly. A shorter one will drip them more quickly. 30 days

Appendix C: Fee distribution logic
The rate at which accrued protocol fees are distributed to UNI stakers, as well as the size of a stakers’ reward, are determined by several variables. Specifically, the inputs are:

  1. Reward token (set on UniStaker and V3FactoryOwner). This is the denomination of the rewards distributed to UNI stakers.
  2. Reward amount (set on V3FactoryOwner). This is the total reward amount which is distributed across stakers, per deposit. A higher reward amount means that fees will be claimed and distributed to stakers less frequently than with a lower reward amount, all other factors held equal.
  3. Reward duration (set on UniStaker). The length of time over which a given reward amount is distributed, once it has been deposited in UniStaker. A longer reward duration period incentivizes stakers to stake and thus delegate for a longer period of time to receive the same amount of fees, all other factors held equal.
  4. Staker’s share of total UNI staked: Protocol fees are distributed across stakers pro-rata over a given block. If a staker stakes a larger proportion of total UNI staked in a given block, they will receive comparatively more fee rewards, all other factors held equal.
  5. Trade volume. Higher trading volumes means fees are collected and distributed to stakers more frequently than lower trading volumes, all other factors held equal.

Note that every time a deposit happens, the reward duration “clock” resets. All outstanding Reward Amounts are added to the newly deposited Reward Amount, and that amount is distributed over the subsequent Reward Duration.

To illustrate these distribution mechanics using an example, assume that we have defined the contract variables as follows:

  • The Payout Token as WETH
  • The Payout Amount as 10
  • The Reward duration as 30 days

Every time a little bit more than 10 WETH worth of fees accrue in a pool, a third party is incentivized to collect them and distribute 10 WETH into UniStaker. From there they will be allocated pro-rata to stakers over a 30 day period.

Example 1: Simple Case

  • Assume Alice has deposited 10 UNI to UniStaker and that she is the only person to have done so. Her stake makes up 100% of total UNI staked.
  • On the first day she staked, a reward (10 WETH) is deposited into UniStaker.
  • The reward amount is ~0.33 WETH per day, 10 WETH divided by the reward duration 30 days.
  • Alice earns ~.33 WETH per day for 30 days

Example 2: New Rewards Distribution

  • Assume Alice has deposited 10 UNI to UniStaker and that she is the only person to have done so. Her stake makes up 100% of total UNI staked.
  • On the first day she staked, a reward (10 WETH) is deposited into UniStaker.
  • Alice earns ~.33 WETH per day.
  • A new reward distribution of 10 WETH arrives on day 3. At this point, the rewards being disbursed reset to include this new deposit. On Day 3, there is ~9 WETH outstanding from reward 1. There is now a total of ~19 WETH to be disbursed over the subsequent reward duration of 30 days.
  • The reward rate Alice receives is now ~.633 WETH per day (~19 WETH divided by 30 days)

Example 3: New Stakers

  • Assume Alice is receiving ~0.633 WETH per day.
  • A new staker, Bob, stakes 10 UNI. Alice and Bob each make up 50% of total UNI staked. Alice and Bob will now split the 0.633 WETH pro-rata for the duration of the period (0.3165 per day), or until a new deposit arrives.

Appendix D: Documentation, security and audits

Both V3FactoryOwner and UniStaker are fairly lightweight - the total combined lines of code is near 550. But if put into production, both are critical to the future of the Uniswap ecosystem. With that in mind we have invested considerable resources into their security.

Both contracts were developed by Scopelift. The code has meticulous in-line documentation and there is user-facing technical documentation here. The repository contains a robust test suite including unit, integration, and invariant tests. Scopelift has also written scripts for the governance proposals that will be required to transfer the ownership of the V3Factory contract and subsequently to interact with the V3FactoryOwner.

The smart contracts have been highly scrutinized by multiple teams including Trail of Bits, whose final audit report is forthcoming. The audit flagged one issue that is documented here. The full report from that audit will be added to the contract repo when their technical writing team has completed their work.

Additionally, the Uniswap Foundation is sponsoring a 10-day Code4rena contest which will further harden the contracts. That contest will begin shortly after this post is published.

Finally, in the event of a successful transfer of UniswapV3Factory ownership, the contracts will be the subject of a $1m bug bounty hosted by Immunefi.

Appendix E: Front end access

The UF has funded two separate front ends to provide access to the UniStaker contract.

Avantgarde Finance has built a React app that enables the functionalities necessary for users to stake, delegate, and collect their fees. It is open source and its UI is purposefully unopinionated. It can be freely forked and the components copied at will for other front end teams to incorporate in their apps. This app will be deployed and hosted following a successful governance proposal; it can also be downloaded and run locally.

Avantgarde has also built a hosted subgraph that indexes the events fired by the V3FactoryOwner and UniStaker contracts. This subgraph will be a valuable tool to anyone building an app that interacts with UniStaker or V3FactoryOwner.

Both Avantgarde products are in the final stages of active development and testing; their repos are subject to change.

Agora is integrating staking and delegation functionality into the app they maintain at vote.uniswapfoundation.org. Upon a successful governance vote, the new version of that app will be deployed.

Appendix F: Impact on protocol liquidity

If this proposal passes, it sets the stage for future proposals to turn on the Uniswap Protocol fee. In evaluating any such future proposal, delegates should consider the potential impact to the procotol’s liquidity. To this end, the UF engaged Gauntlet to produce a report that investigates the likely outcomes. Using a simulation engine that ingests months of transaction-level blockchain data, Gauntlet’s report provides a framework to think about the impact on liquidity and trade execution resulting from the introduction of a protocol fee (and to measure the results of any successful implementation).

An overview of their findings can be found here, and a full discussion of their methodology can be found here.

We encourage delegates to read through this work to inform their decision-making.

Appendix G: Next steps for delegators

We expect an influx of new delegation, as well as adjustments to existing delegation, if this proposal passes. As such we want to share a few thoughts to help delegators.

We expect all UNI token holders to do their diligence on delegates and delegate to those who have shown good judgment, decision making, and engagement with the protocol. You can review delegate platforms and past activity here. Your choice in delegate will directly impact the future of the protocol.

Additionally, note that protocol fees will flow through the new staking and delegation contracts (not existing ones). In other words, if you delegate today or are already delegated today, you will have to re-delegate once the new contracts go live in order to receive your portion of protocol fees.

Finally, note it will still be possible to delegate without staking by using the existing delegation function on the UNI token contract.

The Uniswap Foundation supports a community of individuals and organizations dedicated to a more open, fair and decentralized financial system through education around and broader adoption of blockchain technologies and smart contract-based decentralized protocols.

This post does not constitute, and is not intended to constitute, any kind of legal advice, and readers are not to construe the contents of this brief as legal, business, tax, accounting, investment, or other advice. Each UNI token holder should consult its own advisers as to legal, business, tax, accounting, and other related matters concerning the proposal in light of such token holder’s particular circumstances.

45 Likes

I appreciate the level of thought and diligence that into the design of this upgrade. I think this new surface area for delegators to collect protocol fees is an important building block that will allow the Uniswap DAO to grow sustainably into the future. Excited to vote for this proposal!

13 Likes

Why don’t you post this update on official twitter of uniswap ???

2 Likes

This is incredibly exciting and we are looking forward to this vote over the next few weeks and months. By incentivizing delegation at mass scale, this will be unprecedented in DeFi and will hopefully set in motion future protocols to follow suit.

6 Likes

This is an extremely exciting development for the Uniswap community and we’re fully supportive of the initiative.
It can be a game changer for fuelling further governance participation!

2 Likes

Super exciting development!

Considering that the step of actually turning on fees for specific pool will take place in subsequent proposals, I think this proposals shouldn’t create any significant risk to the protocol’s competitiveness or performance (as long as there are no serious findings in code audit/audit competition).

Think it will also be worthwhile to develop a way to claim/consolidate fees from Uniswap v2 (imo it may make sense to turn on v2 fees before v3) as well as process for handling fees on cross-chain deployments. But this is a really important first step.

Launch of staking will also provide an opportunity to refresh delegations and engage more UNI holders in governance; when the protocol first launched in 2020, delegation wasn’t required to claim (as has been implemented in many other airdrops later on such as ENS and Gitcoin), so this could be a helpful reset for governance.

UF and all involved contributors deserve commendations for bringing this proposal to fruition. Thank you!

4 Likes

Hey Erin,

Really great proposal, very clear and straight forward.

in terms of the RewardsToken, will this be hard defined as WETH, meaning this would not be possible to be changed down the line?

Thanks!

2 Likes

Isn’t this sort of like paying people not to personally vote/participate in Uniswap governance except by delegating their decisionmaking to others? seems odd and not very DAO-like, but maybe I’m missing something…

4 Likes

you can delegate to yourself, and personally vote/participate in Uniswap governance.

7 Likes

Is there a threshold in being able to vote as a delegate?

Why not just skip the delegation part and directly reward governance participation (whether as a delegate or otherwise)?

2 Likes

I never thought the protocol fees were a good idea given the generally low level of rewards to risk ratio for LPs. You are probably right to incentivize people to hold UNI but you should rather work on the mechanics of the protocol to extract further value from trades and forward it to UNI stakers. For example, Uniswap could create an additional stream of revenue by making the arbitrage trades herself (see the LVR idea from Roughgarden).

3 Likes

:face_with_monocle:
https://x.com/UniswapFND/status/1761029569983971567?s=20
imagen

2 Likes

Incredible update! This proposal aligns participations with the interests and success of the protocol. I’m super excited to see this go forward!

1 Like

Thank you for the proposal. This is one of the most significant governance proposals for Uniswap as this means the community and the governance will have a closer alignment with the protocol, including sharing the benefit of its growth :fire:

2 Likes

just to be clear, there is no such thing as staking uni now correct?

this staking uni would occur in the new contract that is being proposed?

Thanks for your work on this. Cheers

1 Like

This is a copy-pasta from pondcoin (.) com or $pndc Please give credit where it is due.

2 Likes

I delegate my humble amount of UNI to myself so that I can participate in governance and vote. I believe it is important to delegate your UNI to yourself and participate, or to delegate to a responsible party who will vote on your behalf.

2 Likes

More a tech question, As I don’t know uniswap too well:

Can the fee turned on in old pools? Or is it just for new created pools?

And:

So how is this done? Governance has to decide on which pool fee ist taken? I guess I just read this wrong?

1 Like

Governance can choose to turn on fees for any Uniswap V3 Pool

Check out this documentation on how fees are translated into staking rewards for governance participants:

https://docs.unistaker.io/architecture/fee-payout-race

4 Likes

There should be a historical snapshot of large LPs, who took all the risk in the past, and weren’t rewarded, and who will again take the risk in the future. Appart from that, I find it a good proposal.

1 Like