> ## 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.

# Price Adapters

> USD-denominated pricing and stablecoin guardrails for Multiliquid

## Overview

Price adapters give Multiliquid a consistent USD price for assets with different
pricing sources. Every adapter implements the same read-only interface and returns
an 18-decimal WAD value, allowing `MultiliquidSwap` to use one pricing engine for
every supported route.

> [card] RWA valuation
>
> Registered RWA adapters provide the prices used to quote and execute swaps.

> [card] Stablecoin guardrails
>
> Optional stablecoin adapters validate configured USD values against live
> oracle prices.

## Interface and units

All price adapters implement `IPriceAdapter`:

```solidity theme={null}
interface IPriceAdapter {
    /// @return price USD price in 18-decimal WAD format
    function getPrice() external view returns (uint256 price);
}
```

The returned price is denominated in USD with 18 decimals:

| USD price | WAD value |
| - | -: |
| \$1.00 | `1_000_000_000_000_000_000` |
| \$1.05 | `1_050_000_000_000_000_000` |
| \$0.99 | `990_000_000_000_000_000` |

`MultiliquidSwap` rejects a zero price. Individual adapters may also validate
source-specific conditions such as oracle freshness, completed rounds, and
positive values.

## How pricing is used

```mermaid theme={null}
flowchart LR
    Source["NAV contract, oracle, or<br/>authorized price setter"]
    Adapter["IPriceAdapter.getPrice()<br/>18-decimal USD WAD"]
    Swap["MultiliquidSwap<br/>quoteSwap() / swap()"]
    Amounts["Resolved token amounts<br/>and fee amounts"]

    Source --> Adapter --> Swap --> Amounts
```

For RWA routes, `MultiliquidSwap` reads the adapter registered for each RWA ID.
For stablecoins, the protocol uses an administrator-configured USD value and can
optionally compare it with a registered price adapter before accepting that value.

## Adapter catalog

| Adapter | Price source | Normalization | Primary use |
| - | - | - | - |
| `ULTRAAdapter` | ULTRA manager exchange rate | Manager rate and basis-point denominator to WAD | ULTRA |
| `USTBAdapter` | Chainlink-compatible feed | 6 decimals to WAD | USTB |
| `FalconXUSDCPriceAdapter` | Pareto credit vault `priceAA()` | 6 decimals to WAD | AA\_FalconXUSDC |
| `ChainlinkPriceAdapter` | Chainlink-compatible feed | Feed decimals to WAD | General oracle pricing and stablecoin guardrails |
| `ChroniclePriceAdapter` | Chronicle oracle | Native WAD | General oracle pricing and stablecoin guardrails |
| `DollarPeggedAdapter` | Constant | Returns exactly `1e18` | Assets priced at \$1.00 |
| `ThirdPartySetterPriceAdapter` | Authorized onchain price setter | Price supplied in WAD | Published NAVs |

## Direct NAV adapters

### ULTRAAdapter

`ULTRAAdapter` reads `lastSetMintExchangeRate()` and
`BPS_DENOMINATOR()` from the ULTRA manager, then normalizes the result to
18 decimals:

```solidity theme={null}
price =
    ultraManager.lastSetMintExchangeRate() *
    1e18 /
    ultraManager.BPS_DENOMINATOR();
```

The adapter rejects a zero manager address at deployment and a zero calculated
price.

### USTBAdapter

`USTBAdapter` reads the latest answer from a Chainlink-compatible feed and
multiplies the 6-decimal answer by `1e12`. It rejects a zero feed address and
non-positive answers.

### FalconXUSDCPriceAdapter

`FalconXUSDCPriceAdapter` reads `priceAA()` from the Pareto credit vault for
`AA_FalconXUSDC`. Because the vault reports the price in the 6-decimal USDC
underlying unit, the adapter multiplies it by `1e12`. It rejects a zero vault
address and a zero price.

## General oracle adapters

### ChainlinkPriceAdapter

`ChainlinkPriceAdapter` supports feeds with up to 18 decimals and calculates its
WAD multiplier from the feed's `decimals()` value at deployment.

Each price read validates:

* The answer is positive.
* The update belongs to a completed round.
* The update timestamp is present and is not in the future.
* The update is no older than `MAX_AGE`.

Addresses with `OPERATOR_ROLE` can update `MAX_AGE` to a nonzero value with
`setMaxAge()`. The adapter emits `MaxAgeUpdated` whenever the threshold changes.

### ChroniclePriceAdapter

`ChroniclePriceAdapter` reads `tryReadWithAge()` from a Chronicle oracle.
Chronicle prices are already WAD-denominated, so the adapter returns the value
without decimal scaling.

Each price read requires a valid, nonzero value with a timestamp that is not in
the future or older than `MAX_AGE`. Addresses with `OPERATOR_ROLE` can update the
nonzero freshness threshold with `setMaxAge()`.

## Fixed and managed adapters

### DollarPeggedAdapter

`DollarPeggedAdapter` always returns `1e18`, representing exactly \$1.00. It has
no external dependencies or mutable state and is suitable for assets whose
protocol price is fixed at one dollar.

### ThirdPartySetterPriceAdapter

`ThirdPartySetterPriceAdapter` stores a WAD-denominated price published by an
authorized account:

* `DEFAULT_ADMIN_ROLE` manages price setters.
* `PRICE_SETTER_ROLE` authorizes calls to `setPrice()`.
* `getPrice()` returns the current value and reverts while that value is zero.
* `PriceUpdated` records the new price and the account that submitted it.

The production VBILL adapter uses this model for its published NAV.

## Stablecoin price guardrails

A stablecoin registration includes an administrator-configured USD value. An
optional price adapter and deviation threshold can add an oracle guardrail to
that value.

When a guardrail is enabled, `MultiliquidSwap` compares the configured value with
the adapter's live WAD price. The configured value is accepted only when its
absolute deviation from the oracle price is within the stablecoin's configured
threshold.

```text theme={null}
deviation = abs(configured USD value - oracle price) / configured USD value
```

This keeps the stablecoin value used for route math explicit while allowing
onchain oracle validation. The same `IPriceAdapter` interface supports both
Chainlink and Chronicle guardrails.

## Production asset assignments

| Asset | Adapter implementation |
| - | - |
| ULTRA | `ULTRAAdapter` |
| WTGXX | `DollarPeggedAdapter` |
| BENJI | `DollarPeggedAdapter` |
| USTB | `USTBAdapter` |
| VBILL | `ThirdPartySetterPriceAdapter` |
| USCC | `ChainlinkPriceAdapter` |
| AA\_FalconXUSDC | `FalconXUSDCPriceAdapter` |
| USDC guardrail | `ChainlinkPriceAdapter` |

See [Deployments](https://docs.multiliquid.xyz/evm/deployments.md) for the corresponding production addresses.

## Integration considerations

* Treat every adapter price as an 18-decimal USD WAD, independent of the token's
  own decimals.
* Use `quoteSwap()` to obtain the exact token and fee amounts produced by the
  protocol's registered adapters.
* Monitor adapter-specific update events and source freshness where the adapter
  has mutable pricing or freshness parameters.
* A successful price read validates pricing data; token inventory, custody
  balances, allowances, and recipient eligibility are enforced during settlement.

> [card] [Next: V1 to V2 Changes](https://docs.multiliquid.xyz/evm/contracts/v1-to-v2-changes.md)
>
> Review the integration-facing changes introduced by the current protocol
> architecture.


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