The following changes must be made when migrating from v6.0 to v6.1.
Changes in /swap and /quote responses
Structural updates
- The
protocols[][][]structure remains, but the format of protocol data has changed. fromTokenAddressandtoTokenAddresshave been removed. Instead, a singletokenfield is used at a higher level.
Changed and renamed parameters
fromTokenAddress→ Removed (source token is now referenced at the top level).toTokenAddress→ Removed (destination is now handled viadst).name→ Moved inside protocols array withinswaps.part→ Now nested insideswapsandprotocols.
Compare the old version of that part of response with a new one below.
Old response example
JSON
12345678910111213141516171819202122232425262728293031323334353637
"protocols": [
[
[
{
"name": "UNISWAP_V2",
"part": 2,
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
},
{
"name": "UNISWAP_V4",
"part": 2,
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
},
{
"name": "SUSHI",
"part": 4,
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
},
{
"name": "UNISWAP_V3",
"part": 6,
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
},
{
"name": "UNISWAP_V3",
"part": 86,
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
}
],
//...
]
]
New response example
JSON
1234567891011121314151617181920212223242526272829303132333435363738394041424344
"protocols": [
{
"token": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"hops": [
{
"part": 62.5,
"dst": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"fromTokenId": 0,
"toTokenId": 1,
"protocols": [
{
"name": "UNISWAP_V4",
"part": 1
},
{
"name": "CURVE_V2_TRICRYPTO_NG",
"part": 1
},
{
"name": "UNISWAP_V3",
"part": 1
},
{
"name": "UNISWAP_V2",
"part": 3
},
{
"name": "UNISWAP_V3",
"part": 5
},
{
"name": "UNISWAP_V3",
"part": 20
},
{
"name": "FLUID_DEX_T1",
"part": 69
}
]
}
//...
]
}
]
For full schemas, see Swagger documentation for the /swap and /quote endpoints.
If you disabled includeProtocols, change the version to a newer one. No additional actions are required.