Covalent Supports Hundreds of Uniswap-Like AMM Clones with New "XY=K" Endpoints | Covalent
News

Covalent Supports Hundreds of Uniswap-Like AMM Clones with New "XY=K" Endpoints

Dec 8, 2021

TLDR; Covalent has introduced a list of Class B endpoints under the XY=K family which provide the richest and most robust on-chain DEX data available today. The Unified xy=k endpoints return all the required data for any UniswapV2-like protocol such as SpiritSwap, Pangolin, SushiSwap and more, on a variety of blockchains, enabling developers to access these protocols in a matter of minutes.

What You Can GET with xy=k:

  • Get XY=K pools
  • Get XY=K pools by address
  • Get XY=K address exchange balances
  • Get XY=K Network Exchange Tokens
  • Get XY=K Single Network Exchange Token
  • Get XY=K Transactions for Account Address
  • Get XY=K Transactions for Token Address
  • Get XY=K Transactions For Exchange
  • Get XY=K Ecosystem Chart Data
  • Get XY=K Health Data

In case you’d prefer to watch the update on 2x, here’s a video version 😉

Background - What is XY=K?

XY=K is a simple formula that generates a hyperbola when plotted on the x-axis and y-axis. In crypto, this refers to the bonding curve which defines a token price relative to its supply.

In 2016, Ethereum Co-founder Vitalik Buterin proposed an idea on a Reddit forum, envisioning an on-chain Automated Market Maker (AMM) that would make use of the xy=k equation. In Vitalik’s words:

“The mechanism would be a smart contract that holds A tokens of type T1, and B tokens of type T2, and maintains the invariant that A * B = k for some constant k (in the version where people can invest, k can change, but only during investment/withdrawal transactions, NOT trades). Anyone can buy or sell by selecting a new point on the xy=k curve, and supplying the missing A tokens and in exchange receiving the extra B tokens (or vice versa). The "marginal price" is simply the implicit derivative of the curve xy=k, or y/x.”

This idea was picked up by an engineer named Hayden Adams, who began to develop the project, receiving funding from the Ethereum Foundation. Hayden created what we know today as Uniswap, which in 2018 pioneered the liquidity pool model known as the ‘Constant Product AMM’.

Arrival of the Uniswap Clones

The Uniswap AMM model generated a lot of traction, and with the entire code of Uniwap being open-sourced, it wasn’t long before various other protocols like SushiSwap, PancakeSwap and more, began forking and imitating the same architecture with (or without) tweaks on different other chains. The rapid development of new AMM clones was catalyzed by 2 things:

  1. Simple Code
  2. Liberal License

Understandably, UniswapV3 now operates with a complex architecture and a non-permissible license lol.

One Billion Possibilities with XY=K

What this batch of endpoints allows you to do is retrieve all of the underlying data for any DEX using the Uniswap model, simply by changing the name of the exchange. Because we extract and index entire blockchains in a way that requires no transformation by developers, we can provide data on any protocol, any pair, and any token. There is no limit to the available data, it is simply a matter of parameters that can be easily configured even in the browser!

This enables a variety of use-cases, but one of the primary ones we see is multi-chain DEX analytics dashboards. In the case of DEXs like SushiSwap which operate across multiple chains, there is no single place to view and compare key analytics. Combining the multi-chain feature of our Unified API with this new batch of endpoints, users can easily build solutions that display data all in one place.

Quote from Ganesh Swami, Covalent

The xy=k endpoints are the perfect way to champion our vision of ‘One Unified API, One Billion Possibilities’. We’ve crafted a single set of endpoints that can be parameterized for any DEX implementation across any blockchain, giving thousands of developers all the data they need in a common response format.

XY=K in the Wild

Check out some of the ways xy=k is currently being used in the market!

SpiritSwap

Quote from Sid, SpiritSwap

We use Covalent APIs extensively on our DEX - to get trading fee APR for our LPs, get portfolio balances and token prices and many more future use cases!

DashDeX

This project was created by @ sabelomkhwanzi at Gitcoin’s DeFi & Cross-chain Interoperability Hackathon. DashDEX visualizes key analytics around pools, swaps, liquidity, volumes, lending & borrowing stats, and trading pair positions.

What’s next

With the success we’ve seen with the xy=k endpoints, we are going to build a whole slew of endpoints that use Uniswap-Like AMMs as a pricing oracle. Stay tuned for the next product update!

Feedback and Support

For feedback and support, API users can head to the dedicated feedback-and-support channel in our Discord.

To request new features on the API, users can head to the Covalent Governance Forum and make requests within the ‘Development’ category here. Feature requests will not yet go through a formal voting process on this forum, but as we continue to decentralize the Covalent Network our forum will facilitate more and more decision making through the community.

About Covalent

Covalent provides the industry-leading Unified API bringing visibility to billions of Web3 data points. Developers use Covalent to build exciting multi-chain applications like crypto wallets, NFT galleries, and investor dashboard tools utilizing data from 26+ blockchains. Covalent is trusted by a community of 15,000+ developers and powers data for 500+ applications including 0x, Zerion, Rainbow Wallet, Rotki, Bitski and many others.

Website | Discord | Telegram | Twitter | Youtube

Leilani Ledingham

Product, Covalent

Join our newsletter

Subscribe to get news about our upcoming products and company milestones.