> ## Documentation Index
> Fetch the complete documentation index at: https://docs.multiliquid.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Quotes and builds

> Every field of a swap quote, a swap build, and a decoded transaction.

A quote prices a swap from chain state, and a build turns the same swap into the unsigned transactions the user's wallet signs. Both have one shape on every network; an object whose form depends on the network carries `runtime`, `evm` or `svm`.

## Quote

`GET /v1/swap/quote`

| Parameter | Required | Description |
| - | - | - |
| `network` | Yes | A canonical [network key](https://docs.multiliquid.xyz/api-reference/guides/network-keys.md) |
| `inputToken` | Yes | Address of the token the user pays: a `0x` address on EVM, a base58 mint on Solana |
| `outputToken` | Yes | Address of the token the user receives |
| `amountIn` | One of the two | Exact input amount, in whole input tokens: a nonzero decimal string with at most 6 decimal places and no more than the token's decimals, such as `1.5` |
| `amountOut` | One of the two | Exact output amount, in whole output tokens, in the same form |
| `capitalProvider` | No | One capital provider's ID, from [discovery](https://docs.multiliquid.xyz/api-reference/swap/discovery.md#pairs): the stablecoin delegate ID on EVM, the capital provider's wallet on Solana. It must be one the pair lists: an ID the network does not list answers `UNKNOWN_CAPITAL_PROVIDER`, and a listed capital provider that the pair does not list answers `UNSUPPORTED_PAIR`. Without it, every capital provider that discovery lists for the pair is quoted, in the same order, and the best is returned. |
| `user` | No | The wallet the quote prices for. On EVM, a quote that pays a stablecoin, \$TSY included, can depend on the user's yield state; without `user` it is `indicative`, priced as a wallet with no accrued yield would be, so quote with `user` for the wallet's own price. \$TSY in through the Treasury capital provider is also limited by the wallet's Treasury credits: with `user`, \$TSY above them is rejected with `InsufficientCredits`. Solana quotes do not depend on the user. |

On Solana, an amount can be at most 2<sup>64</sup> − 1 of the token's base units, such as `18446744073709.551615` for a 6-decimal token; a larger one is rejected with `details.field` naming it. [Conventions](https://docs.multiliquid.xyz/api-reference/guides/conventions.md#amounts) gives the rules for every amount.

The best quote has the most output for an exact-input swap and the least input for an exact-output swap; a tie keeps the listing order.

> [!NOTE]
>
> A quote is a price read from chain state, not a reservation. Nothing is held for the user, and the price can change before a swap lands. A build quotes again at its own block or slot, and the bound the user signs makes the swap revert rather than fill at a worse price. Quote and build responses carry `Cache-Control: no-store`, so don't cache them.

### Quote response

| Field | Description |
| - | - |
| `network` | The network key |
| `swapType` | `exactIn` or `exactOut` |
| `inputToken`, `outputToken` | Token objects with `address`, `symbol`, `name`, `decimals`, `kind`, and `issuer`, which is `null` where Multiliquid records none |
| `amountIn`, `amountOut` | The quoted amounts, exact, in whole tokens |
| `price` | The output per input in whole tokens, `amountOut / amountIn` in display units, as a decimal string rounded down to 18 decimal places |
| `nav` | The net asset value of each RWA the swap pays or receives, as the quote priced it; see [Price and NAV](#price-and-nav) |
| `fees` | Every fee the quote reports; see [Fees](#fees) |
| `capitalProvider` | The selected capital provider: `id`, `name` (`null` when it has none), and `address`, the EVM stablecoin delegate contract or the Solana wallet that owns the pair |
| `indicative` | `true` when the quote depends on a `user` it was not given, so the user's own price can differ |
| `alternatives` | Every other capital provider considered, each with its `capitalProvider` and either its `amountIn` and `amountOut` or the decoded `error` (`name` and `message`) it cannot fill the swap with |

### Fees

`fees` lists each fee as `{type, amount, token, paidBy}`, with `amount` in whole tokens of `token`, a full token object. `paidBy` names whose amounts a fee reduces, not the account a transfer debits:

* `user`: the fee is already in `amountIn` and `amountOut`, so the user receives less or pays more for it.
* `capitalProvider`: the fee leaves `amountIn` and `amountOut` unchanged and comes out of the capital provider's side of the swap.

| `type` | Runtime | Token | `paidBy` |
| - | - | - | - |
| `issuer` | EVM | The capital provider's stablecoin | `capitalProvider`: the protocol fee that the stablecoin's issuer pays |
| `spread` | EVM | The capital provider's stablecoin | `user` |
| `capitalProvider` | EVM | The capital provider's stablecoin | `user`: the capital provider's redemption fee |
| `protocol` | Solana | The global fee token | `capitalProvider`: the protocol fee on the swap's value, paid from the capital provider's fee account |
| `spread` | Solana | The global fee token | `user`: taken from the user's amounts, though the capital provider's fee account pays it to the protocol |
| `discount` | Solana | The pair's quote token | `user`: the pair's redemption fee when the user buys the pair's base token, or its NAV discount when the user sells it |

On EVM, a stablecoin-input swap sends the issuer fee to the protocol out of the user's input, yet the user pays `amountIn` either way and the capital provider receives that much less, so its `paidBy` is `capitalProvider`. An EVM capital provider's NAV discount on an RWA sale is in the quoted amounts but not in `fees`, because the swap contract's quote does not report it.

### Price and NAV

Each `nav` entry has the RWA's `token`, its `value` in USD per whole token as a decimal string, and `currency` (`USD`). On EVM, `value` is the price the swap contract reads for the RWA, and an RWA without a price is left out of `nav`. On Solana, it is the swap program's own NAV, the average of the asset's configured NAV sources.

```json theme={null}
"price": "0.088736",
"nav": [
  {
    "token": {
      "address": "CCz3SGVziFeLYk2xfEstkiqJfYkjaSWb2GCABYsVcjo2",
      "symbol": "USTB",
      "name": "Invesco Short Duration US Government Securities Fund",
      "decimals": 6,
      "kind": "rwa",
      "issuer": "Superstate"
    },
    "value": "11.267578",
    "currency": "USD"
  }
]
```

### Why a capital provider cannot fill

A capital provider that cannot fill the swap appears in `alternatives`, and in `NO_QUOTE`'s `details.providers` when none can, with the error its swap would fail with. On EVM, it reports the first of these that applies:

1. The swap's own error, such as `RWANotWhitelisted`.
2. For \$TSY in through the Treasury capital provider, `CreditsUnavailable` when the \$TSY cannot be priced now, or `InsufficientCredits` when the \$TSY is above the `user`'s Treasury credits, a wallet without credits included. After `CreditsUnavailable`, retry later, or quote with `user` if you left it out.
3. `ZeroAmount` for an amount whose quote rounds to zero, so quote a larger amount.
4. `ERC20InsufficientBalance` or `ERC20InsufficientAllowance` when the capital provider's custody cannot pay the output and any protocol fee. \$TSY output from the Treasury capital provider is minted, so it never falls short.

On Solana, the error is the swap program's own, such as `InsufficientLiquidity`, and a capital provider with Treasury enabled reports `TreasuryEnabled`.

## Build

`POST /v1/swap/build` takes the quote's parameters as a JSON body, with `user` required, and:

| Field | Required | Description |
| - | - | - |
| `user` | Yes | The wallet that pays the input and signs the transactions |
| `receiver` | No | EVM only: the wallet that receives the output. Defaults to `user`. Solana rejects it with `UNSUPPORTED_FIELD`. |
| `slippageBps` | No | Bound tolerance from 0 to 5,000 basis points; default 50 |
| `minAmountOut` | No | An explicit exact-input bound, in place of `slippageBps`, in whole output tokens like `amountOut` |
| `maxAmountIn` | No | An explicit exact-output bound, in place of `slippageBps`, in whole input tokens like `amountIn` |

A request supplies at most one of `slippageBps` and the explicit bound for its swap type. The bound is derived from the build's own quote: a minimum output rounds down, `amountOut × (10,000 − slippageBps) / 10,000`, and a maximum input rounds up, `amountIn × (10,000 + slippageBps) / 10,000`. The rounding is to the token's smallest unit. On Solana, a minimum output that rounds to 0 is signed, and returned, as one base unit. An explicit bound that the quote already violates is rejected with `422` and code `BOUND_NOT_MET`, whose `details` give the bound's `field`, the `bound` sent, and the `quoted` amount, in whole tokens.

The body is limited to 2 KiB. A build stores and reserves nothing.

### Build response

| Field | Description |
| - | - |
| `quote` | The build's own quote: `swapType`, `inputToken`, `outputToken`, `amountIn`, `amountOut`, `price`, `fees`, and `capitalProvider`, as in the [quote response](#quote-response) |
| `bound` | The signed bound, in whole tokens: `minAmountOut` for exact input, `maxAmountIn` for exact output |
| `approval` | EVM only: the ERC-20 approval to land before the swap, or `null` when the user's allowance already covers it; see [Transactions on EVM](#transactions-on-evm). Omitted on Solana. |
| `accountCreation` | Solana only: the token account creation to land before the swap, or `null` when the swap transaction creates the accounts itself or needs none; see [Transactions on Solana](#transactions-on-solana). Omitted on EVM. |
| `swap` | The swap transaction |
| `checks` | What would make the swap fail, read at the quote's block or slot; see [Checks](#checks) |

`approval`, `accountCreation`, and `swap` each have a `description` to show the user and the unsigned `transaction`. A `description` gives amounts in whole tokens with the token's symbol, such as `Approve 1 USDC to the USDC delegate of capital provider Uniform Labs` or `Swap 1 USDC for at least 0.9949005 WTGXX`. An approval names its spender as [decode](#decode) labels it: the delegate's stablecoin and its capital provider, such as `the Treasury delegate of capital provider Uniform Labs` for \$TSY in. A capital provider without a name is named by its `id`.

### Transactions on EVM

* `approval`: `approve(spender, amount)` on the input token, for exactly the most the swap can take: `amountIn` for exact input, or the signed `maxAmountIn` for exact output. The spender is the capital provider's stablecoin delegate. It is `null` when the user's allowance to the spender already covers that amount.
* `swap`: `MultiliquidSwap.swap` sent by the user, paying the output to `receiver`.

Each EVM `transaction` is a complete, unsigned EIP-1559 transaction, ready to sign. The API reads the sender's nonce and the current fees from the chain and fills in every field, so the wallet or custody signer signs `serialized` as it is, or the fields unchanged, and sets no nonce, gas, or fee of its own. The approval that a batch order or redemption preparation returns, and a delegate admin transaction, have the same form.

| Field | Description |
| - | - |
| `runtime`, `chainId` | `evm`, and the network's chain ID |
| `from` | The wallet that signs and sends it |
| `to`, `data`, `value` | The call: its target, its calldata, which encodes amounts in the token's on-chain base units, and the ether it sends, in wei |
| `nonce` | The sender's next nonce, as a decimal string. When a response returns an approval and a swap, the approval takes this nonce and the swap the next one. |
| `gas` | The gas limit, as a decimal string: the simulated gas plus 20%. A swap that follows an approval is simulated after it. `null` when the transaction cannot succeed now, as `checks.simulation` says. |
| `maxFeePerGas`, `maxPriorityFeePerGas` | The fees, in wei per gas, as decimal strings, from recent blocks. `maxFeePerGas` stays above the base fee for at least six full blocks. |
| `serialized` | The unsigned transaction, `0x02` followed by the RLP encoding of exactly the fields above with an empty access list: the bytes to sign. `null`, like `gas`, when the transaction cannot succeed now. |

Sign within a few blocks of the build. If the wallet sends another transaction first, the signed one carries a used nonce, and [`POST /v1/submissions`](https://docs.multiliquid.xyz/api-reference/swap/submissions) answers `409` with `NONCE_ALREADY_USED`; build again for current values. A transaction that cannot succeed now, a swap whose simulation reverted or was skipped or an approval whose simulation reverted, keeps its `nonce` and fees with `gas` and `serialized` `null`: don't sign it. A swap skipped with `approvalRequired` can succeed: land the approval, then build again for a swap with its gas.

### Transactions on Solana

Each transaction is an unsigned version 0 transaction with the user as fee payer and only signer, so the user pays the fee and the rent of every account it creates.

* `accountCreation`: compute-budget instructions, then an idempotent creation of each token account the user lacks. It is `null` unless creating those accounts in the swap transaction would take it over 1,232 bytes.
* `swap`: compute-budget instructions, the idempotent creation of the user's missing token accounts unless `accountCreation` creates them, then the swap.

The build sets the swap's compute-unit limit to its simulated units plus 20%, or to 300,000 when the simulation did not succeed, and the compute-unit price from recent network fees, so the priority fee is between 0.00001 and 0.01 SOL. A swap whose transaction exceeds 1,232 bytes even without account creation cannot be built and answers `422` with code `INVALID_BODY`.

Each Solana `transaction` is `{runtime: "svm", serialized, recentBlockhash, lastValidBlockHeight, signers}`: the base64 wire transaction with zeroed signature slots, its blockhash, the last block height at which it can land, and the signing wallets. `accountCreation` and `swap` share the blockhash, so a wallet signs both at once and you [submit](https://docs.multiliquid.xyz/api-reference/swap/submissions.md) them together. If the blockhash expires first, a new build finds the created accounts and returns `accountCreation: null`.

### Checks

| Check | Description |
| - | - |
| `balance` | The input token, the `required` amount (`amountIn` for exact input, the signed `maxAmountIn` for exact output), the `available` balance, both in whole tokens, and whether it is `sufficient`. On Solana, a missing input token account has a balance of zero. |
| `allowance` | EVM only: the input token, the `spender`, the `required` amount as for `balance`, the `available` allowance, and whether it is `sufficient` |
| `eligibility` | Whether the wallet that receives the output may receive and hold it; see [Eligibility](#eligibility) |
| `simulation` | `succeeded` with `gasUsed` (EVM) or `computeUnits` (Solana); `reverted` with the decoded `error`; or `skipped` with its `reason`: `insufficientBalance`; on EVM `approvalRequired`, when the swap can be simulated only after its approval lands, or `approvalReverts`, when the approval would revert, with the approval's decoded revert as `error`; or on Solana `accountCreationRequired`. On EVM, a swap that needs an approval is simulated after it. |

A build never fails because a check fails; you decide whether to proceed.

### Eligibility

`checks.eligibility` reports, for the `wallet` that receives the output (the EVM `receiver` or the Solana `user`) and the output `token`, a `status` of `eligible`, `ineligible`, or `unknown`, a `reason`, and, when the status is not `eligible`, an `action` that says in plain words what to do. Show the `action` to the user before asking for a signature.

| `reason` | Runtime | `status` | Meaning |
| - | - | - | - |
| `notRestricted` | Both | `eligible` | No holder restriction applies: an EVM stablecoin output other than minted \$TSY, or a Solana token account that is not frozen, of a token without a transfer hook or a frozen default |
| `allowlisted` | Both | `eligible` | The output's allowlist admits the wallet: on EVM, the RWA's whitelist adapter, or for \$TSY that the Treasury capital provider mints, the \$TSY allowlist; on Solana, the issuer has approved the wallet's token account of a token whose accounts start frozen |
| `simulated` | Both | `eligible` | A successful simulation delivered the output, passing rules the API cannot read beforehand: an EVM RWA's own transfer rules and risk controls, or a Solana transfer hook |
| `notAllowlisted` | EVM | `ineligible` | The issuer's transfer rules, which the RWA's whitelist adapter applies, reject the wallet or the amount, so the swap would revert with `UserNotWhitelisted`; or, for minted \$TSY, the \$TSY allowlist does not include the wallet, or its blacklist does |
| `riskControls` | EVM | `ineligible` or `unknown` | The RWA sets additional risk controls, such as a per-holder volume limit: `ineligible` when the simulation reverted on them, `unknown` when no successful simulation showed them passing. On an RWA-to-RWA swap whose input RWA also sets risk controls, a revert cannot be told apart from the input's, so it is `unknown`. |
| `tokenRules` | EVM | `unknown` | The RWA has no whitelist adapter, so only its own transfer rules apply, and no successful simulation showed them passing |
| `checkFailed` | EVM | `unknown` | The RWA's whitelist adapter, or for minted \$TSY the \$TSY allowlist, could not answer |
| `accountFrozen` | Solana | `ineligible` | The issuer froze the wallet's token account for the output |
| `issuerApprovalRequired` | Solana | `ineligible` | The output's token accounts start frozen until the issuer approves them, and the wallet has no approved account |
| `transferHook` | Solana | `unknown` | The token's transfer hook decides at transfer time, and no successful simulation showed its decision |

On EVM the check asks the output RWA's whitelist adapter about the selected capital provider's custody, the receiver, and the amount, exactly as the swap contract asks it. When the Treasury capital provider mints the \$TSY output, the check reads the receiver's entries on the \$TSY allowlist and blacklist, which minting and every transfer require; an ineligible receiver's `action` reads `The TSY allowlist does not include 0x2222222222222222222222222222222222222222, or its blacklist does, so the swap would revert. Ask Multiliquid to add the wallet to the TSY allowlist, or receive TSY in another wallet.` On Solana it reads the user's output token account and the output mint's Token-2022 extensions.

```json theme={null}
"eligibility": {
  "wallet": "0x2222222222222222222222222222222222222222",
  "token": "0x43415eb6ff9db7e26a15b704e7a3edce97d31c4e",
  "status": "ineligible",
  "reason": "notAllowlisted",
  "action": "Superstate's transfer rules for USTB reject 0x2222222222222222222222222222222222222222 or this amount, so the swap would revert. Ask Superstate whether the wallet may receive USTB in this amount, or receive it in another wallet."
}
```

## Decode

`POST /v1/swap/decode` takes a transaction and returns what it does, for you to show the user before they confirm it in their wallet. The wallet stays the source of truth: decoding does not simulate the transaction or check balances, and it never broadcasts or stores it. No API key is needed.

Send `network` and one of:

| Field | Description |
| - | - |
| `transaction` | The `transaction` of a build's `approval`, `accountCreation`, or `swap`, exactly as returned |
| `serializedTransaction` | The transaction's bytes: on EVM, `0x`-prefixed EIP-2718 hex of at most 8,192 bytes, such as a `transaction`'s `serialized`; on Solana, the base64 wire bytes of a legacy or version 0 transaction of at most 1,232 bytes |

Signed and unsigned transactions both decode, and a signature that is present must verify. An EVM `transaction` that carries `serialized` must carry the bytes of its own fields, so the breakdown describes exactly what the wallet signs; one whose `serialized` does not match, or lacks the `nonce`, `gas`, or fees it needs, answers `422` with code `INVALID_BODY` and `details.field` `transaction.serialized`. The body is limited to 20 KiB.

```bash theme={null}
curl -X POST "https://api.multiliquid.xyz/v1/swap/decode" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "evm-mainnet",
    "transaction": {
      "runtime": "evm",
      "chainId": 1,
      "from": "0x2222222222222222222222222222222222222222",
      "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "data": "0x095ea7b30000000000000000000000000630582db5a1949509f21b315677c40b9aeb7bda00000000000000000000000000000000000000000000000000000000000f4240",
      "value": "0",
      "nonce": "42",
      "gas": "67134",
      "maxFeePerGas": "21500000000",
      "maxPriorityFeePerGas": "1500000000",
      "serialized": "0x02f86e012a8459682f008505017ff7008301063e94a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4880b844095ea7b30000000000000000000000000630582db5a1949509f21b315677c40b9aeb7bda00000000000000000000000000000000000000000000000000000000000f4240c0"
    }
  }'
```

```json Response expandable theme={null}
{
  "runtime": "evm",
  "network": "evm-mainnet",
  "kind": "approval",
  "summary": "Approve 1 USDC to the USDC delegate of capital provider Uniform Labs",
  "effects": [
    {
      "type": "approve",
      "description": "Approve 1 USDC to the USDC delegate of capital provider Uniform Labs",
      "token": {
        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "symbol": "USDC",
        "name": "USD Coin",
        "decimals": 6,
        "kind": "stablecoin",
        "issuer": "Circle"
      },
      "spender": {
        "address": "0x0630582db5a1949509f21b315677c40b9aeb7bda",
        "kind": "stablecoinDelegate",
        "name": "USDC delegate of capital provider Uniform Labs",
        "capitalProvider": {
          "id": "0x58e27f2731863499e6a23a1662ebeed9041d6b40996ea9ca7f4ebc54201823b4",
          "name": "Uniform Labs",
          "address": "0x0630582db5a1949509f21b315677c40b9aeb7bda"
        }
      },
      "amount": "1",
      "unlimited": false
    }
  ],
  "notes": [],
  "chainId": 1,
  "signed": false,
  "from": "0x2222222222222222222222222222222222222222",
  "to": {
    "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "kind": "token",
    "name": "USD Coin",
    "token": {
      "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": 6,
      "kind": "stablecoin",
      "issuer": "Circle"
    }
  },
  "value": "0",
  "data": "0x095ea7b30000000000000000000000000630582db5a1949509f21b315677c40b9aeb7bda00000000000000000000000000000000000000000000000000000000000f4240",
  "call": {
    "selector": "0x095ea7b3",
    "function": "approve",
    "signature": "approve(address,uint256)",
    "decodedBy": "abi",
    "arguments": [
      {
        "name": "spender",
        "type": "address",
        "value": "0x0630582db5a1949509f21b315677c40b9aeb7bda",
        "label": {
          "address": "0x0630582db5a1949509f21b315677c40b9aeb7bda",
          "kind": "stablecoinDelegate",
          "name": "USDC delegate of capital provider Uniform Labs",
          "capitalProvider": {
            "id": "0x58e27f2731863499e6a23a1662ebeed9041d6b40996ea9ca7f4ebc54201823b4",
            "name": "Uniform Labs",
            "address": "0x0630582db5a1949509f21b315677c40b9aeb7bda"
          }
        }
      },
      {
        "name": "value",
        "type": "uint256",
        "value": "1000000",
        "description": "1 USDC"
      }
    ]
  }
}
```

### Decode response

| Field | Description |
| - | - |
| `summary` | One sentence to show the user. For a build's transaction, it is that transaction's `description`. |
| `effects` | What the transaction does. Each has a `type` (`approve`, `swap`, `createTokenAccount`, `transfer`, `computeBudget`, or `unknown`), a `description`, and its fields: an approval's `token`, `spender`, `amount`, and `unlimited`, or a swap's `swapType`, `inputToken`, `outputToken`, `amountIn` or `amountOut`, its bound (`minAmountOut` or `maxAmountIn`), `capitalProvider`, `user`, and `receiver`. Amounts are in whole tokens, and an ETH transfer's in whole ETH. An amount is `null` when its token's decimals are unknown: a token Multiliquid does not list, or a Solana SPL Token `Transfer` or `Approve`, which names no mint. A Solana `TransferChecked` or `ApproveChecked` states its mint's decimals, so its amount is known even for a mint Multiliquid does not list. |
| `notes` | Facts worth showing, each with a `code` and a `message`: `receiverIsNotUser`, `senderIsNotUser`, `unlimitedApproval`, `outputAccountNotUserAta`, `unresolvedAccounts`, or `retiredContract`. A note is not a verdict. |
| `kind` | `approval`, `accountCreation`, `swap`, or `other`, as [submissions](https://docs.multiliquid.xyz/api-reference/swap/submissions.md) record it |
| `call` | EVM: the function called, with its `selector`, `signature`, and `arguments` by their ABI names. A swap's arguments name its tokens, its capital provider, and its route, and say which amount is exact and which is the bound. Each argument's `value` is what the transaction signs, so an amount is in base units, with a `description` in whole tokens, such as `1 USDC`. |
| `instructions` | Solana: each instruction's `program`, its `arguments` when decoded, and its `accounts` with their roles |

The response also carries the transaction's own fields: `chainId`, `signed`, `from`, `to`, `value` (in wei), and `data` on EVM, and `version`, `feePayer`, `signers`, `recentBlockhash`, and `addressLookupTables` on Solana. On EVM, `from` is the build's `from` for a `transaction`, and `null` for an unsigned `serializedTransaction`, whose sender only a signature shows. On Solana, each `signers` entry is `{address, signed}`. An account that an address lookup table loads has a `null` address. Decoding returns no nonce, gas, or fee fields.

Each address that Multiliquid lists is labeled with its `kind` and `name`: `swapContract`, `stablecoinDelegate` (with its `capitalProvider`), `token`, `program`, `pair`, or `capitalProvider`. Any other address is `unlisted`, which says only that Multiliquid does not list it, not that it is unsafe.

A transaction that parses is never rejected: an unlisted target or an unknown function or instruction comes back with its raw data. Bytes that do not parse, or a signature that does not verify, answer `422` with code `INVALID_TRANSACTION`. A body that names an unknown network, sends both or neither of `transaction` and `serializedTransaction`, or sends a `transaction` that is not the network's or whose fields disagree with its bytes answers `422` with code `INVALID_BODY` and `details.field`. Decoding answers for every network, whether or not it is active.

## Errors

A request the swap cannot serve fails with a code whose `details` say what to change: `400` for a quote's query and `422` for a build's body. A network that the API does not serve answers `503` with code `NETWORK_NOT_ACTIVE` and `details.network`, before any other parameter's value is checked; a build's body must still be well-formed JSON with every required field. A Solana build whose accounts cannot be resolved from current chain state, as when an account the swap needs is missing or does not match the pair, answers `409` with code `CONFLICT`.

| Code | `details` |
| - | - |
| `UNSUPPORTED_TOKEN` | `field` (`inputToken` or `outputToken`), `token`, and `network` |
| `UNSUPPORTED_PAIR` | `inputToken`, `outputToken`, `network`, and the requested `capitalProvider`, if any: the two tokens are the same, no listed capital provider swaps the pair, or the pair does not list the one the request names |
| `UNKNOWN_CAPITAL_PROVIDER` | `field` (`capitalProvider`), the `capitalProvider` sent, and `network`: the network lists no capital provider with that ID |
| `NO_QUOTE` | `providers`: each capital provider the pair lists, or the one the request names, as `capitalProvider`, with the decoded `error` (`name` and `message`) it rejected the quote with |
| `BOUND_NOT_MET` | Build only: `field` (`minAmountOut` or `maxAmountIn`), the `bound` sent, and the `quoted` amount, in whole tokens |
| `UNSUPPORTED_FIELD` | Build only: `field`, a field of the other runtime, such as `receiver` on Solana, and `network` |

```json theme={null}
{
  "error": "no capital provider can quote this swap: 0x58e27f2731863499e6a23a1662ebeed9041d6b40996ea9ca7f4ebc54201823b4: the capital provider does not accept this RWA (RWANotWhitelisted)",
  "status": 400,
  "code": "NO_QUOTE",
  "details": {
    "providers": [
      {
        "capitalProvider": {
          "id": "0x58e27f2731863499e6a23a1662ebeed9041d6b40996ea9ca7f4ebc54201823b4",
          "name": "Uniform Labs",
          "address": "0x0630582db5a1949509f21b315677c40b9aeb7bda"
        },
        "error": {
          "name": "RWANotWhitelisted",
          "message": "the capital provider does not accept this RWA"
        }
      }
    ]
  },
  "requestId": "req_019a5c1e8f3b7c2d9e4f6a1b2c3d4e5f"
}
```

When the service is busy, a quote or build waits up to five seconds, then answers `429` with `Retry-After` while its rate-limit allowance still has requests left, as [Rate limits](https://docs.multiliquid.xyz/api-reference/guides/rate-limits.md#a-busy-service) describes. [Errors](https://docs.multiliquid.xyz/api-reference/guides/errors.md) lists every code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.