Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.li.fi/llms.txt

Use this file to discover all available pages before exploring further.

The order server caches quotes from its solver network. Call POST /quote/request to get pricing for an intent before constructing an order. Using the order server for quotes is optional but recommended. It matches intents against solver standing quotes and gives stronger execution guarantees.
For simpler integrator parameter handling, a V1 quote endpoint is also available at GET /api/v1/integrator/quote/request.

Request Format

curl -X POST 'https://order.li.fi/quote/request' \
  -H 'Content-Type: application/json' \
  -d '{
    "user": "0x0001000002210514d8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "intent": {
      "intentType": "oif-swap",
      "inputs": [{
        "user": "0x0001000002210514d8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        "asset": "0x0001000002210514833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "amount": "10000000"
      }],
      "outputs": [{
        "receiver": "0x0001000002A4B114d8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        "asset": "0x0001000002A4B114af88d065e77c8cC2239327C5EDb3A432268e5831",
        "amount": null
      }],
      "swapType": "exact-input"
    },
    "supportedTypes": ["oif-escrow-v0"]
  }'

Request Fields

FieldTypeDescription
userstringInteroperable address of the user (refund recipient on failure)
intent.intentTypestringAlways "oif-swap"
intent.inputs[]arrayInput assets with user, asset (interoperable address), and amount
intent.outputs[]arrayDesired outputs with receiver, asset, and amount (null for exact-input)
intent.swapTypestring"exact-input" fixes the input amount and lets the solver determine the output (set outputs[].amount to null). This is the most common mode. "exact-output" fixes the output amount and lets the solver determine the required input (set inputs[].amount to null). Use this when the destination amount matters, for example to repay a loan or meet a contract requirement.
supportedTypesarrayResource lock types the user supports. Use "oif-escrow-v0" for standard escrow integrations; include "oif-resource-lock-v0" only if your flow supports Compact/resource-lock claims
intent.metadata.exclusiveForarrayOptional. Restrict quotes to specific solver addresses. Useful for compliance or partnerships, but over-restriction can reduce fill reliability.

Response Format

interface QuoteResponse {
  quotes: {
    order: null;
    validUntil: number;
    quoteId: string;         // e.g. "quote_yCyE5aWW4NILo2UdM-8ETpia05TCLv"
    preview: {
      inputs: { user: string; asset: string; amount: string }[];
      outputs: { receiver: string; asset: string; amount: string }[];
    };
    metadata: {
      exclusiveFor: string | null;
    };
    partialFill: boolean;
    failureHandling: string; // e.g. "refund-automatic"
  }[];
}
The best quote is always at index 0. Save the quoteId for use when submitting the order.

Response Fields

FieldDescription
validUntilUnix timestamp after which the quote expires. Re-fetch if stale.
quoteIdReference ID to include when submitting an order for preferential solver matching.
preview.inputs / preview.outputsThe expected input and output amounts for this quote.
metadata.exclusiveForThe solver address selected for this quote, or null.
partialFillWhether the solver supports partial fills for this quote.
failureHandlingHow failures are handled (e.g. "refund-automatic").

Exclusive Solver Matching

The metadata.exclusiveFor field in the response identifies the solver selected for this quote. If you want to enforce exclusivity when constructing the order, encode the solver address and an expiry into the output’s context field:
const exclusiveFor = bestQuote.metadata.exclusiveFor;
if (exclusiveFor) {
  const currentTime = Math.floor(Date.now() / 1000);
  const exclusiveExpiry = (currentTime + 60).toString(16);
  const paddedExclusiveFor = exclusiveFor.replace('0x', '').padStart(64, '0');
  mandateOutput.context = `0xe0${paddedExclusiveFor}${exclusiveExpiry}`;
}
Apply exclusivity only if you fully control solver policy and fallback behavior.

Next Steps

Create and Submit Orders

Construct a StandardOrder and submit it to the solver network

Track Order Status

Monitor order progress via the API or on-chain events