UPDATED WITH FINALIZED SPECS
Opening a forum thread on the upcoming v4 release.
The goal is to collect early feedback from all the integrators and market makers that we couldn’t reach in the last few weeks of ideations.
As specified in November (slides, post recording video), 0x v4 proposes to make the Exchange Proxy design used by Matcha and other 0x API /swap/v1 integrators (Metamask Zapper.fi) the canonical v4 entry point and architectural foundation for all subsequent releases.
We changed the location of the protocol specs, which are going to be hosted here
Relevant sections to formulate feedback and get ready for the release:
-
Orders
limitOrder
rfqOrder
- Architecture. This section highlights the high-level architecture of the v4 pipeline, and its different components (Proxy, Features, Transformers, FlashWallet…)
- Events
-
Functions
- Roughly same interfaces as v3, notable changes
- Vanilla
Fill
(), VanillaFillOrKill
() available - FQT to perform MarketSell/Buy (and aggregation)
- No
matchOrders
- no significant usage - No
batchFillsX
- no significant usage -
batchCancels
,batchCancelPairOrdersUpTo
(pair)
- Vanilla
- Roughly same interfaces as v3, notable changes
- Advanced topics such as using meta-transactions, setting affiliate fees, combining ERC20 transformations.
- Releases (mainly used for 0x API and RFQ upgrades)
Some notable changes vs v3:
-
there are going to be two separate order types, with their own set of functions compatibilities (check them here)
-
limitOrder
notable changes vs V3- no asset data encoding necessary - just token addresses
- Removed
makerFee
- takerFee always paid in taker asset
-
rfqOrder
notable changes vs V3- no protocol fees charged
- no asset data encoding necessary - just token addresses
- No taker/maker fees
- No
sender
field - Uses
txOrigin
to enforce check ontxn.origin
-
-
this release is ERC20-only. 0x V3 and 0x stack (Mesh, 0x API /swap, /meta-txn and /sra) will still have instances/(frozen) codes compatible with v3. 0x V3 contracts will not be discontinued
-
the new architecture allows for a multitude of upgrades to be introduced without requiring breaking changes, removing the need of yearly monolithic upgrades. In particular, Transformers allow operations on exchanged assets (for example, it is used for WETH unwrapping) without introducing risk factors (no audits needed).