[DRC] Bridging the Community and Rewards Treasuries

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.

  1. 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.
  2. 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 the bridgeTreasury function.
  3. 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).
  4. 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 the bridge 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:

  1. 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.
  2. 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 existing Treasury contract. Each existing treasury is an upgradeable contract, which may be upgraded into a TreasuryBridge contract by governance and subsequently initialized. The TreasuryBridge contract is different from the Treasury 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 the bridgeTreasury 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 wethDYDX smart contract is the ERC20 implementation for wethDYDX. Using the bridge function, users send ethDYDX to the wethDYDX 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

  1. Call the approve method on the wethDYDX contract to approve the bridging transactions from the Treasuries for the specified amounts.
  2. 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.

15 Likes

Just 2c- Given the chain issues in testnet still being resolved, for some of these steps it could be prudent to wait one more epoch and start the steps from epoch 30 instead of 29 (starting just in a couple weeks), at least for making sure v3 is in good state until fully confident for v4 volume migration.

4 Likes

Following feedback from community members including @Jordi and others, we propose pushing the reduction in v3 rewards by 1 epoch. See the updated schedule below.

Updated Timeline

We will be following up with an updated timeline for a snapshot vote shortly, targeting early next week.

8 Likes

Hey, this proposal makes perfect sense with the latest update @XenophonLabs and is the logical next step for the token.

One aspect that is missing is leaving the right amount of ethDYDX behind to also cover unclaimed rewards. I assume the consensus is that these should still be available to be claimed on Ethereum.

3 Likes

Hey @0xCLR, thanks for the feedback. We are proposing that the unclaimed rewards remain on the Ethereum Rewards Treasury, but perhaps this was not clear.

The Rewards Treasury can be broken down into two buckets:

  1. Unclaimed ethDYDX rewards, and
  2. Unclaimed ethDYDX belonging to the Community Treasury (from emission reductions).

We are proposing that the unclaimed ethDYDX belonging to the Community Treasury be bridged, while leaving behind the unclaimed ethDYDX rewards. Furthermore, we would leave behind an additional 2,157,536 ethDYDX to cover rewards for epochs 31 and 32.

Please refer to the “dYdX v3 → v4: Bridging DYDX” graphic! The 16.9M DYDX left in the Rewards Treasury would cover both existing unclaimed rewards and rewards for epochs 31 and 32 (this number is an approximation for the purposes of the illustration).

3 Likes

A little off topic but has there been any thought or considerations given to the Hedgies. What’s the future looking like for them?

1 Like

The snapshot vote is up, please vote on the proposal here: Snapshot.

Voting will run from Oct 17th (Tuesday) at 3:30pm EST until Oct 21st (Saturday) at 3:30pm EST with two voting options:

  • Yes: implement all proposed changes.
  • No: do nothing.

Due to complications with Xenophon Labs’ DYDX delegation, Reverie kindly agreed to post the Snapshot vote on our behalf.

5 Likes

The initiative in raising this topic and presenting the migration process is greatly appreciated. A well-planned and thought-out bridging process is crucial for the ecosystem since, without it, the dYdX community would need to rely on the dYdX v3 (Ethereum) governance model, which, as outlined in a post, poses a security risk if dYdX v3 is eventually wound down. The successful implementation of this proposal will ensure prompt funding for dYdX v4 Chain activities, therefore, its successful adoption could be instrumental in shaping the trajectory of dYdX’s v4 development.

From a validator’s perspective, we have a question: Could you please provide more information about “Step 3: Recommend that dYdX Chain validators credit the vester accounts on v4”? Will there be instructions shared with validators regarding this step?

3 Likes

Thank you for facilitating the transition process to the dYdX Chain. The 4-step voting process seems quite logical from our perspective. We agree with the gradual reduction of rewards to zero. We are ready to actively share our rationale in other votes as well.

2 Likes

Thanks @XenophonLabs for the proposal with the articulate and detailed steps to appropriately bridge the Community and Rewards Treasuries to dYdX Chain.

At Tané, we fully support the proposal and its implementation/execution. This bridging of the Community and Rewards Treasuries is the critical step to properly bootstrap the dYdX Chain with the proposed Launch Incentive Program by @chaoslabs and other initiatives, and it’s important for the community to fully support its implementation and execution to help the new dYdX Chain gain the momentum after its launch.

We are looking forward to seeing the actual implementations and their on-chain proposals soon.

4 Likes

Thinking the community can decide what to do with them after launch. We can bridge them to cosmos to simplify verification of ownership to lower trading fees as it was on v3 or keep them on ethereum and do the confirmation from there. Grants program can probably do an RFP for someone to build that verification method.

2 Likes

Update

Following a successful snapshot vote, we are targeting an on-chain vote on Ethereum for completing steps 1, 2, and 4 of the above proposal for around November 12th. This will entail winding down rewards for dYdX v3 starting with Epoch 30, bridging vested ethDYDX, and burning unvested ethDYDX.

dYdX Chain Proposal

If and when the on-chain DIP on Ethereum is executed, governance on dYdX Chain must also vote on crediting the Community and Rewards vester accounts with the corresponding DYDX that was burnt on Ethereum. To address @iryna_everstake’s question, this will require a new governance proposal on dYdX Chain covering the below items:

  1. Credit unvested DYDX tokens to V4 community treasury vester and rewards treasury vester accounts.
  2. Set the Trading Rewards constant (which was set to 0 at Genesis).
  3. Seed the insurance fund from the community treasury.

Request for Proposal

Governance proposals on Cosmos chains must meet a minimum deposit to be eligible for voting. According to dYdX Chain’s genesis file, 10K DYDX must be deposited to meet this requirement, of which at least 20% (2K DYDX) must be deposited upfront when the proposal is created.

Note that only unstaked DYDX can be used for the deposit. This means that token holders interested in submitting dYdX Chain proposals or contributing to their deposit must hold some unstaked DYDX. The unstaking period is 30 days.

We would like to ask dYdX’s community members, token holders, and validators if they are:

  • Interested in sponsoring the dYdX Chain proposal (a >2K unstaked DYDX deposit).
  • Interested in contributing to the dYdX Chain proposal’s minimum deposit (if necessary).

If you are interested or have any questions, please reply in this thread.

2 Likes

A DIP has been submitted to bridge the community and rewards treasuries to dYdX Chain, and wind down dYdX v3 rewards.

Voting starts today, November 14th, 2023.

5 Likes

Thank you for the information. If a person has sent in a steak, are rewards provided at this point?

1 Like

The DIP to wind down dYdX v3 rewards and bridge the Community and Rewards treasuries was successfully executed:

  • 39,788,639 ethDYDX has been bridged from the Community Treasury on Ethereum to the Community Treasury account on dYdX Chain*.
  • 40,703,630 ethDYDX has been bridged from the Rewards Treasury on Ethereum to the Community Treasury account on dYdX Chain.
    • Approximately 12.4M ethDYDX remains in the Rewards Treasury as of November 20th, 2023. This includes the ethDYDX required to service rewards for Epochs 29, 30, and 31.
  • Rewards for Epoch 30 will be reduced by 1/3 on November 21st, 2023 at 15:00 UTC. Rewards reductions for Epochs 31 and 32 will follow the schedule in the DIP specification.
  • The recipients for the Community Treasury Vester and Rewards Treasury Vester have both been set to burner addresses.

*The community treasury address on dYdX Chain is dydx15ztc7xy42tn2ukkc0qjthkucw9ac63pgp70urn.

Next Steps

A separate proposal on dYdX Chain will be required to:

  1. Credit the burnt/unvested ethDYDX to the vester accounts on dYdX Chain.
  2. Set the Trading Rewards parameters (set to 0 at Genesis).
  3. Seed the liquidation insurance fund.
5 Likes