REST API

This page explains how solvers can interact with the Liquorice RFQ REST API.

1. Authentication

Include the following headers with each request:

  • solver - name of the Solver

  • authorization - authorization token

2. Connected makers

Use the following endpoint to retrieve a list of currently connected makers:

URL: https://api.liquorice.tech/v1/solver/connected-makers

Method: GET

Response:

[
    "maker-a", 
    "maker-b"
]

3. RFQ

To obtain a quote from Liquorice, send an RFQ to the following endpoint:

URL: https://api.liquorice.tech/v1/solver/rfq

Method: POST

Body:

  • The RFQ must include either baseTokenAmount or quoteTokenAmount, but not both. When baseTokenAmount is specified, the trader (order initiator) is requesting the amount of quoteToken they would receive in exchange for a specific amount of baseToken. When quoteTokenAmount is specified, the trader (order initiator) is requesting the amount of baseToken they need to provide to receive a specific amount of quoteToken.

  • excludedMakers- to exclude specific makers from RFQ processing, obtain the complete maker list from the relevant API endpoint

  • intentMetadata - For the moment, only CoW Protocol is supported. Omit this setting when requesting quotes for other intent origins.

Response

Market makers can provide multiple quote levels with different amounts, but the quoted amounts will not exceed those specified in the RFQ.

Example For an RFQ where:

  • baseToken = ETH

  • quoteToken = USDT

  • baseTokenAmount = 1 ETH

The resulting quote may contain these levels:

Level 0: Exchange 1 ETH for 3,000 USDT

Level 1: Exchange 0.5 ETH for 1,502 USDT

Level 2: Exchange 0.1 ETH for 310 USDT

IMPORTANT NOTE: While solvers typically execute a single quote level, it is technically possible to execute multiple quote levels if they come from different market makers. When using multiple quote levels, ensure that they come from different makers, as quotes from the same maker will result in only one successful execution.

3.1. Partial fills

The quote level's partialFill.offset field specifies the byte offset of filledTakerAmount parameter within tx.data.

The partial fill amount must be greater than or equal to partialFill.minBaseTokenAmount.

If the partialFill field is not present, the quote level must be filled completely.

Last updated