Title: [DRC] Bridging the Community and Rewards Treasuries
Authors: Xenophon Labs
Date: October 5th, 2023
Summary
The open source code for the dYdX Chain and the Migration Smart Contracts commissioned by the dYdX Foundation have been released. Furthermore, the Snapshot vote for DYDX to be the L1 token on dYdX Chain recently passed, along with the Long TimeLock vote to set wethDYDX as a v3 governance token.
Following these significant milestones, a possible next step for the community is to decide whether and how to bridge the community and rewards treasuries from Ethereum to dYdX Chain. Doing so will enable governance on the dYdX Chain to fund a Launch incentive program, seed the dYdX Chain insurance fund, distribute trading rewards, and fund other initiatives for the dYdX DAO, among other things.
In this proposal, we discuss how we believe the dYdX community could migrate the community and rewards treasuries in a 4-step process. Following a successful snapshot vote, steps 1,2, and 4 would require an on-chain vote to be executed under the Short TimeLock executor.
- Wind Down v3 Rewards: Reduce emissions by â…“ each epoch from Epoch 29-31 (see the schedule in Table 1). Accordingly, 2,157,536 ethDYDX must remain on Ethereum to service 3 epochs of v3 rewards.
- Upgrade the Community Treasury and Rewards Treasury contracts: Upgrade the community and rewards treasuries to the TreasuryBridge Smart contracts and set the recipient address to a burner address. This effectively burns all unvested ethDYDX. Note, upgrading to the
TreasuryBridge
Smart contracts will enable thebridgeTreasury
function. - Recommend that dYdX Chain validators credit the dYdX Chain community treasury vester and rewards treasury vester with DYDX: based on the amount of ethDYDX that are burned from the Ethereum rewards treasury vester and community treasury vester in step (2).
- Bridge Vested ethDYDX: We can call the
bridgeTreasury
function on the upgraded treasuries to bridge vested ethDYDX, specifying the amount to bridge and the respective account to deposit funds on dYdX Chain. dYdX Chain validators listen to the event logs from thebridge
transaction and credit corresponding DYDX on dYdX Chain.
a. Community Treasury: We can bridge the entire Community Treasury over to dYdX Chain by specifying the treasury’s balance and the corresponding treasury account on dYdX Chain.
b. Rewards Treasury: As a result of several governance proposals to reduce emissions, there are about 32M* ethDYDX sitting in the rewards treasury that effectively belong to the dYdX community. In order to claim this ethDYDX on behalf of the community, we may bridge the majority of this ethDYDX to the Community Treasury on dYdX Chain by specifying the same account as step (4a). Note, we must leave 2,157,536 ethDYDX in the Rewards Treasury to service LP and trading rewards because, following step (2), no more ethDYDX will be vesting into the rewards module. Also note, any unclaimed ethDYDX rewards will remain in the rewards treasury.
*The exact DYDX to be claimed by the community from the rewards treasury will depend on if and when this proposal is passed by governance.
The migration of community resources from Ethereum to dYdX Chain is complex. We kindly ask that community members and stakeholders take some time to review this proposal and provide feedback. We look forward to suggestions, and to a successful migration to v4!
Note: this proposal does not involve any governance action on dYdX Chain. Actions on dYdX Chain, such as funding v4 vesting accounts, should go through the v4 governance process after the potential mainnet launch of the chain.
Background
Background
Currently, the ethDYDX token is the primary resource the dYdX community has to fund grants, incentives programs, hackathons, etc. In order for the dYdX community to deploy this ethDYDX through dYdX Chain governance, ethDYDX must first be bridged from Ethereum to the dYdX Chain. Otherwise, the dYdX community must rely on governance proposals on dYdX v3 (Ethereum) to deploy resources, which poses a security risk if dYdX v3 is eventually wound-down. This proposal outlines how a potential migration may be conducted.
For detailed background on the entire bridging process, please reference the detailed documentation produced by the dYdX Foundation here! We summarize some relevant technical points below for clarity.
v3 Background
dYdX governance controls the ethDYDX in the community treasury and rewards treasury. ethDYDX is “vested” into each treasury from its respective “vester” contract, which is explained in further detail here. The vested ethDYDX in the Rewards Treasury is consumed by the Merkle Distributor contract to disburse trading and LP Rrewards from the rewards treasury, whereas the ethDYDX in the Community Treasury is used to fund operations, such as the Grants program.
All the dYdX v3 governance contracts are listed and described here. The current schema for the relevant governance contracts is reproduced below, copied from the Foundation’s documentation.
In order for v4 governance to control the existing ethDYDX funds, the dYdX community must bridge the ethDYDX from the community treasury smart contract and the rewards treasury smart contract into their corresponding accounts on dYdX Chain.
v4 Background
On dYdX Chain, we anticipate that the structure of the community treasury, the rewards treasury, and their respective vesters will be very similar to dYdX v3 (see the x/vest module). The v4 codebase already incorporates the following functionality, which we leverage in this proposal:
- Validators listen to event logs emitted by the Bridge contract (i.e., the wethDYDX smart contract) to process bridge transactions from Ethereum onto dYdX Chain (source). This will allow the dYdX community to bridge vested ethDYDX from the community treasury and the rewards treasury. dYdX Chain validators will read event logs and then mint/deposit the DYDX on a 1-1 proportional basis into the corresponding accounts on dYdX Chain. This is the same logic that enables retail users to bridge their ethDYDX as well.
- dYdX Chain includes a “bridge account,” which will be instantiated with 1B DYDX at Genesis. All bridged DYDX that is credited to dYdX Chain accounts emanates from this bridge account’s balance. v4 governance may choose to credit the community treasury vester and rewards treasury vester accounts with additional DYDX from this bridge account by submitting a governance proposal. Once the dYdX v3 treasury accounts have been upgraded and unvested ethDYDX is burnt, such a proposal may be used to credit the corresponding unvested DYDX into the respective vester accounts on v4.
Bridge Background
The TreasuryBridge
contract we refer to in this proposal is part of the smart contracts commissioned by the dYdX Foundation, which were adopted as the de facto bridge between Ethereum and dYdX Chain by dYdX governance in a recent snapshot. There are two main contracts that are relevant to this proposal:
- The
TreasuryBridge
contract is an upgraded version of the existingTreasury
contract. Each existing treasury is an upgradeable contract, which may be upgraded into aTreasuryBridge
contract by governance and subsequently initialized. TheTreasuryBridge
contract is different from theTreasury
contract in the following ways:- The
initialize
function claims all vested ethDYDX and subsequently sets the recipient in the vesting contract to a burner address. This effectively burns all unvested ethDYDX permanently. - Furthermore, the
TreasuryBridge
smart contract implements thebridgeTreasury
function, which bridges vested ethDYDX from Ethereum to dYdX Chain using the wethDYDX smart contract. Governance may specify which address on dYdX Chain to bridge to.
- The
- The
wethDYDX
smart contract is the ERC20 implementation for wethDYDX. Using thebridge
function, users send ethDYDX to thewethDYDX
smart contract, permanently locking that ethDYDX and minting wethDYDX in return. This function then emits a Bridge event log, which validators on dYdX Chain can listen to (via an Ethereum RPC) to mint corresponding DYDX on dYdX Chain.
Find all relevant contracts in the governance-contracts repository.
Description
The purpose of this proposal is to ensure that activities on dYdX Chain can be funded by dYdX Chain governance promptly. This includes:
- Enabling the Trading Rewards program on dYdX Chain by potentially funding the rewards vester account.
- Enabling v4 governance to potentially fund the liquidation insurance fund by engaging in an OTC transaction for DYDX ↔ USDC. This may be done permissionlessly on dYdX Chain via a governance proposal.
- Enabling v4 governance to potentially fund the Launch Incentives program developed by Chaos Labs.
We describe the steps we must take to bridge vested and unvested ethDYDX from Ethereum to dYdX Chain below.
Ultimately, the goal of this proposal is to achieve the state of the world depicted above. The DYDX amounts to be credited to the community and rewards vesters are based on the exact ethDYDX amounts burnt on Ethereum once the treasuries are upgraded. The exact allocations will be determined by v4 governance, so they’re marked as TBD in the figure.
All amounts in the figure are illustrative and represent current contract balances; they will be outdated if and when this proposal is executed on-chain.
Step 1: Winding Down v3 Rewards
As part of the migration from dYdX v3 to v4, it is our belief that the Trading and LP rewards on v3 should be wound down. We propose a gradual approach that linearly reduces v3 rewards over the course of 2 months. This approach requires 2,157,536 ethDYDX to remain on Ethereum to fund the final epochs for v3 rewards.
Rationale
The migration from dYdX v3 to dYdX v4 also involves migrating Rewards programs. Since the DYDX supply is limited, we argue it is best spent growing the v4 ecosystem. It follows that the rewards programs on v3, Trading Rewards, and LP Rewards should be shut down.
Our primary reason for taking a gradual approach is to preserve the dYdX user experience and smoothen the transition to v4. Both Trading and LP Rewards are meaningful parts of the user experience for takers and makers on dYdX v3. Many of these users must migrate their operations to dYdX Chain, which involves varying degrees of complexity: bridging, rewriting necessary code, learning about the new API for dYdX v4, etc… This approach gives users a buffer period within which they can gradually shift their operations from v3 to v4.
Implementation
A full implementation will be released if this proposal passes a Snapshot vote.
Step 2: Upgrading the Treasury Contracts
Unvested tokens in dYdX’s vester contracts are locked and, therefore, cannot be transferred. This means that these tokens cannot be directly bridged to dYdX Chain via the wethDYDX smart contract. Instead, dYdX governance may choose to change the vesting recipient of both vester contracts to a burner address. This effectively burns all unvested tokens in the vester contracts since they cannot be retrieved from the burner address, even once vested. Given that the setRecipient
function can only be called by the current recipient, which the burner won’t be able to do, this change is irreversible.
With these unvested tokens effectively burnt, dYdX Chain governance may then choose to credit the corresponding balances into the respective accounts on dYdX Chain.
Rationale
The goal of this step is to bridge the unvested ethDYDX from the community and rewards treasuries into dYdX Chain. Since it is not possible to transact unvested tokens, we instead permanently lock all unvested ethDYDX on Ethereum and issue the corresponding amount into vester contracts on dYdX Chain.
Implementation
Upgrade the community treasury and rewards treasury smart contracts to TreasuryBridge
smart contracts.
A proposal on dYdX Chain may then be submitted to credit the appropriate vester accounts.
Step 3: Recommend that dYdX Chain validators credit the vester accounts on v4
This step is a recommendation that dYdX Chain validators should credit the community treasury vester and rewards treasury vester accounts on dYdX Chain with DYDX tokens equivalent to the amount that their counterparts on Ethereum burned following step (2). This may be done through a snapshot vote.
Rationale
Signal to dYdX Chain governance and dYdX Chain validators that burnt ethDYDX on the Ethereum vester contracts should be credited as DYDX to the corresponding vester contracts on dYdX chain.
Implementation
This may be done through a snapshot vote.
Step 4: Bridging Vested ethDYDX
Once the treasury contracts have been upgraded, the community may choose to bridge the vested ethDYDX from the Community and Rewards treasuries into dYdX Chain using the bridgeTreasury
function by specifying the destination account on dYdX Chain. In this step, we propose that the community bridges over all the ethDYDX from the Community Treasury into the Community Treasury account on dYdX Chain.
The Rewards Treasury also contains ethDYDX belonging to the Community Treasury following several proposals to reduce rewards emissions. We also propose bridging this ethDYDX into the Community Treasury account on dYdX Chain.
However, once the treasury contracts have been upgraded they will no longer receive newly vested ethDYDX. This is a problem if we want to continue funding 2 more epochs of rewards. One way around this is to leave behind 2.16M ethDYDX in the Rewards Treasury when bridging the ethDYDX owed to the community (in addition to the unclaimed rewards which will also remain in the Rewards Treasury).
A governance vote on v4 may then choose to credit the v4 community treasury account with this 2.16M DYDX, and subtract it from the amount credited to the v4 rewards vesting contract. This ensures that the funds for epochs 29 and 30 rewards are coming from the rewards treasury, and not out of the community treasury. Notice this does not double-spend any DYDX.
Note: unclaimed rewards will not be bridged out of the rewards treasury, only the ethDYDX belonging to the Community Treasury.
Rationale
By bridging the vested ethDYDX balances to dYdX Chain, the community may then fund incentives and operations via v4 governance. This also claims the ethDYDX owed to the Community Treasury and ensures rewards for epochs 29 and 30 are serviced.
Implementation
- Call the
approve
method on thewethDYDX
contract to approve the bridging transactions from the Treasuries for the specified amounts. - Call the
bridgeTreasury
function on the newly upgraded treasury contracts to bridge over the Treasuries to the Community Treasury account on dYdX Chain.
Next Steps
The voting scheme and timeline for next steps is described below.
Voting
- Yae: Implement the proposed changes.
- Nae: Do nothing.
Timeline
We are targeting the below dates (subject to change).
October 5th: DRC creation.
October 11th: Snapshot vote creation.
October 17th: Short timelock vote creation.