This is a documentation for the market makers to create an API that can be easily integrated with Paraswap.
/prices
every RefreshInterval
seconds to fetch all the order book like prices/quote
s to get the 0x v4 order. This is then encoded and sent to the user.A market maker should implement 2 endpoints to start market making at ParaSwap.
This endpoint is used to get indicative prices for all the token pairs
Request URL: GET <RequestURL>/prices
Header:
API-KEY: APIKey
Sample Return Payload:
{
"success": true,
"price_list":[
{
"from":{
"address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"decimals":18
},
"to":{
"address":"0x6b175474e89094c44da98b954eedeac495271d0f",
"decimals":18
},
"side":"SELL",
"rates":[
[
"3000000000000000000",
"1823130000000000000000"
],
[
"6200000000000000000",
"1823090000000000000000"
],
[
"1030000000000000000",
"1823000000000000000000"
]
]
},
{
"from":{
"address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"decimals":18
},
"to":{
"address":"0x6b175474e89094c44da98b954eedeac495271d0f",
"decimals":18
},
"side":"BUY",
"rates":[
[
"182000000000000000000",
"561668041999848"
],
[
"6823090000000000000000",
"581668041999848"
],
[
"10823090000000000000000",
"591668041999848"
]
]
}
]
}
<aside> 💡 The rates in the above payload are basically a list of pairs of (volume, unitPrice) like an order book. Hence for a pair (v, p) the market maker should be able to fill any order below v at rate of p. Also v is in decimal representation of v and p should always have have 18 decimal representation.
</aside>
This endpoint is used to get a signed 0x v4 order such that paraswap can use it to build a transaction