Introducing 0x's next-gen pricing engine

0x v2 is the next generation trading engine for serious onchain apps, offering the most seamless swap experience at the best all-in prices.

July 15, 2024

News

Four years ago, we launched 0x Protocol v4 and 0x Swap API v1 to make it easy for DeFi developers to tap into aggregated DEX liquidity in a fast, simple, and reliable way. Since launch, 0x has enabled 500+ teams to easily tap into 130+ exchanges across 9 chains, facilitating over $154 billion in volume across 60+ million trades.

As Web3 continues to evolve, the tools we rely on for critical services must evolve as well. Onchain liquidity has become increasingly fragmented with even more tokens, DEXs, and chains, adding complexity to the problem of routing value across Web3. 

At the same time, projects are evolving into more serious businesses, requiring swaps that fit into their business holistically, from security and reliability to monetization and compliance. With the needs of growing Web3 businesses in mind, it became clear that an evolution in DEX aggregation technology was required to provide the best possible swap product.

Today, we’re excited to announce our completely new, state-of-the-art pricing engine redesigned from the ground up.

0x v2 is the next-generation trading engine for serious onchain apps, offering the most seamless swap experience at the best all-in prices with optimal trade execution, powerful new monetization controls, and enhanced security baked in at the ground level.

Serious liquidity. Serious routing. Serious security. Welcome to 0x v2.

  • Advanced routing at the best all-in prices: v2 outperforms the competition at every trade size.
  • Secure by design: Eliminate allowance exposure with Permit2.
  • Built for serious businesses: Control your balance sheet with powerful new monetization features.
  • Deep coverage: Access 6M+ tokens with unrivaled liquidity from 120+ AMMs, alongside an all-new RFQ system (in beta).
  • Plus: Lightning fast liquidity integration, full fee-on-transfer token support, improved error handling, and much more.

Advanced routing for every trade size, at the best all-in prices

Are you offering the best price to your users, all-in?

We all know the frustration of getting to the checkout page of a vacation rental or ticketing platform only to find that you’re paying much more than the advertised price after factoring in every fee under the sun. When expectations don’t meet reality, users are left feeling shortchanged. The hidden costs of DEX trading can lead to drastic differences in the quoted price you’re showing users and the actual value they receive - not the experience you want to create in your app.

Providing the best price in DeFi across every token pair, trade size, and chain is a multi-dimensional problem that requires a holistic understanding of tokens and their liquidity.

0x v2 was built to optimize for execution quality - identifying the route expected to yield the best all-in price (the actual onchain settled price with gas costs factored in), across all pairs and trade sizes at lightning fast speed and with the lowest revert rate in the industry.

How does it work? 0x Argon Router’s state-of-the-art algorithm delivers the optimal execution path and best price by optimizing on two dimensions:

1. Multiplex: Splitting a trade across multiple liquidity sources.

2. Multihop: Identifying intermediate token steps which open up deeper liquidity.

The direct route isn’t always the best route. For token pairs with limited liquidity, like long tail pairs, price impact can be particularly high. But even pairs with significant volume can suffer from thin liquidity between the buy and sell token. In these cases, the ability to hop across multiple intermediate tokens, going from Token A to B to C to D, enables optimal use of on-chain liquidity. 

Alongside state-of-the-art routing, 0x v2 also features a revamped RFQ (request for quote) system, unlocking exclusive CEX-like liquidity from sophisticated market makers and opening up additional, slippage-free avenues for trade route optimization.

Thanks to Argon, v2 outperforms the competition at every trade size.

Advanced gas awareness also ensures real-world gas costs are factored into the quoted price. Inaccurate gas estimation can impact the final all-in price or lead to the trade failing - both of which can lead to user churn.

v2’s gas estimation is 1.5x more accurate than v1, thanks to advanced simulation techniques that bypass limitations with standard tooling, resulting in better all-in prices and the lowest revert rate in the industry.

Secure by design: Eliminate allowance exposure

In order to use Web3 apps, users have to grant them permission to interact with tokens in their wallet. Usually these approvals are unlimited to complicated and upgradeable smart contracts, leaving user funds at risk. Outstanding allowances on upgradable smart contracts expose $6.5B for the top 20 tokens, according to smart contract security firm Dedaub.

It’s time-consuming and expensive to manage token allowances today, requiring users to constantly audit and revoke approvals or risk losing their tokens. Over $405 million has been stolen in approval exploits since 2020, according to revoke.cash.

Enter 0x Settler, v2’s all-new set of smart contracts that takes security to the next level. Settler fully eliminates allowance risk and bakes in protection at the ground level by leveraging Permit2.

We believe Permit2 is critical for secure swap applications, but not just any usage of Permit2. Time-bound infinite approvals, while better than the infinite approvals that never expire, still expose users to risk. That’s just not good enough.

If you are building in crypto, you know how scary hacks can be. A security vulnerability can strike at any time and affect even the best of teams. Bugs will slip by the watchful review of even the best auditors. Thus, the best way to keep user funds safe is to fundamentally reduce the amount at risk and avoid the infinite approval pattern altogether.

0x Settler does exactly that - single-use amount-based signatures, called coupons, eliminate allowance risk and protect your users from exploits. Why take the risk?

And when we say we’re serious about security, we really mean it. 0x v2’s new smart contracts are fully audited, with four audits from three separate firms, including Ourovoros, Trail of Bits, OpenZeppelin, and Trail of Bits a second time. 0x also leverages Dedaub’s industry-leading security suite to continuously analyze our contracts as we develop them.

Built for serious businesses

If you’re building a serious business in Web3, focusing solely on offering users the “best price” isn’t enough. You have to think about how swaps fit into your business holistically, from security and compliance to business ops and revenue.

Powerful new monetization controls

Swap fees are one of the most effective monetization methods for driving meaningful revenue in DeFi. Customers have already generated millions of dollars in revenue from the trading activity of their users thanks to 0x’s out-of-the-box swap fee feature.

Now, you can control exactly which tokens to collect fees in, including both buy AND sell tokens, with 0x v2 . The ability to only collect fees in stable tokens eliminates some serious headaches for Finance & Ops. 

  • Predictable balance sheet: Reduce exposure to volatile long-tail tokens that can go down 99% before you sell them.
  • Gas savings: No more manually selling tokens for more stable assets, saving your team valuable time and potentially thousands of dollars in gas.
  • Reduced accounting complexity: Long tail tokens, like memecoins, are difficult to accurately price due to lack of liquidity, which can make it difficult to track revenue.

v2 enables you to unlock new revenue streams and gives you more control over your balance sheet, saving you time and money on your journey towards building a sustainable Web3 business.

What else is coming in v2

  • Lightning fast liquidity integration: Fresh new liquidity sources can be integrated in days, not weeks. You can request new sources through our Liquidity Integration Form.
  • FoT token support: Full support for buying AND selling fee-on-transfer tokens so that your users don’t miss out on the latest memecoin.
  • Improved error handling: Error messages designed for humans, solving the most tedious part of the developer experience with descriptive vs cryptic error codes.
  • Enhanced error validation: Quotes that just work. No more onchain reverts due to quotes that can’t be validated and less dev time devoted to figuring out how to estimate gas when users don’t have a balance or allowance set.

Ready to get serious?

We’re opening beta spots for 0x v2 starting today. Book a v2 onboarding meeting to get early access.

Want to take it for a spin? You can test drive v2 on Matcha today.

Stay tuned over the coming weeks for more details about our redesigned router, aggregation capabilities, and smart contracts.

Contents

Subscribe to newsletter

By submitting you're confirming that you agree with our Terms and Conditions.
Yay! You’re signed up.
Oops! Something went wrong, but it's not your fault.

Up next

Fundamentals: SocialFi

Nov 26, 2024

Unlock powerful onchain insights with 0x Trade Analytics API

Nov 5, 2024

Fundamentals: Smart Contract Wallets

Oct 15, 2024

Compliance made easy with 0x Address Screening

Sep 26, 2024

0x's next-gen pricing engine is now live

Sep 25, 2024

Introducing state-of-the-art Buy/Sell Tax support

Sep 4, 2024

Take control of your balance sheet with 0x v2

Aug 15, 2024

0x v2 bug bounty program

Jul 30, 2024

What does the "best price" in DeFi really mean?

Jul 23, 2024

Eliminate allowance risk with Permit2

Jul 17, 2024

0x Dev Digest: May 2024

May 31, 2024

Frame spotlight: Paycaster

May 21, 2024

Frame spotlight: Airstack

May 9, 2024

Power up your Farcaster Frames with 0x swaps

May 2, 2024

0x Dev Digest: April 2024

Apr 30, 2024

Introducing 0x Trade Analytics

Mar 12, 2024

Coinbase Case Study

Jan 30, 2024

Introducing gasless swaps and approvals with Gasless API

Jan 22, 2024

Bitcoin ETFs have arrived

Jan 12, 2024

Building in the open: 0x pricing update

Dec 11, 2023

Matcha leverages Gasless API to bring users the most frictionless trading experience in DeFi

Nov 30, 2023

0x Dev Digest: October 2023

Nov 2, 2023

Monetize crypto trading in your app with Swap API

Oct 26, 2023

0x Dev Digest: September 2023

Oct 3, 2023

A comprehensive analysis of RFQ performance

Sep 26, 2023

Unlock optimal trades in Swap API with 0x RFQ liquidity

Sep 20, 2023

0x Dev Digest: August 2023

Aug 31, 2023

Portal launches swaps in its white label MPC wallet powered by 0x

Aug 16, 2023

0x Swap API is now live on Base

Aug 9, 2023

Introducing paid plans for Swap API

Jul 24, 2023

Decreasing Frictions in DeFi hackathon recap

Jul 12, 2023

0x's pricing principles

Jul 3, 2023

0x Dev Digest: June 2023

Jun 30, 2023

App spotlight: tastycrypto

Jun 27, 2023

App spotlight: 31Third

Jun 22, 2023

0x 101: Intro to gasless API

Jun 13, 2023

Inspiration for building with Swap API

Jun 8, 2023

0x Dev Digest: May 2023

May 31, 2023

Fundamentals: What are gas fees?

May 25, 2023

Decreasing Frictions in DeFi Hackathon

May 12, 2023

Swap API liquidity management

May 18, 2023

0x 101: Getting started with Swap API

May 16, 2023

0x 101: Intro to Swap API

May 9, 2023

0x 101: Intro to 0x Orders

May 4, 2023

0x 101: Intro to 0x Protocol

Apr 27, 2023

A new home for 0x Protocol

Apr 24, 2023

Say hi to the new 0x

Apr 20, 2023

0x Year in Review 2022

Jan 5, 2023

0x Swap API expands to Arbitrum

Sep 22, 2022

Managed liquidity

Apr 23, 2020

0x Smart Order Routing

May 19, 2020

App spotlight: Taho

Mar 8, 2022

Fundamentals: What is a Layer 2 chain?

Apr 19, 2023

Fundamentals: What is the difference between quoted, executed, and adjusted prices?

Apr 19, 2023

Fundamentals: What is price impact?

Apr 19, 2023

Fundamentals: What is slippage?

Apr 19, 2023

Fundamentals: What is an automated market maker (AMM)?

Apr 19, 2023

Fundamentals: What is market making?

Apr 19, 2023

Fundamentals: What is a DEX aggregator?

Apr 19, 2023

Fundamentals: What is liquidity?

Apr 19, 2023

Fundamentals: What is a decentralized exchange (DEX)?

Apr 19, 2023

0x at ETHDenver 2023

Mar 21, 2023

The 0x Mission and Values

Jun 7, 2018

Announcing support for new testnets

Aug 10, 2022

0x Swap API expands to Binance Smart Chain

Mar 17, 2021

Scaling DeFi — Layer One

Sep 1, 2021

Introducing Slippage Protection

Jul 14, 2022

San Francisco Blockchain Week 2022 Recap

Nov 21, 2022

0x Swap API adds new liquidity sources

Jul 11, 2022

Review of slippage performance

Sep 14, 2022

Phuture case study

Oct 20, 2022

Measuring the impact of hidden DEX costs

Apr 14, 2022

Market making in DeFi

Aug 12, 2021

Introducing 0x Labs

Jun 22, 2020

Introducing 0x Explorer

Oct 26, 2022

Growing DeFi with professional market makers

Aug 26, 2020

0x 101: How to Access 0x Data

Apr 25, 2023

GameStop chooses 0x Swap API

Jul 8, 2022

Build on Base with 0x

Feb 23, 2023

A comprehensive analysis on DEX liquidity aggregators’ performance

Oct 1, 2020

Announcing 0x Swap API v1

Oct 1, 2020

Access all DEX liquidity through 0x Swap API

Jan 28, 2020

Announcing the 0xpo Summit 2022

Aug 24, 2022

0x Protocol, a preview of what’s to come

Mar 16, 2023

Update to our Privacy Policy

Mar 14, 2023

Price Impact Protection has arrived

Dec 14, 2022

0x Limit Orders Go Multi-Chain

Dec 23, 2021

0x Labs raises $70M Series B led by Greylock to continue expanding Web3’s core exchange infrastructure

Apr 26, 2022

0x launches Tx Relay API in beta, with Robinhood Wallet as first partner

Mar 1, 2023

0x Labs raises $15M Series A to bring decentralized exchange markets to a global audience

Feb 5, 2021

App spotlight: Zerion

Jun 22, 2022

App spotlight: Matcha

Nov 24, 2021

App spotlight: DexGuru

Jun 17, 2021

App spotlight: DEXTools

Sep 23, 2021

App spotlight: DODO

Aug 10, 2021

App spotlight: DappRadar

Dec 16, 2021

App spotlight: DeFi Saver

Jul 20, 2021

0x + Brave partner to make crypto and DeFi more accessible to everyone

Jul 7, 2021

0x Swap API now supports 0x Protocol v4

Mar 1, 2021

0x Swap API is now available on Fantom

Oct 26, 2021