Skip to main content

Querying Off-Chain Prices

When building analytics tools, dashboards, or performing off-chain calculations (such as collateral market value), you often need up-to-date asset prices. Euler provides an internal API endpoint that can be used to fetch prices for supported assets.

The Euler Price API Endpoint

You can query asset prices using the following endpoint:

https://app.euler.finance/api/v1/price?chainId=1&assets=ASSET_ADDRESS
  • chainId=1 specifies Ethereum mainnet.
  • assets is a comma-separated list of asset addresses (ERC-20 tokens)

Example: Single Asset

To get the price for wstETH (address: 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0):

https://app.euler.finance/api/v1/price?chainId=1&assets=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0

Example: Multiple Assets

To get prices for wstETH and WETH:

https://app.euler.finance/api/v1/price?chainId=1&assets=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Limitations and Notes

  • Not all assets may be supported. If the endpoint does not return a price for a given asset, you will need to use your own price source.
  • Unofficial endpoint: This API is not officially documented and may be subject to change or rate limits.
  • Price units: Prices are typically returned in USD with 18 decimals (1e18 = $1.00), but always check the response format.

Tip: Always validate the returned prices and have a fallback in case the API does not return a value for your asset.

Context: Why Use Off-Chain Prices?

In some cases, protocol risk managers configure oracles that do not directly reflect the current market price. For example, they may use hardcoded values for certain assets, or rely on oracles (such as Chainlink) that are naturally lagging behind the market due to heartbeat intervals or update thresholds. This means the on-chain price used for risk management and liquidations may differ from the real-time market price.

For analytics, risk assessment, or user interfaces, you may want to use a more up-to-date or market-reflective price. Off-chain prices can help you calculate the real-time market value of a collateral position and provide users with more accurate portfolio valuations.