0x v3 Vote Recap & Upgrade Guide

0x v3 is now live on Ethereum mainnet. Migrate now!

Important information for the developer community on how to migrate to v3. Upgrade and connect to the new v3 endpoint at api.0x.org/sra!



Last week, we kicked-off the vote on 0x v3, also known as ZEIP-56. ZRX holders had the opportunity to vote from November 4th through the 11th. We are thrilled to announce that ZEIP-56 was approved by the token holders! Thanks to everyone who participated in the voting process.



As with previous votes, the 0x Core Team collected cryptographically signed votes off-chain and tallied up votes based on a snapshot of ZRX balances at a given block height. Again, this is a temporary coordination process that we are using until we transition to a binding on-chain mechanism.



We are very excited about the launch of 0x v3, as this upgrade will deepen networked liquidity and improve the developer experience building on 0x. The features included in v3 enable 0x to become a community-owned liquidity API and the DEX liquidity aggregator for the greater DeFi ecosystem.



Here’s a recap of the vote results:

6,608,613 ZRX used

In Favor: 99%

Against: 1%

What happens now?

In two weeks, 0x v3 will be connected to 0x’s AssetProxies contracts. This means that all of the new features developed in v3 will be available for DeFi apps, relayers and traders.



There are a few steps developers need to take in order to enjoy the benefits introduced by this new release, which include ZRX staking, liquidity bridges for DEX aggregation, and other technical features.



The purpose of the following sections is to provide the necessary details to ensure the migration to v3 is as smooth as possible. A number of teams are already in contact with the 0x Core Team regarding the v3 update, and we encourage anyone who needs migration support to contact us in our Discord chat.



We expect the majority of the available liquidity to migrate pretty quickly (1–2 weeks), therefore we suggest DeFi developers, relayers and other ecosystem projects to update promptly. While the current version 2.1 of the protocol will remain live until the majority of the ecosystem has migrated to v3, it will not be supported by the 0x Core Team from 12/02 onwards.

How to migrate from v2 to v3

The following sections are extracted from a more comprehensive migration guide on github. You can also take a look at the change log in the v3 spec. We have divided this section to focus specifically on DeFi integrators, Market Makers, Relayer and Arb Bots (or other algo traders).

DeFi Integrators

Update the Exchange address from v2.1 to v3, if applicable in your codebase.

Upgrade to the latest 0x packages using the protocolV3 tag. For example, run yarn upgrade @0x/order-utils@protocolV3 in your repo.

tag. For example, run in your repo. The ecosystem is also moving to 0x Mesh to share orders and discover liquidity. 0x Mesh is a decentralized network where all participants share orders equally with each other. We recommend projects deploy their own Mesh nodes to contribute to the network. For light clients, we have created a gateway to Mesh available as an endpoint (api.0x.org/sra) which follows the SRA specification. The mainnet API will be fully functional from 12/02, in the meantime, you can test the Kovan endpoint. See this section of the migration guide for more details.

If orders are filled via a Contract (CFL), each trade now requires a Protocol Fee to be executed. The fee is proportional to the gas price paid (multiplied by a multiplier currently set at 150,000 units of gas). The entry point on-chain function used may need to become payable in order to forward the fee from msg.sender . This fee can also be paid in WETH by the contract with an additional allowance that needs to be set once by the contract.

. This fee can also be paid in WETH by the contract with an additional allowance that needs to be set once by the contract. If orders are filled via an Externally Owned Account, each trade now requires a Protocol Fee to be executed. This fee is proportional to the gas price paid. This fee is paid by attaching ETH to the transaction.

Alternatively (when no or not enough ETH is attached), this fee can also be paid in WETH with an additional allowance that needs to be set once by the user.

Alternatively (when no or not enough ETH is attached), this fee can also be paid in WETH with an additional allowance that needs to be set once by the user. The 0x Order Format has changed with new additional fields. Ensure the packages you use to fill orders are up to date.

No additional allowance approvals are required. As part of the 0x governance upgrade, the ERC20 approvals set on the 0x Asset Proxies will be migrated to v3.

Market Makers

Update the Exchange address from v2.1 to v3, if applicable in your codebase.

The order format changes from v2 to v3, with two additional fields in the latest release. See Order Format for more details.

Upgrade to the latest 0x packages using the protocolV3 tag. For example, yarn upgrade @0x/order-utils@protocolV3

tag. For example, Sharing liquidity via Mesh is the fastest and widest distribution channel to reach prospective takers. Deploy your own Mesh node and subscribe to events to allow you to discover other orders and receive fill updates on your orders. Find more details on how to get started here.

When transitioning to v3, the only required action is to cancel your v2 orders and create new orders on v3. Orders from v2 cannot be reposted to v3 as there is replay protection. Cancellation can be performed efficiently using cancelOrdersUpTo (if using an incrementing salt) or can be performed order by order with batchCancelOrders . Ensure your orders are canceled on v2 prior to creating new orders on v3.

(if using an incrementing salt) or can be performed order by order with . Ensure your orders are canceled on v2 prior to creating new orders on v3. No additional allowance approvals are required. As part of the 0x governance upgrade, the ERC20 approvals set on the 0x Asset Proxies will be migrated to v3.

You will begin to receive rebates from takers that fill your orders, see the next section for more information. The 0x team will be reaching out to known Market Makers to assist in setup.

Relayers

Update the Exchange address from v2.1 to v3, if applicable in your codebase.

The order format changes from v2 to v3, with two additional fields in the latest release. See Order Format for more details.

Upgrade to the latest 0x packages using the protocolV3 tag. For example, yarn upgrade @0x/order-utils@protocolV3

tag. For example, The ecosystem is moving to use 0x Mesh to share and discover liquidity. 0x Mesh is a decentralized network where all participants share orders equally with each other. We recommend projects deploy their own Mesh nodes to contribute to the network. See this section of the migration guide for more details.

Takers of 0x liquidity now pay a protocol Fee proportional to the gas price selected to execute the transaction. Depending on your relayer UX and architecture, you might need to educate your users about this additional fee.

Allow your users to cancel v2 orders and create new orders for v3. The exchange address will be known ahead of time, so orders can be created prior to the protocol being upgraded.

Become acquainted with the calculation of the protocol fee, 150,000 * ordersFilled * gasPrice . The protocol fee can be paid in ETH, which will have to be sent in the transaction according to the gas price selected. If your users lower their gas price in the wallet the protocol will return the excess fees. If your users increase the gas price it is possible the provided ETH value in the transaction is not enough to cover the Protocol Fee. Alternatively (when no or not enough ETH is sent), this fee can also be paid in WETH with an additional allowance that needs to be set once by the user.

Arb Bots and Other Algo Traders

Depending on your setup, you might want to refer to the previous sections in addition to the following recommendations:

Update the Exchange address from v2.1 to v3, if applicable in your codebase.

The order format changes from v2 to v3, with two additional fields in the latest release. See Order Format for more details.

Upgrade to the latest 0x packages using the protocolV3 tag. For example, yarn upgrade @0x/order-utils@protocolV3

tag. For example, Become acquainted with the calculation of the protocol fee, 150,000 * ordersFilled * gasPrice . The protocol fee can be paid in ETH, which will have to be sent in the transaction according to the gas price selected. Alternatively (when no or not enough ETH is sent), this fee can also be paid in WETH with an additional allowance that needs to be set once.

How to start staking ZRX (market makers and liquidity providers)

0x v3 introduces a staking system that grants market makers ownership in the protocol and monetary rewards based on their share of liquidity provided and the share of ZRX tokens staked in their pools.



We have just published a new guide that assists market makers in the registration and management of these staking pools, to make sure they avoid losing the liquidity rewards they are eligible for. The process is anonymous, non-custodial and secure.



The 0x Core Team is already working with a few established market makers to assist them in the process, so they can create live staking pools and collect protocol fees from day 1. Since the staking contract is already deployed on mainnet, it is possible to create staking pools now.



As part of the launch, 0x is also planning to release a web interface where all ZRX holders can delegate their tokens to market maker pools to receive a proportional amount in liquidity rewards. Stay tuned for more updates in the coming weeks!



Contact us via Discord if you have any questions regarding the update or need help from our team.

Update: Since the release of this post, the launch of v3 has been delayed from November 25th to December 2. Read ZEIP-72 for details.

🤝 Join the Global 0x Community

Twitter | Discord Chat | Reddit | YouTube | Facebook | LinkedIn

👨‍💻👩‍💻 Developer Resources

0x Documentation | GitHub

🙋‍♂️🙋‍♀️ The 0x Core Team is Hiring!

Work at 0x | Open Positions