0xProject / ZEIPs

0x Improvement Proposals
Apache License 2.0
91 stars 15 forks source link

0x Protocol V3 #56

Closed dekz closed 4 years ago

dekz commented 4 years ago

Overview

This vote concerns a major update to 0x protocol. The changes fall mainly in three buckets: the introduction of staking contracts, a new pattern supporting bridged liquidity across protocols, and miscellaneous technical improvements and new features. 0x v3.0 contracts have been audited by ConsenSys Diligence and Trails of Bits.

The new staking contracts support a ZRX staking mechanism that grant 0x market makers greater ownership in the protocol, as they provide the necessary liquidity for the markets running on the network. Market makers form pools to receive liquidity rewards and participate in governance. Liquidity rewards are sustained by the introduction of a small protocol fee, paid by the taker when filling orders. The fee is calculated as a portion of the gas price and the number of orders filled. ZRX token holders can earn a portion of liquidity rewards by delegating their ZRX to market maker pools. Learn more about ZRX staking here.

The ERC20BridgeProxy contract allows for the execution of ERC-20 transactions with assets that are locked in other contracts. The design patterns allows for DEX bridges to access sources of on-chain liquidity from DEXs like Kyber, Oasis, and Uniswap. Learn more about liquidity bridges here.

Finally, in this vote proposal, the exchange expands and improves multiple features. The most notable ones are: the introduction of arbitrary fees (previously only ZRX), idempotent order cancellations, a more different matching orders function and richer revert errors. Check out the entire changelog for v3.

Benefits

ZRX staking introduces a scalable mechanism to sustain the growth of the ecosystem, aligning incentives of token holders with the class of users that participate the most in the network.

The DEX bridge use cases powered by the new ERC20Bridge will allow projects integrating with 0x to plug into a superset of off-chain and on-chain pool liquidity, at the best price.

The improved exchange functionalities enable, among other things, relayers to introduce fees denominated in any asset, market makers to have more reliable cancellations and matching relayers to maximize their profits.

Included ZEIPs

ZEIP Description
ZEIP-31 ZRX Staking
ZEIP-42 Protocol Fees
ZEIP-47 Bridge On-chain Liquidity
ZEIP-28 Arbitrary Fee Token
ZEIP-50 Market Buy/Sell Improvements
ZEIP-40 Order Matching Strategy matchOrdersWithMaximalFill
ZEIP-59 Market operations with mixed asset data
ZEIP-41 Batch Order Matching
ZEIP-35 noThrow Cancel Order
ZEIP-32 Rich Revert Reasons
ZEIP-33 New Signature Types
ZEIP-34 executeTransaction Improvements
ZEIP-36 executeTransaction Batch Improvements
ZEIP-37 executeTransaction Cancellation and Expiration
ZEIP-61 Initial staking parameters

Important Dates

Date Note
2019-11-04 Vote Begins
2019-11-11 Vote Ends
2019-11-25 V3 Mainnet

Audit Reports

Bug Bounty

0x is offering a Bug Bounty that pays up to $100,000 for critical exploits found.

Deployed Contracts

Contract Address
Exchange
Staking
Forwarder
Coordinator
Owner

Useful Documents

Upgrade Process

Pending the result of the vote the protocol will be updated to v3. New contracts will be added to the 0x architecture. These include the new Exchange contract and the Staking contracts. The on-chain state changes take effect after a 2 week delay.

For some time, there 0x protocol will have both the v2 and the v3 Exchange contracts active. Both of these contracts will share the same AssetProxies (contracts which have approval to move the users tokens). After some time the v2 Exchange contract will be discontinued.

Owner

With this upgrade we are introducing the ZeroExGovernor contract. This contract ultimately replaces the older [AssetProxyOwner]() from v2. The ZeroExGovernor is the evolution of the AssetProxyOwner and has a number of enhancements:

For a full list of changes the ZeroExGovernor can perform, refer to the specification. The following table has the full list of administrative functions and their respective timelock.

As part of the upgrade from v2 to v3, the Owner of the 0x protocol contracts will transition to the ZeroExGovernor contract.