-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
status: implementedProposed changes have been implemented (and deployed, if smart contract)Proposed changes have been implemented (and deployed, if smart contract)type: core
Description
ZEIP-31 introduces a stake-based liquidity incentive to the 0x protocol. This draft outlines the design principles and constraints of the incentive mechanism, along with guidelines for its implementation. We encourage relayers, market makers, and developers working on complementary Ethereum projects to help us shape these ideas into a formal specification.
Feel welcome to leave comments below or in this google doc.
See the 0x Staking Specification for the most up-to-date information on architecture, implementation and usage.
1 Overview
1.1 Motivation
- Encourage user ownership among market makers.
- Reward market makers that stake ZRX tokens.
- Align all market participants with the long-term mission and objectives of 0x.
- Redirect proceeds from arbitrage-driven gas auctions back to market makers.
1.2 Principles
- Incentivize liquidity providers to invest in the long-term success of the protocol
- Create a level playing field across all types of assets and classes market makers
- Minimize overhead and cost, both in terms of gas and effort to participate
1.3 Specification
- Participate in governance and liquidity incentive programs by staking ZRX (section 2.1)
- Delegate stake to liquidity providers (section 2.2)
- Funding self-sustaining development with protocol fees (section 2.3)
- Earn liquidity rewards on trading (section 2.4)
- Vote on 0x protocol proposals (section 2.5)
- Scheduling process for claiming rewards (section 2.6)
- Setting up liquidity rewards for market makers (section 2.7)
2 Specification
2.1 Staking ZRX
2.1.1 Utility
- Vote on proposals and the allocation of community funds
- Market makers earn liquidity rewards proportional to their trade volume and amount of stake
- Anyone can delegate stake to a market maker and earn a portion of their liquidity reward
2.1.2 Depositing Stake
- Anyone can stake by depositing ZRX into the 0x staking contract
- Stake can be deposited at any time
- ZRX remains staked until withdrawn by the staker
2.1.3 Withdrawing Stake
Stake is locked up for a period of time before it can be withdrawnFunds are frozen and cannot be used to vote or earn liquidity rewards during this lockup periodThe length of this lock up is to be determined- Stake can be withdrawn immediately so long as it is not delegated
- A lockup period may be implemented in the future to handle edge cases in on-chain governance
2.2 Delegating Stake
2.2.1 Overview
- Market makers can contribute stake on their own behalf
- Third parties can delegate stake to market makers
- Delegated stake can be used in the same ways as regular stake
- Stake contributed by market makers receives additional weight when computing rewards
- A delegator transfers a portion of his voting rights to the market maker (section 2.5)
2.2.2 Incentives
- Market makers can sign a profit-sharing contract that enables them to benefit from delegated stake
- The contract specifies a fixed percentage of future liquidity rewards to be shared among their delegators
- Via delegation market makers can obtain liquidity rewards and voting power without locking up capital in ZRX
2.2.3 Weight of Stake
- Regular stake is always weighted more heavily than delegated stake
- Market makers obtain rewards more cost effectively when staking on their own behalf
2.2.4 Delegating Stake
- ZRX must be staked before it can be delegated
- Anyone can delegate their stake to a market maker at anytime
- Delegating stake comes into affect on the next epoch
- Stake remains delegated until withdrawn by the delegator
- The portion of a market maker's liquidity rewards allocated to delegators is held in a Delegated Reward Pool
- Each delegator owns a percentage of the reward pool
- When a new delegator joins a pool, it would dilute rewards held by incumbent pool members
Delegators must therefore “buy into the pool” by locking a small amount of ether along with their delegated stake
2.2.6 Motivation for Reward Pool Buy-ins
Reward pool buy-ins reduce the gas cost of joining a delegation poolAbsent a buy-in, we would have to record when a delegator joins and leaves a pool to compute their rewards
Note: Reward Pool buy-ins have been eliminated.
2.2.5 Buying Into a Reward Pool
The buy-in equation is eᵢ = (eₜ / dₜ) dᵢWhere eᵢ is the amount of ether to deposit when delegating dᵢ stakeThere already exists dₜ delegated stake and eₜ liquidity rewards already in the pool
The capital requirements of a buy-in will be very low relative to the ZRX stake needed to earn a rewardAnyone can call a function to payout all delegators and liquidate the reward pool
Note: Reward Pool buy-ins have been eliminated.
2.2.7 Exiting a Reward Pool
- Stake remains delegated until the end of the epoch
- A delegator's share of the reward pool is withdrawn immediately upon exit
- See section 2.1.3 for lockup rules related to withdrawing stake
2.3 Fees
2.3.1 Charging Fees
- Each fill on the 0x Exchange contract incurs a static fee
- The fee associated with a fill operation scales linearly with the gas price of the transaction
- The fee is denominated in ETH and paid by setting msg.value
- The fee is paid by whoever submits the transaction
- This is the taker in an open orderbook relayer model
- This is the relayer in a matching / closed orderbook model
- This is an arbitrary third-party when using contract-fillable liquidity (meta-transactions)
2.3.2 Motivation for Fee Mechanics
- Making the fee proportional to the transaction gas price protects market makers from arbitrage
- A portion of fees currently paid to miners are recycled back into the 0x ecosystem
2.3.3 Accumulating Fees
- The 0x Exchange contract deposits fees into
a vault managed bythe staking contract - The fee is associated with the originating market maker and acts as a measure of their trade volume
- At the end of each epoch the accumulated fees are distributed as liquidity rewards
2.4 Liquidity Rewards
2.4.1 Earning Liquidity Rewards
- Liquidity rewards are generated by protocol fees
- Liquidity rewards are paid out at the end of each epoch
- Liquidity rewards are divided between market makers, delegators, and the 0x Ecosystem Fund
2.4.2 Liquidity Rewards for Market Makers
- A market maker's liquidity reward is a function of:
- The total fees collected across all market makers
- The amount of stake held by the market maker
- The amount of stake delegated to the market maker
- The fees attributed to the market maker
- A variable subsidy that we add or remove to influence liquidity provision
- 1 Staked ZRX = 1 Reward Credit
- 1 Delegated ZRX = 0.9 Reward Credits
2.4.3 Liquidity Rewards for Delegators
- Delegators receive a portion of the reward for each market maker they have delegated to
- This portion is set once by the market maker when creating the delegation pool
- Each delegate earns a reward proportional to the amount they delegated
2.4.4 Liquidity Rewards for the Ecosystem Fund
- The 0x Ecosystem Fund is a pool of ETH collectively managed by ZRX holders
- A small fixed percentage of the total fees collected are allocated to the fund
- Until the 0x Ecosystem Fund has been created all fees will be paid to market makers and their delegators
2.5 Governance
2.5.1 Voting on Proposals
- Anyone can vote on a proposal using their stake, the stake they delegate, or using stake delegated to them
- 1 Staked ZRX = 1 Vote
- 1 Delegated ZRX = 0.5 Votes for the delegator and 0.5 Votes for the delegate
- Only stake and delegated stake that have not been flagged for withdrawal can be used to vote
2.6 Epochs
2.6.1 Scheduling
- All processes are segmented into time intervals called epochs
- Fees accumulate over an epoch and are paid out at the end of the epoch
- Time-locks for withdrawing stake (and exiting reward pools) are measured in epochs
- All epochs last a fixed minimum time
The duration of an epoch is to be determined, but will likely be 2-4 weeks- The duration of an epoch is 10 days
2.6.2 Epoch Finalization
- Epoch T must be finalized before Epoch T+1 can start
- Anyone can finalize an epoch by calling a function in the staking contract that:
- Computes liquidity reward allocations across market makers
- Pays market makers and escrows the portion allocated to their delegators (section 2.2)
- Pays a portion of the liquidity rewards to the 0x Ecosystem Fund
- Increments the epoch
- Stake and delegated stake automatically carry over to the next epoch
2.7 Setting Up Liquidity Rewards for Market Makers
2.7.1 Registering as a Market Maker
- A market maker calls the staking contract to generate a unique id and associate it with their trading addresses
- The market maker must call into the contract with each of their trading addresses
For EOA's the market maker signs a message and submits it to the staking contractFor contract accounts the market maker must implement a simple signature validation function
tomhschmidt, willwarren89, mannyFresh, chriskalani, NavyAdmiral and 11 moretomhschmidt, willwarren89, mannyFresh, chriskalani, dorothy-zbornak and 10 moremannyFresh, dorothy-zbornak, dekz, BMillman19, fengtality and 4 more
Metadata
Metadata
Assignees
Labels
status: implementedProposed changes have been implemented (and deployed, if smart contract)Proposed changes have been implemented (and deployed, if smart contract)type: core