Skip to main content

CurveFinanceTask

Fetch pricing information from Curve Finance pools.

Input: None

Returns: The current price/exchange rate from the specified Curve pool.

Example: Fetch the price from a Curve pool on Ethereum

{
"curveFinanceTask": {
"chain": "CHAIN_ETHEREUM",
"poolAddress": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"outDecimals": 18
}
}

Example: Fetch the price using a custom RPC provider

{
"curveFinanceTask": {
"chain": "CHAIN_ETHEREUM",
"provider": "https://eth-mainnet.g.alchemy.com/v2/YOUR-API-KEY",
"poolAddress": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
"outDecimals": 18
}
}


Fields

NameTypeDescription
 chain

Required. Specifies which blockchain to use when reading information from Curve Finance.

 outDecimals

uint32

The number of decimal places to include in the returned price value.

 poolAddress

string

The on-chain address of the Curve Finance pool to fetch pricing data from.

 provider

string

Optional. The RPC endpoint to use for blockchain requests. If not specified, a default RPC will be used which may have rate limits.

Enums

 Chain

ValueNameDescription
 0CHAIN_ETHEREUM

Use the Ethereum blockchain for fetching Curve Finance data