REST API

Page explains how to use Liquorice RFQ REST API

1. Authentication

Provide the following headers in each request

  • solver - name of the Solver

  • authorization - authorization token

2. RFQ

Whenever the solver needs a quote from Liquorice, it sends an RFQ to the system.

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

Method: POST

Body:

{
    /// Chain ID, e.g for ArbitrumOne chainId = 42161
    chainId: number;
    /// UUID of the RFQ (Must be generated by caller)
    rfqId: string;
    /// RFQ expiry UNIX timestamp (seconds)
    expiry: number,
    /// 0x-prefixed base token address
    baseToken: string;
    /// 0x-prefixed quote token address
    quoteToken: string;
    /// 0x-prefixed address of the account receiving quoteToken   
    trader: string;
    /// 0x-prefixed address of the account performing trade
    effectiveTrader: string;
    // (Exactly one of the following two fields will be present.)
    /// Number with up to 18 decimal places, e.g. 100000000 (1 WBTC)
    baseTokenAmount?: string;
    /// Number with up to 18 decimal places
    quoteTokenAmount?: string;
}

Exactly one of the baseTokenAmount or quoteTokenAmount fields must be present. Having baseTokenAmount present equals to asking "How much ETH would I get if I pay 1000 USDC?" and having quoteTokenAmount equals to asking "How much USDC do I need to pay to get 1 ETH?"

Response

{
    /// UUID of the RFQ
    rfqId: string;
    /// Quote expiry UNIX timestamp (seconds)
    quoteExpiry: number;
    /// 0x-prefixed address of the Liquorice market 
    market: string,
    /// Array of 0x-prefixed calldata strings 
    /// for the functions within Liquorice `market` contract
    interactions: string[];
    /// 0x-prefixed base token address
    baseToken: string;
    /// 0x-prefixed quote token address
    quoteToken: string;
    /// Number with up to 18 decimal places, e.g. 100000000 (1 WBTC)
    baseTokenAmount: string;
    /// Number with up to 18 decimal places
    quoteTokenAmount: string;
}

Last updated