Quoting Orders
The order server will deliver quotes to intent issuers. These are based on the available inventory provided by solvers. To avoid the need for solvers to respond to every individual quote request, the order server allows solvers to regularly push their inventory to the order server in the format of quote chunks
.
This approach significantly reduces the overhead for solvers and improves the efficiency of the quoting process.
The following code chunk provides an example implementation of quoting between USDC and USDC between Ethereum and Base.
{ "chainId": 1, // Ethereum "asset": "0xA0b86991c...", // USDC on Ethereum, address(0) for native tokens "fromPrice": "1000000000000000000", // price of token in USDC when sold to the solver "toPrice": "1100000000000000000", // price of token in USDC when bought from the solver "fromCost": "1000", // cost of token in token when sold to the solver "toCost": "1000", // cost of token in token when bought from the solver "maxAmount": 1000000000, // max the solver will handle "minAmount": 1000000, // minimum amount the solver will process "expiry": 1713296400 // quote expires at this timestamp}, { "chainId": 8453, // Base "asset": "0x833589fCD...", // USDC on Base, address(0) for native tokens "fromPrice": "1000000000000000000", // price of token in USDC when sold to the solver "toPrice": "1100000000000000000", // price of token in USDC when bought from the solver "fromCost": "1000", // cost of token in token when sold to the solver "toCost": "1000", // cost of token in token when bought from the solver "maxAmount": 1000000000, // max the solver will handle "minAmount": 1000000, // minimum amount the solver will process "expiry": 1713296400 // quote expires at this timestamp}
Prices are specified in an abstract intermediary that has to be consistent between your quotes. We recommended using USDC with 18 decimals. Everything is integer priced. Make sure that your decimals are correct. The final quote will be derived as:
It is important that solvers update their quotes periodically as market conditions change, with correct expiry dates. If your quotes expire, the order server will stop using them to match user requests.
By broadcasting quotes in this manner, solvers can:
- Efficiently communicate their available liquidity across multiple chain and token pairs.
- Set their own pricing and fee structure.
- Define limits on transaction sizes they’re willing to process.
- Update their quotes as market conditions change.
- The order server then uses these broadcast quotes to match incoming user requests without needing to query solvers in real-time for every request, resulting in faster quote responses for users and reduced operational overhead for solvers.
Submit quotes to /quotes/submit
.
Chain & Asset Support
Section titled “Chain & Asset Support”The order server uses quotes to determine supported chains and assets. This allows solvers to add support for new chains and assets simply by producing quotes for them.
Authentication (WIP)
Section titled “Authentication (WIP)”While authentication is not necessary to subscribe to the order server’s WebSocket events, it is required to use some of the order server’s API services. All solvers must be authenticated with the order server to be able to push their inventory. Without authentication, the order server won’t be able to offer your quotes to users. Authentication is handled via API tokens that provide secure access to the order server’s protected API services.
Obtaining API Access
Section titled “Obtaining API Access”To get your API token, please reach out to the order server team.
Using Your API Token
Section titled “Using Your API Token”If you have an API token, it must be included in all requests to the order server for reputation purposes:
- For HTTP requests: Include the token in the request headers as
x-api-key: YOUR_API_TOKEN