({
chainId: 1,
address: '0x6b175474e89094c44da98b954eedeac495271d0f',
symbol: 'DAI',
name: 'Dai Stablecoin',
decimals: 18,
metadata: {
logoURI: 'https://assets.coingecko.com/coins/images/9956/large/4943.png',
tags: ['stablecoin', 'defi'],
coingeckoId: 'dai',
origin: 'native',
},
})
DAI.metadata.tags?.includes('stablecoin') // true
const json = DAI.toJSON()
json.metadata?.logoURI // preserved in serialized form
```
Note: You donāt need to preātype `metadata` ā TypeScript infers it from the constructor object. If desired, you can still use a generic or `satisfies { ... }` for stricter typing.
### Validation with Zod
Each concrete token class exposes a Zod schema factory for its serialized shape. On EVM, use `serializedEvmTokenSchema({ metadata })` to validate parsed JSON. You can supply a custom `metadata` schema to enforce structure; if omitted, metadata defaults to a permissive `record(unknown).optional().default({})`.
```ts twoslash
import * as z from 'zod'
import { EvmToken, serializedEvmTokenSchema } from 'sushi/evm'
// Optional: a stricter metadata schema
const metadataSchema = z.object({
logoURI: z.string().url().optional(),
tags: z.array(z.string()).optional(),
coingeckoId: z.string().optional(),
})
// Build the schema for serialized tokens
const schema = serializedEvmTokenSchema({ metadata: metadataSchema })
// Example validation
const input = {
chainId: 1,
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
symbol: 'USDC',
name: 'USD Coin',
decimals: 6,
type: 'token' as const,
metadata: {},
}
const parsed = schema.parse(input)
const token = EvmToken.fromJSON(parsed)
```
## š©āš» Developer Portal
### Welcome to the Developer Portal documentation
This page is under construction. š
## šļø Governance
### Model
SushiSwap is governed by its community, which participates in forum discussions and votes on proposals on the SushiSwap Snapshot. Only proposals posted to the Snapshot voting system by the CORE team can be considered binding if passed with a quorum.
The community votes on major DAO structural changes, tokenomics, and the use of the devfund wallet. In contrast, the core team handles organizational operations and changes in the SushiSwap protocol, as mandated in the following proposal:
[https://forum.sushi.com/t/governance-reorg-pre-proposal/28](https://forum.sushi.com/t/governance-reorg-pre-proposal/28)
Any use of the devfund wallet requires that the Treasury Council Multisig members sign it as directed by the community via a successful proposal and Snapshot vote outlined in the DAO's foundation rulebook. There must be at least 4 out of 6 signatures to approve a transaction.
The Multisig members are trusted crypto industry members, and the community votes for the active signers via Snapshot.
Any changes within the core team's purview must pass the Operations Multisig with at least three signatures.
Our long-term goal is to establish a DAO with working, trustless governance. We welcome positive discourse from community members on progressing our governance model by participating in our forums and the #governance channel of the SushiSwap Discord.
### Proposals
Any community member is welcome to post a proposal on our forums. When you create a thread, please follow the template shown so prospective voters can easily read through the proposals. If you want a poll added to your thread, please contact a core or community team member.
If your proposal gains enough traction, the core team will bring it up for voting on our Snapshot voting platform. The community will vote with SUSHIPOWAH to decide the outcome.
Our Snapshot voting platform can be found here, where all Sushi proposals are housed.
SUSHIPOWAH is our voting metric and is decided as follows:
Each $SUSHI in the SUSHI-ETH pool is worth 2 SUSHIPOWAH.
Each $SUSHI held via xSUSHI tokens is worth 1 SUSHIPOWAH.
A vote must gain a quorum of at least 5 million SUSHIPOWAH to pass and become binding.
Please note: To be an eligible voter for any proposal on our Snapshot, you must have SUSHIPOWAH from any or all of the three above options when the vote starts. This means that you cannot simply buy $SUSHI tokens to vote on an already ongoing vote, and is intended to reduce the risk of influence by whales and flashloaners.
## Tokenomics
### 1. Token Overview
* **Total Supply** 280m
* **Symbol** SUSHI
* **Chain** ETHEREUM
* **Address** [0x6B3595068778DD592e39A122f4f5a5cF09C90fE2](https://etherscan.io/token/0x6B3595068778DD592e39A122f4f5a5cF09C90fE2)
SUSHI was introduced in August 2020 as part of SushiSwapās fork of Uniswap, aiming to align incentives for liquidity providers and community governance.
### 2. Supply & Issuance
1. **Initial Emission:**
At launch, SUSHI emission was set at 1,000 SUSHI per Ethereum block for the first \~2 weeks to bootstrap liquidity.
After this āfair launchā period, the block rewards were reduced to 100 SUSHI per block.
2. **Ongoing Inflation:**
Because block rewards continue indefinitely, SUSHI does not have a hard-capped maximum supply.
The protocol can adjust reward rates through governance if needed (e.g., to reduce inflation).
3. **Distribution of Rewards:**
A portion of newly minted SUSHI goes to liquidity providers in eligible SushiSwap liquidity pools.
Historically, 10% of newly minted tokens were allocated to a developer fund, though the allocation details have been adjusted over time via governance proposals.
### 3. Utility and Value Accrual
1. **Governance:**
SUSHI is primarily a governance token, enabling holders to vote on SushiSwapās protocol proposals.
Important protocol changesāsuch as fees, reward schedules, and new product launchesāare decided by SUSHI token holders.
2. **Staking (SushiBar / xSUSHI):**
SUSHI holders can stake tokens in the SushiBar contract to receive xSUSHI, representing a share of the SushiBar pool.
Protocol fees from trades (typically 0.05% of each swap) are used to buy back SUSHI on the open market. These purchased tokens are distributed to the xSUSHI pool, effectively creating a continuous buyback mechanism that benefits stakers.
3. **Liquidity Incentives:**
Liquidity providers in selected SushiSwap pools earn newly minted SUSHI tokens as an incentive to lock capital.
This mechanism helps ensure deep liquidity across various trading pairs on SushiSwap.
### 4. Governance & Protocol Control
1. **On-chain Proposals:** SUSHI holders can create or vote on proposals that affect emissions, fee parameters, or treasury allocations.
2. **Treasury & Dev Fund:** The SushiSwap treasury (funded partly through block rewards and partially through trading fees) is used to support continued ecosystem growth, grants, audits, and community initiatives.
### 5. Key Tokenomic Features
1. **Continuous, Controlled Inflation:**
No maximum supply; block rewards continue indefinitely.
Governance can adjust block rewards to manage inflation.
2. **Fee Buybacks to Stakers:**
A portion of trading fees (0.05% out of a typical 0.30% total swap fee) is diverted to buy and distribute SUSHI to xSUSHI holders.
Community-Centric Design:
SUSHIās governance-first ethos aims to keep power in the hands of the community, rather than a small group of core developers or investors.
#### In Summary
The SUSHI token lies at the heart of SushiSwapās community-driven DEX model on Ethereum. It provides both governance rights and value accrual through staking rewards and protocol fee buybacks. Although SUSHI lacks a hard cap, its emission rate is subject to community governance, balancing liquidity incentives with inflation. By combining yield farming incentives, fee revenue sharing, and on-chain governance, SUSHIās tokenomics aim to foster a sustainable and community-aligned ecosystem.
import { AddressTable } from '../../components/table'
import {
BLADE_POOL_ADDRESSES,
BLADE_COVE_ADDRESSES,
BLADE_PERMIT_ROUTER_ADDRESSES,
BLADE_LP_TRANSFER_ADDRESSES,
BLADE_REGISTER_ADDRESSES,
BLADE_FEE_SPLIT_ADDRESSES,
BLADE_FARM_FEE_SPLIT_ADDRESSES,
BLADE_VAULT_ADDRESSES,
BLADE_FARMING_HELPER_ADDRESSES,
BLADE_TRANSFER_HELPER_ADDRESSES,
} from '../../constants/blade'
## Blade
**Blade** is Sushi's RFQ (Request for Quote) trading protocol that provides better pricing through off-chain liquidity aggregation and on-chain settlement.
### Deployments
#### Pool Register
#### Pool
#### Cove
#### Permit Router
#### LP Transfer
#### Fee Split
#### Farm Fee Split
#### Vault
#### Farming Helper
#### Transfer Helper
import { AddressTable, NetworkTable } from '../../components/table'
import {
SUSHISWAP_V3_FACTORY_ADDRESS,
SUSHISWAP_V3_INIT_CODE_HASH,
SUSHISWAP_V3_POSITION_MANAGER,
SUSHISWAP_V3_TICK_LENS,
SUSHISWAP_V3_QUOTER,
} from 'sushi/evm'
## clAMM (SuhiSwap V3)
The **Concentrated Liquidity Automated Market Maker (clAMM)**
### Deployments
#### Factory
#### Position Manager
#### Tick Lens
#### Quoter
#### Init Code Hash
import { AddressTable, NetworkTable } from '../../components/table'
import {
SUSHISWAP_V2_FACTORY_ADDRESS,
SUSHISWAP_V2_ROUTER_ADDRESS,
SUSHISWAP_V2_INIT_CODE_HASH
} from 'sushi/evm'
## cpAMM (SuhiSwap V2)
The **Constant Product Automated Market Maker (cpAMM)**
### Deployments
#### Factory
#### Router
#### Init Code Hash
## cpAMM
...
import { AddressTable } from '../../components/table'
import { RED_SNWAPPER_ADDRESS } from 'sushi/evm'
## Red Snwapper
RedSnwapper is a facade for the execution router contracts (RouteProcessor), and handles single & multi token swaps.
### Functions
#### snwap
```solidity
function snwap(
IERC20 tokenIn,
uint amountIn,
address recipient,
IERC20 tokenOut,
uint amountOutMin,
address executor,
bytes calldata executorData
) external payable returns (uint amountOut)
```
1. Transfers `amountIn` of `tokenIn` to `executor`.
2. Launches `executor` with `executorData` and `value = msg.value`.
3. Checks that `recipient`'s `tokenOut` balance increased by at least `amountOutMin`.
##### Parameters
| Name | Type | Description |
| -------------- | --------- | -------------------------------------------------------------------- |
| `tokenIn` | `IERC20` | The token being swapped |
| `amountIn` | `uint` | The amount of `tokenIn` to swap (0 means take from contract balance) |
| `recipient` | `address` | The address receiving the swapped tokens |
| `tokenOut` | `IERC20` | The token to receive after the swap |
| `amountOutMin` | `uint` | Minimum amount of `tokenOut` that must be received |
| `executor` | `address` | The contract that will execute the swap logic |
| `executorData` | `bytes` | Data payload passed to the `executor` |
##### Return Values
| Name | Type | Description |
| ----------- | ------ | ---------------------------------------- |
| `amountOut` | `uint` | The actual amount of `tokenOut` received |
#### snwapMultiple
```solidity
function snwapMultiple(
InputToken[] calldata inputTokens,
OutputToken[] calldata outputTokens,
Executor[] calldata executors
) external payable returns (uint[] memory amountOut)
```
1. Transfers each of the `inputTokens` to `inputTokens[i].transferTo`.
2. Launches all specified `executors`.
3. Checks that the final `recipient`'s `tokenOut` balance(s) are each at least their corresponding `amountOutMin`.
##### Parameters
| Name | Type | Description |
| -------------- | --------------- | -------------------------------------------------------------------- |
| `inputTokens` | `InputToken[]` | Array of input token structs, each describing what token to transfer |
| `outputTokens` | `OutputToken[]` | Array of output token structs, each describing the expected output |
| `executors` | `Executor[]` | Array of executor structs to be launched sequentially |
##### Return Values
| Name | Type | Description |
| ----------- | --------------- | -------------------------------------------- |
| `amountOut` | `uint[] memory` | Actual amounts of each output token received |
### Deployments
### Examples
#### Using a contract to call RedSnwapper
Below is an example Solidity contract that can be used to call RedSnwapper.
It expects "self" as the `source` parameter when calling the API, and will pre-fund RedSnwapper with the input tokens before executing the swap.
In case "sender" is used as the `source`, the contract can be simplified by removing the token transfer logic, although an `approve` call is still be needed.
The `source` parameter is disregarded when the input token is native (ETH), in which case the contract must be pre-funded with enough ETH to cover the swap.
```solidity
contract RedSnwapperProxy {
constant address NATIVE = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
constant address RED_SNWAPPER = 0xac4c6e212a361c968f1725b4d055b47e63f80b75;
function swap(bytes calldata data) external payable returns (uint256 amountOut) {
// Skip the first 4 bytes (function selector), decode the input token and amountIn
(address tokenIn, uint256 amountIn) = abi.decode(data[4:], (address, uint256));
// If the "source" parameter used to call the API is "self", we need to pre-fund the contract
uint256 nativeAmount = 0;
if (tokenIn == NATIVE) {
require(msg.value >= amountIn, "Not enough ETH sent");
nativeAmount = amountIn;
} else {
IERC20(tokenIn).transfer(RED_SNWAPPER, amountIn);
}
// Call RedSnwapper
(bool success, bytes memory returnData) = RED_SNWAPPER.call{value: nativeAmount}(data);
require(success, "RedSnwapper call failed");
amountOut = abi.decode(returnData, (uint256));
}
}
```
import { AddressTable } from '../../components/table'
import { SUSHI_ADDRESS } from 'sushi/evm'
## Sushi
On some chains, Sushi tokens are considered insolvent due to the bridges that they were issued through being hacked or becoming defunct. This applies particularly to anySushi from the Multchain/AnySwap bridge and 1Sushi from the Harmony v1 bridge.
### Deployments
import { AddressTable } from '../../components/table'
import { XSUSHI_ADDRESS } from 'sushi/evm'
## xSushi Token
Currently xSushi is only available on Ethereum, or bridged to Polygon through the [Polygon PoS bridge](https://portal.polygon.technology/bridge).
### Deployments
## What is Blade?
#### The Blue-Chip DEX
Blade is a DEX designed for blue-chip tokens (e.g., ETH, WBTC, USD stablecoins, etc.) and no impermanent loss. Blue-chip tokens comprise 70% of all on-chain trading volume.
Blade's novel architecture makes money for LPs using the same arbitrage strategy used by professional market makers, but implemented in a permissionless and non-custodial manner. In contrast to most DEXs, Blade's LP yields are not generated from fees.
Blade computes prices off-chain using a sophisticated formula that incorporates low-latency price feeds from centralized exchanges along with a snapshot of on-chain state. It then uses on-chain proofs to validate prices and preserve permissionlessness. This allows Blade to make money from arbitrage, instead of paying a tax to arbitrageurs, while keeping gas fees low for traders. On Blade, liquidity providers take home superior yields with **no impermanent loss** and traders can expect no whales or bots front-running their trades.
## Blade's Benchmark: No Impermanent Loss
Blade's pools act like a daily rebalancing portfolio composed of roughly 1/3 ETH, 1/3 WBTC, and 1/3 stablecoins (with zero transaction costs for rebalancing). **This rebalancing strategy results in no impermanent loss for LPs.**
#### How Blade Stacks Up Against the Benchmark
Blade's benchmark is no impermanent loss. It achieves this through tracking a theoretical costless DRP.
If we look at a sample of Blade's performance from September 11, 2022 through October 10, 2022, we see that it closely tracks the DRP while staying slightly ahead of it--finishing the interval almost 40 basis points ahead.
***Note:** Blade is "Clipper" in the chart below; Clipper was the initial name of Blade*

Blade was within 1 bps of the DRP for more than three-quarters of the days in the period. For those days where Blade and the DRP diverged by more than 1 bps, Blade was in the leading position more than two-thirds of the time (23% vs. 10% of days).
| **Blade LP Daily Performance vs. Benchmark** | **Frequency** |
| -------------------------------------------- | ------------- |
| > 1 basis point worse | 10% |
| 1 basis point worse to 1 basis point better | 77% |
| > 1 basis point better | 23% |
The reason for return divergence is that Blade's FMM will make trades continuously with traders over the course of a day, while the theoretical DRP is simulated to costlessly rebalance *once* per day. Despite the divergences, the daily correlation of percent returns to the returns of the DRP was extremely high at Ļ = 0.9996.
Blade's close tracking of the DRP is what enables it to hit its no impermanent loss benchmark.
import { Callout } from 'vocs/components'
## How Blade Makes Money for LPs
Blade makes money for LPs through arbitrage. This requires significantly more sophisticated formulas than can be supported on-chain, given gas prices and block time constraints. Thus, Blade does not rely on the Constant Product Market Maker (CPMM) used by most DEXs. Instead, Blade has a unique architecture called the Formula Market Maker (FMM), which enables off-chain computation without compromising custody.
#### FMM Architecture
Blade's FMM is a hybrid mechanism that has both on-chain and off-chain components. Unlike CPMMs whose pricing formulas only consider token ratios in pools, the FMM pricing function utilizes both token ratios and external real-time market prices from centralized and decentralized oracles. Blade's FMM performs pricing computations off-chain then verifies and validates them on-chain to prevent malicious quotes and determine if there have been any significant price changes between the time pricing data was pulled off-chain and applied to an on-chain swap. This design is highly efficient--keeping the hard work of solving formulas off-chain and verifying them on-chain avoids high gas costs while keeping the entire system trustless and transparent.
While the above describes how the FMM operates on the Polygon, Optimism, and Arbitrum versions of Blade, on **Ethereum** it performs the comparative price computations and validations off-chain against the on-chain data. This further reduced Blade's gas usage on Ethereum, resulting in even lower gas costs for both traders and LPsā*both relative to the previous iteration and other leading DEXs.*
#### No Impermanent Loss
There's a major misconception that impermanent loss (IL) is an unavoidable feature of DEX liquidity pools. The misconception came about because most DEXs utilize a CPMM. CPMMs *are* inherently prone to IL due to how they balance liquidity pool assets. Tokens on CPMM-based DEXs are priced by a constant function (x\*y=k) and IL is caused by arbitrageurs exploiting discrepancies between the prices set by the CPMM and external market prices. While arbitrage activity keeps CPMM prices in line with the rest of the market, the profit arbitrageurs extract is siphoned from LP holdings.
> š” Despite its name, *impermanent loss* is a real risk that can have lasting and detrimental effects on LP returns. LPs realize this loss if upon withdrawing their stake from the pool, the value of the assets they retrieve is lower (at current market prices) than if they had simply held them.
Impermanent loss can be avoided by using a more sophisticated market maker with better pricing information. Blade's FMM uses both the token ratios in pools and decentralized price oracles to balance assets, instead of a constant function. The price oracles make it so that when external market prices change, Blade's prices update without the need for arbitrage trades. **The absence of impermanent loss contributes to superior LP yields!**
Note: This doesn't mean that Blade LPs are always profitable; all yield-generating opportunities come with a degree of risk. Blade tracks the rebalancing portfolio you may have learned about in [Modern Portfolio Theory](https://en.wikipedia.org/wiki/Modern_portfolio_theory). This portfolio provides optimal risk-adjusted beta exposure while generating free alpha from volatility along the way. It's the approach that won a Nobel Prize in 1990.
import { Callout } from 'vocs/components'
## How LPs Earn from Arbitrage
Rather than from trading fees, Blade generates LP returns by pursuing a statistical arbitrage strategy similar to many traditional finance asset managers. However, it does so permissionlessly according to a formula that anyone can observe, predict, and verify for themselves. This ensures composability and enables non-custodial liquidity.
The specific strategy is a Daily Rebalancing Portfolio (DRP). This is a common strategy for commodities trading.
> **Example of how rebalancing works:** Imagine a $2,000 dual-asset portfolio with target allocations of 50% ETH and 50% USDC. On day one, ETH doubles in price, raising the ETH allocation in the portfolio from $1,000 to $2,000. The portfolio allocation is now 66% ETH ($2,000) and 33% USDC ($1,000) and must be rebalanced back to 50/50. This is accomplished by selling $500 worth of ETH for USDC, returning the portfolio to 50% ETH ($1,500) and 50% USDC ($1,500).
Daily rebalancing works whenever assets have high daily volatility and mean reversion relative to monthly/yearly volatility. This is because daily rebalancing has the effect of systematically buying low and selling high each day. It generates profits each day, which are the source of yield for Blade LPs. This is a well-researched phenomenon that earned Harry Markowitz the [Nobel Prize](https://www.nobelprize.org/prizes/economic-sciences/1990/press-release/?ref=docs.sushi.com) in Economics in 1990.
> **Example of how rebalancing profits:** Imagine the aforementioned 50/50 ETH-USDC portfolio. On day two, ETH drops to its original value of $1,000. The portfolio again must be rebalanced by selling $375 USDC for ETH, resulting in $1,125 in ETH and $1,125 USDC, totaling $2,250. This is a 1.125x return. If the same assets had simply been held for the two days, the return would only be 1x (no return).
š [**Spreadsheet**](https://docs.google.com/spreadsheets/d/1cZbJ18QvBuIcTofajTeAzVAdT5CmoUGzIN2nr12-8os/edit#gid=0) **showing how this works.**
š **Research on** [**Portfolio Rebalancing**](https://seekingalpha.com/article/4046116-investors-alpha-systematic-portfolio-rebalancing?ref=docs.sushi.com) **and** [**A Mathematical and Empirical Analysis of Rebalancing Alpha**](https://www.researchgate.net/publication/228179008_Optimal_Rebalancing_A_Scalable_Solution?ref=docs.sushi.com)
It turns out that blue-chip crypto assets, specifically ETH and WBTC, trade like commodities, just like gold and oil. This means a daily rebalancing statistical arbitrage strategy will work for them.
> **Evidence:** A Hurst Exponent test we ran (below) on the price movements of ETH from late 2015 through May 2023 shows that from mid-2018 onward ETH has typically been either memoryless or mean reverting, whereas prior to that it was noticeably momentum driven. This verifies that ETH prices seem to be more mean reverting as the asset has matured, making it a prime candidate for rebalancing. This is typically the case with blue-chip crypto assets, such as the Core Assets included in Clipper's Core pools.
In a memoryless price series, variance over 90-day windows should be 3x the variance at the 30-day window. A momentum price series will be above 3, and a mean-reverting series will be below 3.

This strategy is especially attractive because Blade rebalances without having to pay transaction costs that otherwise create "performance drag." Instead, Blade executes its trades with the noisy order flow from traders. Volume in Blade's pools turns over extremely fastāsometimes multiple times per week. This means that traders will quickly rebalance Blade's pools for it. In other words, traders pay the transaction costs instead of Blade, eliminating performance drag.
š **Research on** [**Rebalancing Portfolios With and Without Transaction Costs**](https://www.cs.cmu.edu/~avrim/Papers/portfolio.pdf?ref=docs.sushi.com)
#### The Diversified Portfolio Also Reduces Risk
A well-diversified, rebalancing portfolio has other benefits as well. Modern Portfolio Theory states that such a portfolio results in better long-term returns at a lower level of risk than investing solely in any one asset. Many financial advisors recommend a classic personal portfolio of [60% stocks and 40% bonds](https://www.nytimes.com/2015/04/12/business/mutfund/the-value-of-a-classic-in-a-turbocharged-world.html). Theoretically, this is an optimal way to gain exposure to an asset class. This long-term additional return further enhances Blade's yields.
š **Research on** [**Universal Portfolios**](https://isl.stanford.edu/~cover/papers/paper93.pdf?ref=docs.sushi.com)**, which increase long-term return while decreasing risk**
## Why Blade Has Better Trading Prices
**Because Blade generates more efficient returns for LPs, it can afford to offer better prices to traders.**
With \~$10M in liquidity (TVL), Blade has best priced trades up to $10k. As TVL grows, Blade will have best prices on larger trades--e.g., $50M TVL would correspond to best prices on trades up to $50k.
Below are the results of a sampling study against 0x API for a $10K USDC\<>ETH trade over several days in August 2023. [The results](https://docs.google.com/presentation/d/1QLYkVzOBrMvy8axKhID_ag0IVEaARIfN/edit#slide=id.p6) show Blade beat 0x 92.5% of the time on both legs of the trade and 99.6% of the time on at least one leg.
***Note:** Blade is "Clipper" in the chart below; Clipper was the initial name of Blade*

## Blade vs. CPMMs vs. HODLing
Blade's rebalancing strategy generally performs better than CPMMs (used by most DEXs) or HODLing, but it of course depends on market behavior.
#### Blade vs. The CPMM
Both Blade and the CPMM provide beta exposure (return attributed to overall market returns) to the assets in their respective pools. However, the similarities end there. Instead of rebalancing as conceived of in Modern Portfolio Theory, the CPMM trades according to its inherent x\*y = k function. While Blade provides alpha, the CPMM generates *negative* alpha, better known as impermanent loss. At best, if prices haven't moved by the end of the period the CPMM generates no loss. If prices have moved in either direction, there is substantial loss. The CPMM generates no profit from short-term volatility and loses money from long-term volatility. Meanwhile, yield comes not from the rebalancing process but rather from arbitrary fees charged to traders on top of trade prices.
In other words, impermanent loss is not an attribute of all DEXs, it is an attribute solely of CPMM-based AMMs. Conceptually, the CPMM "sells low and buys high" as prices change, which is the opposite of Blade's strategy (and common sense). The below figure shows how CPMMs only account for an asset's beginning and ending prices. In contrast, Blade's strategy accounts for price movements in the interim and profits from volatility.

As you can see, the attributes of the CPMM are not very favorable to LPs. Why then is it used by all first-generation DEXs? Because it is extremely simple to implement. It is also simple to calculate on-chain, which makes gas costs low. This tradeoff between gas and complexity is what Blade's FMM architecture overcomes.
š **See Appendix for math on the CPMM vs** Blade
#### Comparing Yields
Because the DeFi community is so used to CPMM DEXs, APY comparisons assume all pools are structured as CPMMs with trading fees and impermanent loss. Because Blade does not have explicit trading fees or impermanent loss, it's difficult to directly compare Blade's bottom-line LP figures with the top-line revenue numbers CPMM-based DEXs use. To ensure full transparency and keep LPs informed, Blade reports comparable metrics and historical earnings on Blade's data dashboard.
#### Blade vs. HODLing
Blade has an objectively better risk-return profile than HODLing and should outperform it in current market regimes. However, there are price series' that could result in better returns from HODLing. To provide concrete data, below are several months of Blade's performance vs. HODLing an equivalent initial portfolio.
| Month | Blade's Performance (bps) | HODL Performance (bps) |
| ---------- | ------------------------- | ---------------------- |
| April 2023 | +213 | +185 |
| May 2023 | -5 | -14 |
| June 2023 | +472 | +458 |
| July 2023 | -169 | -177 |
## FAQs
#### General
**Who is the team behind Blade?**
Blade was built by Shipyard Software, a leading design shop that develops custom-built DEXs, under Sushi Labs.
**Can I use a hardware wallet on Blade?**
Yes, any hardware wallet that is compatible with your crypto assets' token standards can be used with Blade.
#### Liquidity
**Who can be a Blade LP?**
The only requirement is that your wallet is not on the OFAC list.
**Is there a limit on how much liquidity I can deposit?**
No.
**Is there any lockup period for LP deposits?**
No.
**How does a token's current balance in a Core pool affect the value of a deposit?**
LPs will be granted a larger number of pool tokens (and therefore, a higher percentage of pool ownership) for depositing assets that are currently undersupplied in the pool.
By looking at the star rating next to each asset in Core pools, you can see how its supply in the pool will impact your deposit. (i.e., an asset with a 3-star rating is undersupplied, therefore a deposit of this asset may be more likely to increase in value. An asset with a 1-star or 0-star rating is oversupplied in the pool, therefore a deposit of this asset may be less likely to increase in value.)
**On the Blade data page, what is "Profit Yield"?**
This net trading gain figure is the sum of the positive difference between Blade input and output on swaps, according to on-chain price oracles. This figure is the best entirely on-chain auditable proxy for Blade LP's excess gains over and above the DRP benchmark. This is what the DAO takes its fees from.
**On the Blade data page, what is "Comparable APY"? How does it relate to impermanent loss?**
Top-line yield that includes the impermanent loss (IL) avoided by Blade's FMM design. These APYs are directly comparable with the APYs reported by most other DEXs like SushiSwap.
The annualized yields (APYs) shared by these DEXs are calculated from "fees" that include a great deal of IL. Blade's innovative FMM design not only allows LPs to avoid the impermanent loss that other DEXs face but also to calculate the counterfactual of the amount of IL that LPs *would have* suffered. We call that counterfactual amount "avoided IL".
Avoided IL is calculated by comparing Blade LPs' gain/loss on a crypto-basis (i.e., measured in crypto, not USD) to the crypto-basis loss of the CPMM mechanism used by SushiSwap, etc. This crypto-basis loss can be calculated from (and will change based on) the difference in dollar values of the assets at the start and end of a time period. Comparable APY is then calculated by taking **Blade**'s profit yield and adding it to the avoided IL.
We believe Comparable APY represents the best and most accurate expression of Blade's "yield" when LPs are considering which DEX to deposit into.
#### Transactions
**Should I be concerned about front running, MEV, or sandwich attacks when trading on Blade?**
These kinds of attacks can happen with decentralized exchanges that do not offer traders guaranteed rates in swaps. Bots watch pending transactions and can construct ways to give traders a worse rate, pocketing the surplus.
A unique aspect of Blade is that all signed quotes are firm, so you do not need to worry about bots stealing from your intended transactions.
**Why is my transaction pending for so long?**
The most likely explanation is that the gas price associated with your transaction was too low for miners to consider including it in a new block. Depending on your wallet, you may be able to cancel your pending transaction or re-submit it with a higher gas price. Etherscan maintains a [**detailed "Gas Tracker" page**](https://etherscan.io/gastracker) with frequently updated estimates of execution price and timeliness.
**Will my gas costs be refunded?**
As is typical for interactions on blockchains, any gas that was not consumed by a transaction on Blade will be refunded to its sender.
## Liquidity Pools
Blade's pools are multi-asset liquidity pools composed of Blade Core Assets (*usually ETH, WBTC, USDC, USDT, DAI, and the native token of the given chain*). These assets are commodities that comprise 70% of all trade volume in DeFi.
Unlike most DEX liquidity pools, Blade LPs earn yield on a *pro rata* portion of the entire pool, not just the asset(s) they deposit. Upon deposit, LPs receive LP tokens which represent their fractional ownership of the underlying pool. LP tokens have no value other than this representation.
There is one liquidity pool on each chain. The benefit of using one unified pool is to consolidate liquidity, rather than fragmenting it across multiple pools to achieve the same pairings. This increases capital efficiency, allowing for higher yields with lower fees.
import { Callout } from 'vocs/components'
## Depositing & Withdrawing
### Depositing
The only requirement for providing liquidity on Blade is that your wallet is not on the OFAC list. To deposit, simply connect your wallet and follow the on-screen prompts.
#### Blade LP Tokens
Upon deposit, you will receive LP tokens. These tokens represent your fractional ownership of the underlying pool and have **no value** other than this representation. Their purpose is to enable Blade to normalize each LP's deposits and withdrawal amounts by calculating their pool ownership value per token. Hold on to your LP tokens, **you will need them for withdrawal**.
The rewards you collect as an LP will be added to the overall value of your deposit and can be withdrawn at the same time as your principal.
### Withdrawing LP Deposits & Rewards
Blade is a non-custodial mechanism. Even if the Blade web page goes down, unlocking and burning LP tokens to withdraw assets are operations that are always available by directly interacting with the smart contracts on the blockchain.
To withdraw, you must redeem (burn) your LP tokens. You will have the option to withdraw either a single asset or a pro rata share of all tokens in the multi-asset pool.
If you choose the second option, the relative composition of tokens is determined by each asset's external market prices, which Blade uses to calculate the value per token for the pool. This is done by taking the value of the assets at those external market prices and dividing that value by the total number of tokens in the pool.
import Swagger from '../../components/swagger';
## Pricing API Documentation
### Overview
The Pricing API provides token prices across multiple chains.
The `sushi` package [also exposes](/sdk/price) wrapper functions for this API ā `getPrice` and `getPrices` ā under the `sushi/evm` export.
### Endpoints
* `GET /price/v1/{chainId}`: Returns a map of token address ā price (in USD) for the specified `chainId`.
* `GET /price/v1/{chainId}/{address}`: Returns a single token price (in USD) for `address` on the specified `chainId`.
### Example
```ts twoslash
// Fetch prices for many tokens (address ā number)
const chainId = 1
const PRICES_API_URL = new URL('https://api.sushi.com/price/v1/' + chainId)
console.log(PRICES_API_URL.toString())
const pricesRes = await fetch(PRICES_API_URL.toString())
const prices = await pricesRes.json() as Record
console.log(prices)
// Fetch price for a single token
const address = '0x6b3595068778dd592e39a122f4f5a5cf09c90fe2' // SUSHI on mainnet
const PRICE_API_URL = new URL(`https://api.sushi.com/price/v1/${chainId}/${address}`)
console.log(PRICE_API_URL.toString())
const priceRes = await fetch(PRICE_API_URL.toString())
const price = await priceRes.json() as number
console.log(price)
```
### Response
* Multiple prices (`/price/v1/{chainId}`): object mapping token address to numeric USD price.
* Single price (`/price/v1/{chainId}/{address}`): a single numeric USD price.
Examples:
```jsonc
// GET /price/v1/1
{
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": 2523.45,
"0x6b3595068778dd592e39a122f4f5a5cf09c90fe2": 1.12
}
// GET /price/v1/1/0x6b3595068778dd592e39a122f4f5a5cf09c90fe2
1.12
```
## Quote API Documentation
### Overview
The Quote API provides functionality to generate a quote.
The `sushi` package [also exposes](/sdk/quote) a wrapper function for this API called `getQuote`, available under the `sushi/evm` export.
### Example
```ts twoslash
import { type QuoteResponse } from 'sushi/evm'
const chainId = 1
const QUOTE_API_URL = new URL('https://api.sushi.com/quote/v7/' + chainId)
// TokenA & TokenB
const inputCurrency = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
const outputCurrency = '0x6B3595068778DD592e39A122f4f5a5cF09C90fE2'
// Amount
const amount = 1000000000000000
// Max Slippage
const maxSlippage = 0.005
const { searchParams } = QUOTE_API_URL
searchParams.set('tokenIn', inputCurrency)
searchParams.set('tokenOut', outputCurrency)
searchParams.set('amount', amount.toString())
searchParams.set('maxSlippage', maxSlippage.toString())
// Make call to API
console.log(QUOTE_API_URL.toString())
const res = await fetch(QUOTE_API_URL.toString())
const data = await res.json() as QuoteResponse
console.log(data)
```
## Swap API Documentation
### Overview
The Swap API provides functionality to generate swap call data necessary for executing a swap transaction.
The `sushi` package [also exposes](/sdk/swap) a wrapper function for this API called `getSwap`, available under the `sushi/evm` export.
### Example
```ts twoslash
import { createPublicClient, createWalletClient, http, type Hex } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { mainnet } from 'viem/chains'
import { type SwapResponse } from 'sushi/evm'
const publicClient = createPublicClient({
chain: mainnet,
transport: http(),
})
const chainId = 1
const SWAP_API_URL = new URL('https://api.sushi.com/swap/v7/' + chainId)
// TokenA & TokenB
const inputCurrency = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'
const outputCurrency = '0x6B3595068778DD592e39A122f4f5a5cF09C90fE2'
// Amount
const amount = 1000000000000000
// Max Slippage
const maxSlippage = 0.005
// Sender
const sender = '0x' // replace with your own address
// Api Key, get yours at https://sushi.com/portal
// const apiKey = "sushi_abcdefghijklmnopqr"
const { searchParams } = SWAP_API_URL
searchParams.set('tokenIn', inputCurrency)
searchParams.set('tokenOut', outputCurrency)
searchParams.set('amount', amount.toString())
searchParams.set('maxSlippage', maxSlippage.toString())
searchParams.set('sender', sender)
// searchParams.set('apiKey', apiKey)
// Make call to API
console.log(SWAP_API_URL.toString())
const res = await fetch(SWAP_API_URL.toString())
const data = await res.json() as SwapResponse
console.log(data)
// If the swap status is 'Success'
if (data.status === 'Success') {
const { tx } = data
// Simulate a call to the blockchain for the swap
const callResult = await publicClient.call({
account: tx.from,
data: tx.data,
to: tx.to,
value: tx.value,
})
// Returns the simulated amount out
console.log('Output: ', callResult)
// Send a transaction
const PRIVATE_KEY = process.env.PRIVATE_KEY as Hex
const walletClient = createWalletClient({
chain: mainnet,
transport: http(),
})
const hash = await walletClient.sendTransaction({
account: privateKeyToAccount(PRIVATE_KEY),
data: tx.data,
to: tx.to,
value: tx.value,
})
console.log('Tx: ', hash)
}
```
### Response
The endpoint returns a `SwapResponse`, which includes the route status and, on success, the prepared transaction to execute the swap.
* Status: one of `Success`, `Partial`, or `NoWay`.
* Tokens: array of involved tokens with `address`, `decimals`, `symbol`, and `name`.
* Token indexes: `tokenFrom` and `tokenTo` are indexes into `tokens` and are also expanded to the full token objects in the response.
* Pricing: `swapPrice` (price tokenIn ā tokenOut) and `priceImpact` (as a fraction, e.g. `0.005` for 0.5%).
* Amounts: `amountIn` and `assumedAmountOut` as stringified integers in token base units.
* Transaction: `tx` with `from`, `to`, `gasPrice` (number), `data` (hex), and `value` (stringified integer, may be omitted or "0" for ERC-20 ā ERC-20). When `simulate=true` is passed, `tx.gas` is also included as a string.
Example (Success):
```json
{
"status": "Success",
"tokens": [
{
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"decimals": 18,
"symbol": "ETH",
"name": "Ether"
},
{
"address": "0x6b3595068778dd592e39a122f4f5a5cf09c90fe2",
"decimals": 18,
"symbol": "SUSHI",
"name": "SushiToken"
}
],
"tokenFrom": 0,
"tokenTo": 1,
"swapPrice": 2300.12,
"priceImpact": 0.0012,
"amountIn": "1000000000000000",
"assumedAmountOut": "1234567890000000000",
"tx": {
"from": "0x0000000000000000000000000000000000000000",
"to": "0x0000000000000000000000000000000000000000",
"gasPrice": 1000000000,
"data": "0xā¦",
"value": "1000000000000000"
// when simulate=true, a string field "gas" is also included
}
}
```
If `status` is `NoWay`, only the `status` field is returned, indicating that no route satisfying the constraints was found. `Partial` indicates a route is available but cannot fully satisfy the requested amount under the given constraints.
Errors are returned with RFC 7807 problem details; see API error references under [Errors](/api/errors).
## Estimate Gas
This problem occurs when the gas estimation fails.
Your client application did everything correctly. Unfortunately our API encountered a condition that resulted in this problem.
| **Type URI** | **Title** | **Status** |
| ------------------------------------------------------------------------------------------------ | ------------------ | ---------- |
| [https://docs.sushi.com/api/errors/estimate-gas](https://docs.sushi.com/api/errors/estimate-gas) | Estimate Gas Error | 422 |
**Example of an estimate-gas problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/estimate-gas",
"title": "Estimate Gas Error",
"details": "string",
"status": 422,
"code": "422-02"
}
```
## API Errors
Below is a list of all API error types with their type URI, title, and HTTP status.
| **Type URI** | **Title** | **Status** |
| -------------------------------------------------------------------------------------------------------------------- | ---------------------- | ---------- |
| [https://docs.sushi.com/api/errors/estimate-gas](https://docs.sushi.com/api/errors/estimate-gas) | Estimate Gas Error | 422 |
| [https://docs.sushi.com/api/errors/insufficient-allowance](https://docs.sushi.com/api/errors/insufficient-allowance) | Insufficient Allowance | 422 |
| [https://docs.sushi.com/api/errors/insufficient-balance](https://docs.sushi.com/api/errors/insufficient-balance) | Insufficient Bllowance | 422 |
| [https://docs.sushi.com/api/errors/invalid-api-key](https://docs.sushi.com/api/errors/invalid-api-key) | Invalid Api Key | 401 |
| [https://docs.sushi.com/api/errors/no-fresh-data](https://docs.sushi.com/api/errors/no-fresh-data) | No Fresh Data | 500 |
| [https://docs.sushi.com/api/errors/not-found](https://docs.sushi.com/api/errors/not-found) | Not Found | 404 |
| [https://docs.sushi.com/api/errors/ratelimit-exceeded](https://docs.sushi.com/api/errors/ratelimit-exceeded) | Ratelimit Exceeded | 429 |
| [https://docs.sushi.com/api/errors/server](https://docs.sushi.com/api/errors/server) | Server | 500 |
| [https://docs.sushi.com/api/errors/service-unavailable](https://docs.sushi.com/api/errors/service-unavailable) | Service Unavailable | 503 |
| [https://docs.sushi.com/api/errors/unauthorized](https://docs.sushi.com/api/errors/unauthorized) | Unauthorized | 403 |
| [https://docs.sushi.com/api/errors/validation](https://docs.sushi.com/api/errors/validation) | Validation | 422 |
## Insufficient Allowance
This problem occurs when the spender doesn't have sufficient allowance.
Your client asked for an estimation of a swap in which the spender doesn't have sufficient allowance. This prevents the estimation from completing successfully.
| **Type URI** | **Title** | **Status** |
| -------------------------------------------------------------------------------------------------------------------- | ---------------------- | ---------- |
| [https://docs.sushi.com/api/errors/insufficient-allowance](https://docs.sushi.com/api/errors/insufficient-allowance) | Insufficient Allowance | 422 |
**Example of an insufficient-allowance problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/insufficient-allowance",
"title": "Insufficient Allowance Error",
"details": "Spender has insufficent allowance",
"status": 422,
"code": "422-04",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"spender": "0x85cd07ea01423b1e937929b44e4ad8c40bbb5e71",
"sender": "0x19b3eb3af5d93b77a5619b047de0eed7115a19e7",
"allowance": "1000000",
"amount": "5000000"
}
```
## Insufficient Balance
This problem occurs when the spender doesn't have sufficient balance.
Your client asked for an estimation of a swap in which the spender doesn't have sufficient balance. This prevents the estimation from completing successfully.
| **Type URI** | **Title** | **Status** |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------- | ---------- |
| [https://docs.sushi.com/api/errors/insufficient-balance](https://docs.sushi.com/api/errors/insufficient-balance) | Insufficient Bllowance | 422 |
**Example of an insufficient-balance problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/insufficient-balance",
"title": "Insufficient Balance Error",
"details": "Spender has insufficent balance",
"status": 422,
"code": "422-03",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"sender": "0x19b3eb3af5d93b77a5619b047de0eed7115a19e7",
"balance": "1000000",
"amount": "5000000"
}
```
## Invalid Api Key
This problem occurs when the provided API key is invalid or missing.
Your client application tried to access a resource that requires an API key, but the key was either invalid or not provided. Please check your API key and try again. It can be provided as a query parameter or in the authorization header.
| **Type URI** | **Title** | **Status** |
| ------------------------------------------------------------------------------------------------------ | --------------- | ---------- |
| [https://docs.sushi.com/api/errors/invalid-api-key](https://docs.sushi.com/api/errors/invalid-api-key) | Invalid Api Key | 401 |
**Example of an invalid-api-key problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/invalid-api-key",
"title": "Invalid or Missing API Key",
"details": "Invalid API key",
"status": 401,
"code": "401-01",
}
```
## No Fresh Data
This problem occurs when the API does not have fresh data available.
Your client application did everything correctly. Unfortunately our API encountered a condition that resulted in this problem.
| **Type URI** | **Title** | **Status** |
| -------------------------------------------------------------------------------------------------- | ------------- | ---------- |
| [https://docs.sushi.com/api/errors/no-fresh-data](https://docs.sushi.com/api/errors/no-fresh-data) | No Fresh Data | 500 |
**Example of an no-fresh-data problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/no-fresh-data",
"title": "No Fresh Data Error",
"details": "Network 1 data timeout",
"status": 500,
"code": "500-02",
}
```
## Not Found
This problem occurs when the requested resource could not be found.
Your client application tried to access a resource that does not exist (or could not be found). Please review how your users initiated such a request.
| **Type URI** | **Title** | **Status** |
| ------------------------------------------------------------------------------------------ | --------- | ---------- |
| [https://docs.sushi.com/api/errors/not-found](https://docs.sushi.com/api/errors/not-found) | Not Found | 404 |
**Example of an not-found problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/not-found",
"title": "Not Found",
"detail": "The requested resource was not found",
"status": 404,
"code": "404-01"
}
```
## Ratelimit Exceeded
This problem occurs when the provided API key has exceeded its rate limit.
Your client application tried to access a resource that requires an API key, but the key has exceeded its rate limit. Please try again later.
| **Type URI** | **Title** | **Status** |
| ------------------------------------------------------------------------------------------------------------ | ------------------ | ---------- |
| [https://docs.sushi.com/api/errors/ratelimit-exceeded](https://docs.sushi.com/api/errors/ratelimit-exceeded) | Ratelimit Exceeded | 429 |
**Example of an ratelimit-exceeded problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/ratelimit-exceeded",
"title": "Rate Limit Exceeded",
"details": "API key rate limit exceeded",
"status": 429,
"code": "429-01",
}
```
## Server
This problem occurs when the server encounters an unexpected condition that prevents it from fulfilling the request.
Your client application did everything correct. Unfortunately our API encountered a condition that resulted in this problem.
| **Type URI** | **Title** | **Status** |
| ------------------------------------------------------------------------------------ | --------- | ---------- |
| [https://docs.sushi.com/api/errors/server](https://docs.sushi.com/api/errors/server) | Server | 500 |
**Example of an server problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/server",
"title": "Server",
"detail": "The server encountered an unexpected error",
"status": 500,
"code": "500-01"
}
```
## Service Unavailable
This problem occurs when the service requested is currently unavailable and the server is not ready to handle the request
Your client application did everything correct. Unfortunately our API is currently unavailable.
| **Type URI** | **Title** | **Status** |
| -------------------------------------------------------------------------------------------------------------- | ------------------- | ---------- |
| [https://docs.sushi.com/api/errors/service-unavailable](https://docs.sushi.com/api/errors/service-unavailable) | Service Unavailable | 503 |
**Example of an service-unavailable problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/service-unavailable",
"title": "Service Unavailable",
"detail": "The service is currently unavailable",
"status": 503,
"code": "503-01"
}
```
## Unauthorized
This problem occurs when the provided API key has blacklisted / not-whitelisted your IP address or origin.
Your client application tried to access a resource that requires an API key, but the key has either blacklisted or not whitelisted your IP address or origin. Please check your API key and try again. It can be provided as a query parameter or in the authorization header.
| **Type URI** | **Title** | **Status** |
| ------------------------------------------------------------------------------------------------ | ------------ | ---------- |
| [https://docs.sushi.com/api/errors/unauthorized](https://docs.sushi.com/api/errors/unauthorized) | Unauthorized | 403 |
**Example of an unauthorized problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/unauthorized",
"title": "Unauthorized",
"details": "IP not whitelisted",
"status": 403,
"code": "403-01",
}
```
## Validation
This problem occurs when the request is deemed unprocessable.
Your client issued a request that failed validation. Certain validation libraries return multi-errors and cannot be easily parsed into discreet types. This problem type, afforded the provider with the ability to surface all validation errors and negate the need for a trial and error workflow on your side.
Please review your request to determine if you can remain within appropriate business rules. Consider validating your request against available metadata (e.g. schemas) prior to sending to the server.
| **Type URI** | **Title** | **Status** |
| -------------------------------------------------------------------------------------------- | ---------- | ---------- |
| [https://docs.sushi.com/api/errors/validation](https://docs.sushi.com/api/errors/validation) | Validation | 422 |
**Example of an validation problem details:**
```json
{
"type": "https://docs.sushi.com/api/errors/validation",
"title": "Validation Error",
"detail": "The request is invalid.",
"status": 422,
"code": "422-01",
"errors": [
{ "detail": "Required", "parameter": "tokenIn" },
{ "detail": "Required", "parameter": "tokenOut" },
{ "detail": "Required", "parameter": "sender" },
{ "detail": "Required", "parameter": "amount" }
]
}
```
import Swagger from "../../../components/swagger";
import spec from "../../../public/blade-v2-openapi.json";
## clAMM
The **Concentrated Liquidity Automated Market Maker (clAMM)** allows liquidity providers to focus their capital within specific price ranges rather than across the entire price curve. This enables more efficient use of liquidity, reducing slippage for trades within those ranges, and increasing the potential fee earnings for liquidity providers. Uniswap V3 introduced this model, allowing liquidity providers to have better control over their positions.
## cpAMM
The **Constant Product Automated Market Maker (cpAMM)** uses a simple formula: x \* y = k, where x and y represent the reserves of two assets, and k is a constant. This ensures that the product of the two asset reserves always remains the same. Itās the most widely used AMM model, popularized by Uniswap V2. The cpAMM provides liquidity for any price point, though with higher slippage for large trades, particularly for volatile or low-liquidity pairs.
## AMM
SushiSwap is a decentralized exchange protocol originally forked from Uniswap, sharing its core Automated Market Maker (AMM) design.
### V2: Decentralized Liquidity Pools
V2 is a decentralized exchange protocol that enables token swaps using automated liquidity pools.
#### Key Features:
* **Automated Market Maker (AMM):** Trades occur through smart contracts, with users providing liquidity by depositing token pairs.
* **Constant Product Formula:** Maintains pool balance using the formula `x * y = k`.
* **Fee Structure:** A 0.30% trading fee is distributed to liquidity providers (LPs).
* **Token Pair Swaps:** Facilitates ERC-20 to ERC-20 token swaps seamlessly.
V2 introduced a simple, reliable way to trade tokens in a decentralized manner.
***
### V3: Concentrated Liquidity & Customization
V3 enhances the decentralized exchange experience by introducing more flexibility and efficiency for liquidity providers and traders.
#### Key Features:
* **Concentrated Liquidity:** Allows LPs to allocate capital to specific price ranges for improved efficiency.
* **Custom Fee Tiers:** Offers different fee levels (e.g., 0.01%, 0.05%, 0.30%, 1.00%) tailored to market conditions.
* **Active Position Management:** LPs can dynamically manage their positions for optimized returns.
* **NFT-Based Positions:** Each liquidity position is represented as a non-fungible token (NFT), this makes every position unique and transferable.
V3 is designed to offer advanced tools for more precise and efficient liquidity management.
## cpAMM
The **Liquidity Book Automated Market Maker (lbAMM)** is a more advanced AMM model that divides liquidity into "bins," each corresponding to a specific price range. This allows for more granular liquidity management, ensuring minimal slippage as trades happen within each price bin. Liquidity providers can select specific price bins, offering more control over liquidity placement. This structure helps reduce impermanent loss and increases capital efficiency, making it ideal for volatile or unevenly distributed assets. This approach was introduced by Trader Joe on the Avalanche network.
## Introduction
The Sushi Aggregator is a robust DeFi tool designed to optimize trade execution across multiple decentralized exchanges (DEXs). It enables users to achieve the best possible rates by aggregating liquidity from various sources, thereby minimizing slippage and maximizing returns.
At its core, the Sushi Aggregator relies on three key components:
**1. Extractor:** Extractor continuously gathers real-time liquidity source state from the blockchaināsuch as token reserves, swap fees, and pool balancesāfrom various DEXs. This data is then fed into Tines, ensuring accurate calculations for route optimization and enabling quick adaptation to changing market conditions.
**2. Tines Pathfinding Algorithm:** Tines, the off-chain routing engine, uses the Dijkstra shortest path algorithm to calculate the most efficient trading routes. It considers multiple factors, such as liquidity, fees, gas cost, and price impact, to create an optimal path for executing trades.
**2. RouteProcessor Contract:** Once Tines determines the best route, the RouteProcessor smart contract comes into play. This on-chain contract is responsible for executing the multi-hop or multi-platform trades precisely as calculated by Tines. It handles all token swaps and ensures smooth and secure execution of the proposed route without requiring users to interact with multiple DEXs.
By combining the computational efficiency of off-chain optimization with the reliability of on-chain execution, the Sushi Aggregator provides a seamless and efficient trading experience, catering to both casual users and sophisticated traders.