Swap API liquidity management

Take a peek under the hood of how we manage Swap API’s liquidity portfolio.

May 18, 2023

Under the Hood

Swap API sources liquidity from over 100 decentralized exchanges, which can easily be accessed through a single endpoint. That’s the deepest liquidity out there.

Similar to managing nodes or other layers of infrastructure, managing liquidity sources is a piece of the infrastructure stack that is incredibly important to the success of your app. Missteps in sourcing liquidity can manifest in poor experiences for users, weak pricing, lack of token coverage, and increased slippage.

At 0x, we have a team dedicated to managing liquidity, ensuring that we onboard and offboard the right sources to deliver the most value to users. We manage the overhead and allow you to focus on building what matters: your product. 

Let's take a peek under the hood of how we manage Swap API’s liquidity portfolio.

Why is liquidity management important?

Why is it important that we actively manage our liquidity portfolio? Public liquidity, by nature, is an open resource. As such, it’s important that 0x offers the most competitive liquidity portfolio in terms of pricing and coverage. The higher performing, diverse portfolio that we offer, the more value we can deliver to users.

Ultimately, we curate liquidity based on the value that can be passed on to users. We continuously monitor and benchmark our performance to deliver the best product possible.

Our liquidity management framework:

  1. Discovery: Programmatically discover new valuable liquidity sources.
  2. Decision: Should the new liquidity sources be aggregated or not?
  3. Performance Assessment: Continuous assessment of what value a source is adding to the system.
  4. Offboarding: When a source dries up, we remove it from the system to maintain scalability.

Let’s dive a little deeper into each one.

Discovery

There are hundreds upon hundreds of liquidity sources spread across the 8 chains that we support. Given the sheer number of liquidity sources in the ecosystem, how do we find the highest value sources for our users? The first step is discovering which high-quality sources aren’t currently integrated.

The first method we utilize is automated discovery. We’ve developed two internal bots that continuously report the top sources on each chain that Swap API supports. The first is our Discovery Bot. This bots ping DeFi Llama and checks, out of all the liquidity sources they index, which ones we don’t have. We run these reports on a weekly basis. Our second bot is a Curve Pools bot. In Curve, pools can be spun up on a weekly basis. Staying up-to-date on these pools manually is next to impossible, so automating this process allows us to flag high liquidity pools.

Second is community input. We also identify new sources through our Liquidity Integration Form, where devs and projects can manually submit liquidity sources to us. Finally, our Liquidity Integration Team continually monitors the ecosystem through social media to keep an eye out for new projects and liquidity providers.

Decision Framework

We’ve now taken a galaxy of liquidity sources and narrowed it down to a short list of potential liquidity sources. Once we have a sense of potential new liquidity sources that Swap API is not currently aggregating, the question becomes: should these new sources be in our portfolio or not? 

When we vet new liquidity sources we measure two fundamental aspects: Pricing and Coverage. Will this source provide a price improvement compared to our existing sources or does this source provide access to tokens that we are currently not supporting.

We utilize a simple decision framework, an impact-effort matrix, which is based on some foundational parameters.

Impact

Pricing: is it improving pricing for specific pairs we already have a market for in our existing portfolio?

Coverage: is it providing liquidity for a market we’ve never had, i.e. new tokens that our existing portfolio doesn’t have coverage for?

Effort

Dev time: some integrations require one day and some can require up to one month

If the source requires low effort and is high impact, integration will be prioritized. If it requires high effort and is low impact, integration is deprioritized.

Performance Assessment

Once a new source has been added to our portfolio, we closely monitor both post-integration performance alongside how our portfolio is performing overall. This includes monitoring coverage and volume for relevant token pairs at the source level and for chains at the portfolio level.

Why is this important? We need to have a benchmark for how we’re performing against the rest of the ecosystem. This also allows us to be intentional about how we spend our resources. For instance, do we need to focus on improving our sources on BNB Chain vs Avalanche?

Offboarding

Our strategic approach to liquidity will always be quality over quantity.

As we add new sources, we are also adding complexity to our infrastructure. We can not continue increasing our portfolio infinitely because it doesn’t scale. For that reason, it’s important to remove dry liquidity sources. Offboarding sources allows us to maintain an efficient and high performing portfolio.

If we find that a given source is underperforming, an assessment is made whether it should be removed from the portfolio. The parameters we use in determining if a source should be offboarded are 7 day volume, 30 day volume, and 6 month volume.

Start building with Swap API today

One integration with 0x unlocks thousands of tokens on the most popular blockchains and aggregated liquidity from 100+ AMMs and private market makers. Swap makes it easy for teams, big and small, to tap into deep DEX liquidity, reducing infrastructure overhead so that you can focus on what matters: your product.

Ready to start building? Check out our guide below to get started with Swap API.

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

Introducing 0x's next-gen pricing engine

Jul 15, 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

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