### Quick start: clone, install, and run Euler Lite Source: https://docs.euler.finance/build/euler-lite Clones the euler-lite repository, installs dependencies with npm ci, copies the environment template, and starts the development server. The app will be available at http://localhost:3000. ```bash git clone https://github.com/euler-xyz/euler-lite cd euler-lite npm ci cp .env.example .env # Fill in required values (see below) npm run dev ``` -------------------------------- ### Install Euler V2 SDK Source: https://docs.euler.finance/build/sdk Install the stable release of the SDK using npm. ```bash npm install @eulerxyz/euler-v2-sdk ``` -------------------------------- ### Install all Euler skills Source: https://docs.euler.finance/llms Use this command to install the complete suite of Euler agent skills. ```bash npx add-skill euler-xyz/agent-skills --skill euler-vaults --skill euler-irm-oracles --skill euler-earn --skill euler-advanced --skill euler-data ``` -------------------------------- ### Example API Requests Source: https://docs.euler.finance/build/data-querying/euler-v3-api Examples of basic curl requests to fetch chain information and vault data. ```bash curl https://v3.euler.finance/v3/chains curl "https://v3.euler.finance/v3/evk/vaults?chainId=1&limit=20" ``` -------------------------------- ### Description example Source: https://docs.euler.finance/curate/vaults/labeling Example of a factual, maintainable description for an EVK lending product. Identifies the object and the party that configures it without implying endorsement. ```text An EVK lending product for selected assets, configured by Example DAO. ``` -------------------------------- ### Example ROE Calculation Source: https://docs.euler.finance/use/return-on-equity A practical example calculating ROE for $1,000 supplied at 7.5% APY and $800 borrowed at 4.5% APY. ```text equity = $1,000 − $800 = $200 multiplier = $1,000 / $200 = 5 ROE = (($1,000 × 7.5%) − ($800 × 4.5%)) / $200 = 19.5% ``` -------------------------------- ### Install core vault skill Source: https://docs.euler.finance/llms Use this command to install the euler-vaults skill for agent operations. ```bash npx add-skill euler-xyz/agent-skills --skill euler-vaults ``` -------------------------------- ### Tags schema example Source: https://docs.euler.finance/curate/vaults/labeling Example of the tags schema used in metadata files. Tags can be set on a product, a vault entry, or in vaultOverrides. Other examples in use include "keyring" and "suppress high utilisation warning". ```json { "tags": ["governance limited"] } ``` -------------------------------- ### Authenticated API Request Source: https://docs.euler.finance/build/data-querying/euler-v3-api Example of using an API key via the X-API-Key header to increase rate limits. ```bash curl -H "X-API-Key: your-key" \ "https://v3.euler.finance/v3/tokens" ``` -------------------------------- ### Activate Spy Mode with ?spy= URL parameter Source: https://docs.euler.finance/use/spy-mode Append the ?spy= query parameter with an Ethereum address to the app URL to activate Spy Mode. Replace the example address with the address you want to view. ```text https://app.euler.finance/portfolio?spy=0x1234... ``` -------------------------------- ### GET /v3/prices Source: https://docs.euler.finance/build/data-querying/euler-v3-api Fetches current USD prices for one or more assets on a specified chain. Accepts comma-separated addresses and returns price data for each asset. ```APIDOC ## GET /v3/prices ### Description Fetches current USD prices for one or more assets on a specified chain. Accepts comma-separated addresses and returns price data for each asset. ### Method GET ### Endpoint https://v3.euler.finance/v3/prices ### Parameters #### Query Parameters - **chainId** (integer) - Required - The chain ID of the network. - **addresses** (string) - Required - Comma-separated list of token addresses (EIP-55 checksummed). ### Request Example curl "https://v3.euler.finance/v3/prices?chainId=1&addresses=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ### Response #### Success Response (200) - **data** (array) - List of price objects. - **chainId** (integer) - Chain ID. - **address** (string) - Token address. - **symbol** (string) - Token symbol. - **decimals** (integer) - Token decimals. - **priceUsd** (number) - USD price. - **source** (string) - Source category: onchain, offchain, or hardcoded. - **timestamp** (string) - ISO-8601 UTC timestamp. #### Response Example { "data": [ { "chainId": 1, "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", "symbol": "wstETH", "decimals": 18, "priceUsd": 2323.31, "source": "offchain", "timestamp": "2026-07-14T16:11:24.895Z" } ] } ``` -------------------------------- ### Environment variables for RPC and subgraph endpoints Source: https://docs.euler.finance/build/euler-lite Example environment variables for Ethereum Mainnet and Arbitrum. The server reads RPC_URL_ and the matching subgraph setting at startup. Environment variables alone do not establish complete support for an unknown chain. ```bash # Ethereum Mainnet RPC_URL_1=https://your-rpc-endpoint.com SUBGRAPH_URL_1=https://your-subgraph-host/euler-mainnet/latest/gn # Arbitrum RPC_URL_42161=https://your-arbitrum-rpc.com SUBGRAPH_URL_42161=https://your-subgraph-host/euler-arbitrum/latest/gn ``` -------------------------------- ### GET /v3/prices/history Source: https://docs.euler.finance/build/data-querying/euler-v3-api Fetches historical USD prices for one or more assets over a specified time range, using Unix seconds for from and to parameters. ```APIDOC ## GET /v3/prices/history ### Description Fetches historical USD prices for one or more assets over a specified time range, using Unix seconds for from and to parameters. ### Method GET ### Endpoint https://v3.euler.finance/v3/prices/history ### Parameters #### Query Parameters - **chainId** (integer) - Required - The chain ID of the network. - **addresses** (string) - Required - Comma-separated list of token addresses (EIP-55 checksummed). - **from** (integer) - Required - Start timestamp in Unix seconds. - **to** (integer) - Required - End timestamp in Unix seconds. ### Request Example curl "https://v3.euler.finance/v3/prices/history?chainId=1&addresses=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0&from=1750000000&to=1752000000" ### Response #### Success Response (200) - **data** (array) - List of price objects. - **chainId** (integer) - Chain ID. - **address** (string) - Token address. - **symbol** (string) - Token symbol. - **decimals** (integer) - Token decimals. - **priceUsd** (number) - USD price. - **source** (string) - Source category: onchain, offchain, or hardcoded. - **timestamp** (string) - ISO-8601 UTC timestamp. #### Response Example { "data": [ { "chainId": 1, "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", "symbol": "wstETH", "decimals": 18, "priceUsd": 2323.31, "source": "offchain", "timestamp": "2026-07-14T16:11:24.895Z" } ] } ``` -------------------------------- ### GET /v3/tokens/{chainId}/{address}/price Source: https://docs.euler.finance/build/data-querying/euler-v3-api Fetches the current USD price for a single token on a specified chain. ```APIDOC ## GET /v3/tokens/{chainId}/{address}/price ### Description Fetches the current USD price for a single token on a specified chain. ### Method GET ### Endpoint https://v3.euler.finance/v3/tokens/{chainId}/{address}/price ### Parameters #### Path Parameters - **chainId** (integer) - Required - The chain ID of the network. - **address** (string) - Required - The token address (EIP-55 checksummed). ### Request Example curl "https://v3.euler.finance/v3/tokens/1/0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0/price" ### Response #### Success Response (200) - **data** (object) - Price object. - **chainId** (integer) - Chain ID. - **address** (string) - Token address. - **symbol** (string) - Token symbol. - **decimals** (integer) - Token decimals. - **priceUsd** (number) - USD price. - **source** (string) - Source category: onchain, offchain, or hardcoded. - **timestamp** (string) - ISO-8601 UTC timestamp. #### Response Example { "data": { "chainId": 1, "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", "symbol": "wstETH", "decimals": 18, "priceUsd": 2323.31, "source": "offchain", "timestamp": "2026-07-14T16:11:24.895Z" } } ``` -------------------------------- ### GET /v3/tokens Source: https://docs.euler.finance/build/data-querying/euler-v3-api Lists tokens. This endpoint is used to retrieve token data and can be called with an API key for higher rate limits. ```APIDOC ## GET /v3/tokens ### Description Lists tokens. ### Method GET ### Endpoint /v3/tokens ### Request Example curl -H "X-API-Key: your-key" \ "https://v3.euler.finance/v3/tokens" ### Response #### Success Response (200) - **tokens** (array) - List of tokens #### Response Example { "tokens": [] } ``` -------------------------------- ### GET /v3/chains Source: https://docs.euler.finance/build/data-querying/euler-v3-api Lists supported chains. This endpoint is part of the Euler Data API V3 and is used to retrieve the chains supported by the protocol. ```APIDOC ## GET /v3/chains ### Description Lists supported chains. ### Method GET ### Endpoint /v3/chains ### Request Example curl https://v3.euler.finance/v3/chains ### Response #### Success Response (200) - **chains** (array) - List of supported chains #### Response Example { "chains": [] } ``` -------------------------------- ### GET /v3/evk/vaults Source: https://docs.euler.finance/build/data-querying/euler-v3-api Lists EVK vaults with optional query parameters. This endpoint is used to retrieve vault data for a given chain. ```APIDOC ## GET /v3/evk/vaults ### Description Lists EVK vaults. ### Method GET ### Endpoint /v3/evk/vaults ### Parameters #### Query Parameters - **chainId** (integer) - Optional - Chain ID to filter vaults - **limit** (integer) - Optional - Maximum number of results ### Request Example curl "https://v3.euler.finance/v3/evk/vaults?chainId=1&limit=20" ### Response #### Success Response (200) - **vaults** (array) - List of EVK vaults #### Response Example { "vaults": [] } ``` -------------------------------- ### Fetch vault metadata with curl Source: https://docs.euler.finance/build/data-querying/perspectives Sends a GET request to /api/public/metadata with chainId and addresses parameters. Returns a JSON object with metadata for each known vault, including name, type, deprecation status, and entities. ```bash curl "https://app.euler.finance/api/public/metadata?chainId=1&addresses=0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9" ``` ```json { "0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9": { "chainId": 1, "address": "0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9", "type": "evk", "name": "K3 Capital Prime Market", "description": "A lending and borrowing market for stablecoin-denominated assets and selected collateral, configured by K3 Capital", "portfolioNotice": null, "deprecationReason": null, "deprecated": false, "governanceLimited": false, "productId": "k3-prime", "asset": { "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "symbol": "USDC", "name": "USD Coin", "decimals": 6, "url": "https://token-images.euler.finance/1/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }, "entities": [ { "name": "K3 Capital", "logo": "https://labels.euler.finance/master/logo/k3.svg", "description": "K3 Capital is a third-party curator using Euler infrastructure...", "url": "https://k3.capital/" } ] } } ``` -------------------------------- ### GET /api/public/metadata Source: https://docs.euler.finance/build/data-querying/perspectives Returns display metadata for known vaults, including name, description, vault type, deprecation status, product, underlying asset, and curator entities. If addresses are omitted, returns metadata for all known vaults on the chain. ```APIDOC ## GET /api/public/metadata ### Description Returns display metadata for known vaults, including name, description, vault type, deprecation status, product, underlying asset, and curator entities. If addresses are omitted, returns metadata for all known vaults on the chain. ### Method GET ### Endpoint https://app.euler.finance/api/public/metadata ### Parameters #### Query Parameters - **chainId** (integer) - Required - The chain to query. - **addresses** (string) - Optional - Comma-separated list of up to 100 addresses. Unknown addresses return null. If omitted, returns metadata for every known vault on the chain. - **productId** (string) - Optional - Only return vaults belonging to a given product slug (e.g. k3-prime). ### Request Example curl "https://app.euler.finance/api/public/metadata?chainId=1&addresses=0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9" ### Response #### Success Response (200) Returns an object mapping each address to a metadata object containing chainId, address, type, name, description, portfolioNotice, deprecationReason, deprecated, governanceLimited, productId, asset, and entities. #### Response Example { "0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9": { "chainId": 1, "address": "0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9", "type": "evk", "name": "K3 Capital Prime Market", "description": "A lending and borrowing market for stablecoin-denominated assets and selected collateral, configured by K3 Capital", "portfolioNotice": null, "deprecationReason": null, "deprecated": false, "governanceLimited": false, "productId": "k3-prime", "asset": { "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "symbol": "USDC", "name": "USD Coin", "decimals": 6, "url": "https://token-images.euler.finance/1/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" }, "entities": [ { "name": "K3 Capital", "logo": "https://labels.euler.finance/master/logo/k3.svg", "description": "K3 Capital is a third-party curator using Euler infrastructure...", "url": "https://k3.capital/" } ] } } ``` -------------------------------- ### List all known vaults for a chain with curl Source: https://docs.euler.finance/build/data-querying/perspectives Sends a GET request to /api/public/is-known without the addresses parameter to retrieve the full set of known vaults for the chain. Returns an object with true values for each known vault address. ```bash curl "https://app.euler.finance/api/public/is-known?chainId=1" ``` -------------------------------- ### Check if an address is a known vault with curl Source: https://docs.euler.finance/build/data-querying/perspectives Sends a GET request to /api/public/is-known with chainId and addresses parameters. Returns a JSON object mapping each address to true if it is a known vault. ```bash curl "https://app.euler.finance/api/public/is-known?chainId=1&addresses=0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9" ``` ```json { "0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9": true } ``` -------------------------------- ### GET /api/public/is-known Source: https://docs.euler.finance/build/data-querying/perspectives Returns whether the given addresses are known vaults on a specified chain. If addresses are omitted, returns the full set of known vault addresses for the chain. ```APIDOC ## GET /api/public/is-known ### Description Returns whether the given addresses are known vaults on a specified chain. If addresses are omitted, returns the full set of known vault addresses for the chain. ### Method GET ### Endpoint https://app.euler.finance/api/public/is-known ### Parameters #### Query Parameters - **chainId** (integer) - Required - The chain to check against. - **addresses** (string) - Optional - Comma-separated list of up to 100 addresses. If omitted, returns the full known set for the chain. ### Request Example curl "https://app.euler.finance/api/public/is-known?chainId=1&addresses=0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9" ### Response #### Success Response (200) Returns an object mapping each address to a boolean indicating whether it is a known vault. If addresses are omitted, returns an object with all known vault addresses as keys and true values. #### Response Example { "0x797DD80692c3b2dAdabCe8e30C07fDE5307D48a9": true } ``` -------------------------------- ### Error response envelope with stable error code Source: https://docs.euler.finance/build/data-querying/euler-v3-api Errors return an error object with a stable code, message, and request id. Example shows a VALIDATION_ERROR with message 'Invalid chain ID'. ```json { "error": { "code": "VALIDATION_ERROR", "message": "Invalid chain ID", "requestId": "req_abc123" } } ``` -------------------------------- ### Build and preview commands Source: https://docs.euler.finance/build/euler-lite Commands to build the project and preview it locally. The preview command is commented as 'preview locally'. ```bash npm run build npm run preview # preview locally ``` -------------------------------- ### Build and run liquidation bot with environment variables Source: https://docs.euler.finance/build/liquidation-bot Build the Rust binary and run it with required environment variables. The environment exports illustrate required names only and are not a recommended production secret-loading method. The bot is run from a directory containing the relevant config file. ```bash cargo build --release export CHAIN_ID=1 export RPC_URL_1="https://your-mainnet-rpc" export SUBGRAPH_URL_PREFIX="https://your-subgraph-host/" export EOA_ADDRESS="0xYourWalletAddress" export EOA_PRIVATE_KEY="0xYourPrivateKey" cd configs ../target/release/liquidation-bot-v3 ``` -------------------------------- ### Initialize Euler SDK Source: https://docs.euler.finance/build/sdk Configure the SDK with RPC URLs using the buildEulerSDK function. ```typescript import { buildEulerSDK } from "@eulerxyz/euler-v2-sdk"; import { mainnet } from "viem/chains"; const sdk = await buildEulerSDK({ config: { rpcUrls: { [mainnet.id]: "https://your-mainnet-rpc", }, }, }); ``` -------------------------------- ### Configure RPC via Environment Variables Source: https://docs.euler.finance/build/sdk Alternative method to configure RPC URLs using environment variables. ```bash EULER_SDK_RPC_URL_1=https://your-mainnet-rpc ``` -------------------------------- ### Plan, Simulate, and Execute Transactions Source: https://docs.euler.finance/build/sdk Workflow to plan a deposit, simulate the transaction, and execute it if valid. ```typescript import { parseUnits } from "viem"; const { result: account } = await sdk.accountService.fetchAccount( mainnet.id, "0xOwner...", ); const plan = sdk.executionService.planDeposit({ account, vault: "0xVault...", asset: "0xAsset...", receiver: "0xReceiverOrSubAccount...", amount: parseUnits("100", 6), enableCollateral: true, }); const simulation = await sdk.executionService.simulateTransactionPlan( mainnet.id, account, plan, { stateOverrides: true }, ); if (simulation.canExecute) { await sdk.executionService.executeTransactionPlan({ plan, chainId: mainnet.id, account, sendTransaction: walletClient.sendTransaction, signTypedData: walletClient.signTypedData, }); } ``` -------------------------------- ### Product Navigation Links Source: https://docs.euler.finance/products A list of links for interacting with Euler Earn products, including usage, integration, and operation paths. ```html
Use Integrate Operate
``` -------------------------------- ### Docker build with Doppler integration Source: https://docs.euler.finance/build/euler-lite Builds a Docker image with the APP_PORT build argument and runs it with Doppler environment variables for runtime secret injection. ```bash docker build --build-arg APP_PORT=3000 -t euler-lite . ``` ```bash docker run -p 3000:3000 \ -e DOPPLER_TOKEN=your-doppler-token \ -e DOPPLER_PROJECT=euler-lite \ -e DOPPLER_CONFIG=production \ euler-lite ``` -------------------------------- ### Borrow from a sub-account Source: https://docs.euler.finance/build/evc/integration-guide Demonstrates creating a debt position on behalf of a sub-account while sending the borrowed tokens to the main address. ```solidity // Borrow on behalf of subAccount3, but send tokens to your main address IEVC.BatchItem[] memory items = new IEVC.BatchItem[](1); items[0] = IEVC.BatchItem({ targetContract: vault, onBehalfOfAccount: subAccount3, // debt is created here value: 0, data: abi.encodeWithSelector(IVault.borrow.selector, borrowAmount, myAddress) // tokens sent to main address }); connector.batch(items); ``` -------------------------------- ### Repay debt using borrow asset Source: https://docs.euler.finance/build/evk/interacting-with-vaults Demonstrates how to approve the vault to pull the repayment amount and execute a full debt repayment using type(uint256).max. ```solidity uint256 currentDebt = IEVault(borrowVault).debtOf(debtAccount); IERC20 borrowAsset = IERC20(IEVault(borrowVault).asset()); // The allowance can include a buffer for interest that accrues before repay. // repay(max, ...) still pulls only the amount actually owed. uint256 repaymentAllowance = currentDebt + (currentDebt / 100); borrowAsset.approve(borrowVault, repaymentAllowance); // type(uint256).max repays the account's full current debt. uint256 repaid = IEVault(borrowVault).repay( type(uint256).max, debtAccount ); ``` -------------------------------- ### Batch collateral deposit and borrow Source: https://docs.euler.finance/build/evk/interacting-with-vaults Uses the EVC to atomically enable collateral, deposit assets, enable a controller, and borrow funds in a single batch transaction. ```solidity IEVC.BatchItem[] memory items = new IEVC.BatchItem[](4); items[0] = IEVC.BatchItem({ targetContract: address(evc), onBehalfOfAccount: address(0), value: 0, data: abi.encodeCall( IEVC.enableCollateral, (account, collateralVault) ) }); items[1] = IEVC.BatchItem({ targetContract: collateralVault, onBehalfOfAccount: account, value: 0, data: abi.encodeCall( IEVault.deposit, (collateralAmount, account) ) }); items[2] = IEVC.BatchItem({ targetContract: address(evc), onBehalfOfAccount: address(0), value: 0, data: abi.encodeCall( IEVC.enableController, (account, borrowVault) ) }); items[3] = IEVC.BatchItem({ targetContract: borrowVault, onBehalfOfAccount: account, value: 0, data: abi.encodeCall( IEVault.borrow, (borrowAmount, receiver) ) }); IEVC(evc).batch(items); ``` -------------------------------- ### Simulate transactions with batchSimulation Source: https://docs.euler.finance/build/evc/integration-guide Use batchSimulation to analyze transaction results before execution. Note that simulation mode is observable by called contracts and should not be treated as a security guarantee. ```solidity ( IEVC.BatchItemResult[] memory results, IEVC.StatusCheckResult[] memory accountChecks, IEVC.StatusCheckResult[] memory vaultChecks ) = connector.batchSimulation(items); // Analyze results before sending a real transaction ``` -------------------------------- ### Borrow assets using EVC Source: https://docs.euler.finance/build/evk/interacting-with-vaults Borrowing requires depositing collateral, enabling the collateral and controller vaults via EVC, and then calling the borrow function. ```solidity // 1. Deposit the collateral asset. IERC20 collateralAsset = IERC20(IEVault(collateralVault).asset()); collateralAsset.approve(collateralVault, collateralAmount); IEVault(collateralVault).deposit(collateralAmount, account); // 2. Enable collateral and the liability/controller vault. IEVC(evc).enableCollateral(account, collateralVault); IEVC(evc).enableController(account, borrowVault); // 3. Borrow from the liability vault. uint256 borrowed = IEVault(borrowVault).borrow(borrowAmount, receiver); ``` -------------------------------- ### Implement flash liquidity borrower Source: https://docs.euler.finance/build/evk/interacting-with-vaults A contract implementation of IFlashLoan that handles the flash loan callback and ensures the asset is returned to the vault. ```solidity contract FlashBorrower is IFlashLoan { using SafeERC20 for IERC20; IEVault public immutable vault; IERC20 public immutable asset; constructor(IEVault vault_) { vault = vault_; asset = IERC20(vault_.asset()); } function execute(uint256 amount, bytes calldata userData) external { // Production code must add its own caller authorization. vault.flashLoan(amount, abi.encode(amount, userData)); } function onFlashLoan(bytes memory data) external { require(msg.sender == address(vault), "unexpected vault"); (uint256 amount, bytes memory userData) = abi.decode(data, (uint256, bytes)); // Perform the reviewed atomic operation using amount and userData. asset.safeTransfer(address(vault), amount); } } ``` -------------------------------- ### Enable Lockdown Mode Source: https://docs.euler.finance/build/evc/integration-guide Restricts all operations for an address prefix except for managing operators and nonces. This is useful if a malicious operator or permit is suspected. ```solidity evc.setLockdownMode(evc.getAddressPrefix(owner), true); ``` -------------------------------- ### Direct feed oracle route SVG Source: https://docs.euler.finance/learn/price-oracles Visualizes a direct price feed route from a collateral asset to a USD value using a Chainlink oracle. ```xml ETH Collateral Chainlink ETH / USD USD Value ``` -------------------------------- ### Fetch current and historical prices from Euler V3 API Source: https://docs.euler.finance/build/data-querying/euler-v3-api Curl commands to fetch current prices for one or more assets, current price for a single token, and historical prices over a time range using Unix seconds. The old price endpoint has been removed. ```bash # Current prices for one or more assets (comma-separated) curl "https://v3.euler.finance/v3/prices?chainId=1&addresses=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" # Current price for a single token curl "https://v3.euler.finance/v3/tokens/1/0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0/price" # Historical prices over a time range (Unix seconds) curl "https://v3.euler.finance/v3/prices/history?chainId=1&addresses=0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0&from=1750000000&to=1752000000" ``` -------------------------------- ### Call feeFlow.buy to purchase assets Source: https://docs.euler.finance/EUL/fee-flow Invoke the buy function on a FeeFlowController to sweep specified assets to a receiver in exchange for a payment token. The caller must supply the asset list, receiver, current epoch ID, deadline, and maximum payment amount. Use getSlot0() and getPrice() immediately before constructing the purchase and protect execution with the epoch ID, deadline, maximum payment, private transaction strategy, and an independently verified inventory list. ```solidity feeFlow.buy( assets, // assets to sweep from the controller assetsReceiver, currentEpochId, deadline, maxPaymentTokenAmount ); ``` -------------------------------- ### ERC-4626 Conversion and Preview Functions Source: https://docs.euler.finance/build/evk/interacting-with-vaults Use these standard ERC-4626 functions to calculate asset-to-share conversions and preview deposit or withdrawal outcomes instead of manual accounting formulas. ```solidity uint256 assetsForShares = IEVault(vault).convertToAssets(shares); uint256 sharesForAssets = IEVault(vault).convertToShares(assets); uint256 expectedShares = IEVault(vault).previewDeposit(assets); uint256 sharesToBurn = IEVault(vault).previewWithdraw(assets); ``` -------------------------------- ### Read Account and Vault Data Source: https://docs.euler.finance/build/sdk Fetch user account, portfolio, and vault metadata using the SDK services. ```typescript const { result: account } = await sdk.accountService.fetchAccount( mainnet.id, "0xOwner...", { populateAll: true, }, ); const { result: portfolio } = await sdk.portfolioService.fetchPortfolio( mainnet.id, "0xOwner...", ); const { result: vault } = await sdk.vaultMetaService.fetchVault( mainnet.id, "0xVault...", ); ``` -------------------------------- ### Submit EVC permits Source: https://docs.euler.finance/build/evc/integration-guide Submit an EIP-712 signed permit to the EVC to allow a relayer to execute operations on behalf of the signer. Ensure all parameters like nonce and deadline are verified before signing. ```solidity evc.permit( signer, // The user authorizing the action sender, // The relayer or executor nonceNamespace, // For replay protection nonce, // For replay protection deadline, // Expiry timestamp value, // ETH value to forward (usually 0) data, // Encoded calldata (e.g., batch) signature // EIP-712 signature ); ``` -------------------------------- ### Derive a sub-account address in Solidity Source: https://docs.euler.finance/build/evc/integration-guide This function demonstrates how to derive a sub-account address by XOR-ing the owner's address with a uint8 account ID. ```solidity function getAccount(address owner, uint8 accountId) public pure returns (address) { return address(uint160(owner) ^ uint160(accountId)); } // Usage: address myAddress = /* your main address */; address account3 = getAccount(myAddress, 3); // This is your 4th sub-account ``` -------------------------------- ### Deposit to a sub-account Source: https://docs.euler.finance/build/evc/integration-guide Demonstrates depositing tokens from a main address while crediting the resulting shares to a specific sub-account. ```solidity // Deposit tokens from your main address, but credit the shares to subAccount3 IEVC.BatchItem[] memory items = new IEVC.BatchItem[](1); items[0] = IEVC.BatchItem({ targetContract: vault, onBehalfOfAccount: myAddress, // tokens are pulled from here value: 0, data: abi.encodeWithSelector(IVault.deposit.selector, depositAmount, subAccount3) // shares go to sub-account }); connector.batch(items); ``` -------------------------------- ### Resolve AmountCap using EVK library Source: https://docs.euler.finance/curate/vaults/evk/creator-ui Use the AmountCapLib to decode the compact onchain encoding of supply and borrow caps. An encoded value of 0 represents an unlimited cap. ```solidity import {AmountCap, AmountCapLib} from "evk/EVault/shared/types/AmountCap.sol"; uint256 decoded = AmountCapLib.resolve(AmountCap.wrap(encoded)); ``` -------------------------------- ### Enable Permit Disabled Mode Source: https://docs.euler.finance/build/evc/integration-guide Prevents the execution of any permits signed by the owner for the specified address prefix. Use this if a harmful permit message has been signed. ```solidity evc.setPermitDisabledMode(evc.getAddressPrefix(owner), true); ``` -------------------------------- ### Repay debt with shares Source: https://docs.euler.finance/build/evk/interacting-with-vaults Uses repayWithShares to burn shares from the borrow vault to reduce the debt of a specific account. ```solidity (uint256 sharesBurned, uint256 assetsRepaid) = IEVault(borrowVault).repayWithShares( type(uint256).max, debtAccount ); ``` -------------------------------- ### Base URL Source: https://docs.euler.finance/build/data-querying/euler-v3-api The base URL for all public endpoints in the Euler Data API V3. ```bash https://v3.euler.finance/v3 ``` -------------------------------- ### Price response object with source category Source: https://docs.euler.finance/build/data-querying/euler-v3-api Prices are returned as USD numbers with a provider-redacted source category (onchain, offchain, or hardcoded) and timestamp. No confidence field is included. ```json { "data": [ { "chainId": 1, "address": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", "symbol": "wstETH", "decimals": 18, "priceUsd": 2323.31, "source": "offchain", "timestamp": "2026-07-14T16:11:24.895Z" } ] } ``` -------------------------------- ### Docker run without Doppler Source: https://docs.euler.finance/build/euler-lite Runs the container without Doppler by passing required environment variables directly and overriding the default CMD with the Node server entry point. ```bash docker run -p 3000:3000 \ -e V3_API_URL=https://v3.euler.finance \ -e EULER_SDK_V3_API_KEY=your-v3-api-key \ -e SWAP_API_URL=https://swap.euler.finance \ -e APPKIT_PROJECT_ID=your-project-id \ -e RPC_URL_1=https://your-rpc.com \ -e SUBGRAPH_URL_1=https://your-subgraph.com \ euler-lite node .output/server/index.mjs ``` -------------------------------- ### SVG Market Map Flow Animation Source: https://docs.euler.finance/products Defines the SVG circle elements and animateMotion paths used to visualize borrow flows in the market map. ```xml ``` ```xml ``` -------------------------------- ### Batching operations with IEVC.BatchItem Source: https://docs.euler.finance/build/evc/integration-guide Groups multiple actions into a single atomic transaction using the batch function. Requires an array of BatchItem structs specifying the target contract, account, value, and encoded function data. ```solidity IEVC.BatchItem[] memory items = new IEVC.BatchItem[](2); // Example: Deposit collateral and then borrow in a single batch. // Assumes the collateral asset is approved and the collateral/controller // vaults are already enabled for myAccount. items[0] = IEVC.BatchItem({ targetContract: collateralVault, onBehalfOfAccount: myAccount, value: 0, data: abi.encodeWithSelector(IVault.deposit.selector, depositAmount, myAccount) }); items[1] = IEVC.BatchItem({ targetContract: borrowVault, onBehalfOfAccount: myAccount, value: 0, data: abi.encodeWithSelector(IVault.borrow.selector, borrowAmount, myAccount) }); connector.batch(items); ``` -------------------------------- ### Vault share pricing oracle route SVG Source: https://docs.euler.finance/learn/price-oracles Visualizes the route for vault share pricing where shares are converted into the underlying asset value. ```xml eUSDC Share convertToAssets Share -> USDC USDC Unit ``` -------------------------------- ### Calculate ROE with Rewards and Intrinsic Yield Source: https://docs.euler.finance/use/return-on-equity Comprehensive formula for ROE including base lending/borrowing, rewards, and intrinsic yields. ```text base lending = supplied value × base supply APY base borrowing = −borrowed value × base borrow APY supply rewards = supplied value × eligible LEND APR borrow rewards = borrowed value × eligible BORROW or BORROW_COLLATERAL APR loop rewards = equity × eligible LOOPING APR intrinsic = supplied intrinsic yield − borrowed intrinsic yield ROE = included contributions / equity ``` -------------------------------- ### Successful list response envelope with pagination metadata Source: https://docs.euler.finance/build/data-querying/euler-v3-api Standard envelope for successful list responses. Returns a data array with optional pagination metadata including total, limit, offset, and timestamp. ```json { "data": [], "meta": { "total": 100, "limit": 20, "offset": 0, "timestamp": "2026-07-15T12:00:00.000Z" } } ``` -------------------------------- ### EVK Borrow and Supply APY Formulas Source: https://docs.euler.finance/use/annual-percentage-yield Formulas for EVK lending and borrowing rates. Borrow APY is derived from the per-second compounded borrow rate (SPY) scaled by 1e27, annualized over a Gregorian year. Supply APY is borrow APY adjusted by utilization and the interest fee. ```text borrow APY = (1 + borrow SPY)^seconds_per_year − 1 utilization = borrows / (cash + borrows) supply APY = borrow APY × utilization × (1 − interestFee) ``` -------------------------------- ### Calculate Base ROE Source: https://docs.euler.finance/use/return-on-equity The fundamental formula for ROE based on supplied value (S), borrowed value (B), supply APY (r_s), and borrow APY (r_b). ```text equity = S − B ROE = ((S × r_s) − (B × r_b)) / (S − B) ``` -------------------------------- ### Calculate Net APY Source: https://docs.euler.finance/use/return-on-equity Formula for net APY, which is calculated by dividing by the supplied value rather than equity. ```text net APY = ((S × r_s) − (B × r_b)) / S ``` -------------------------------- ### Implement isHookTarget function Source: https://docs.euler.finance/curate/vaults/evk/hooks-custom-logic This function must be implemented by every hook target contract to return the magic selector. It can optionally validate the caller against a recognized EVault factory. ```solidity function isHookTarget() external view returns (bytes4) { if (eVaultFactory.isProxy(msg.sender)) return this.isHookTarget.selector; else return 0; } ``` -------------------------------- ### CrossAdapter route SVG definition Source: https://docs.euler.finance/learn/price-oracles Defines the SVG marker for the CrossAdapter route visualization. ```xml ```