Price Impact Protection is here. Don't get rekt.
Today we’re excited to be rolling out Price Impact Protection for traders and developers.
What is price impact?
Price impact is the influence that a user’s trade has over the market price of an underlying trading pair. It is directly related to the amount of liquidity in the pool. Price impact can be particularly high for illiquid trading pairs and in certain instances can cause significant losses for traders.
This is different from price slippage, although the terms are often mistakenly used interchangeably. Price slippage refers to the difference between the executed price and the quoted price, caused by external market movements unrelated to your trade. In a recent post, we did a deep dive on the mechanics of slippage and its effects on DEX performance.
Our solution to price impact
We are launching Price Impact Protection to make it easier to protect users from getting rekt by illiquid markets. Despite Swap API enabling access to the deepest liquidity from over 70+ exchanges, there are still some long-tailed token pairs that suffer from suboptimal liquidity on decentralized exchanges.
When we are able to calculate price impact estimates, users leveraging the Swap API will be notified when their trade faces a price impact over a certain threshold. The API will return an error of insufficient liquidity due to the price impact being higher than the defined limit. The threshold is easily customizable by setting
PriceImpactProtectionPercentage anywhere from 0-1, so we encourage every Swap API user to customize this parameter based on their needs and tolerance.
Price Impact Protection is an optional feature - the default threshold will be set at 1. Developers and API users who want to take advantage of it will need to opt-in by adjusting this setting.
Developers can also surface this information in their UI so users can see the potential price impact of a trade prior to submitting an order. Developers can simply ping the Swap API [swap/v1/quote] and use the returned
How 0x API protects users
Price Impact Protection is just one of the features we offer to protect users. Earlier in the year, we launched Slippage Protection, a feature in 0x API that enables MEV-aware smart order routing for DEX trades. Slippage Protection protects users from sandwich attacks and MEV bots. In the case of orders with positive slippage, 0x API returns the difference back to the user.
Start building with 0x API today
We’re excited to equip DeFi developers and enterprise users with the tools and infrastructure to offer the best DEX trading experience for their users.
Starting today, Price Impact Protection is available as an optional feature. Developers and API users will need to opt-in to enable it. If you are a developer looking for more information about Price Impact Protection and 0x API, get started with our developer docs. Enterprise users who require an API key, please contact us directly.
To stay updated, follow us on Twitter.