Auxiliary Functionality
Overview
CurvanceAuxiliaryData is an auxiliary contract designed for querying comprehensive data from the Curvance ecosystem. It serves as an all-in-one interface for data aggregators and frontends to efficiently retrieve protocol information with minimal RPC calls. By consolidating multiple variable fetches into single view functions, it significantly reduces the number of EVM instances needed to perform desired queries. The contract contains no active storage values (beyond configuration) and consists entirely of view functions, making it seamlessly upgradeable to support new data formats or query requirements.
User Interaction Functions
Chain-Wide Functions
getTotalTVL()
Description: Returns the current Total Value Locked (TVL) across all Curvance markets.
Function signature:
Return data:
uint256
The current TVL inside Curvance, in WAD (18 decimals)
getTotalCollateralTVL()
Description: Returns the current collateral TVL across all Curvance markets.
Function signature:
Return data:
uint256
The current collateral TVL inside Curvance, in WAD (18 decimals)
getTotalLendingTVL()
Description: Returns the current lending TVL across all Curvance markets.
Function signature:
Return data:
uint256
The current lending TVL inside Curvance, in WAD (18 decimals)
getTotalBorrows()
Description: Returns the current outstanding borrows across all Curvance markets.
Function signature:
Return data:
uint256
The current outstanding borrows inside Curvance, in WAD (18 decimals)
getMarketManagers()
Description: Returns all registered market managers from the Central Registry.
Function signature:
Return data:
address[]
Array of market manager addresses registered in Curvance
Token-Specific Functions
getAccountTokenData()
Description: Returns if an account has an active position in a token, along with balances and collateral posted.
Function signature:
address
account
The address of the account to check token data of
address
token
The address of the market token
Return data:
bool
Whether the account has an active position in the token
uint256
The balance of the token that the account holds
uint256
The amount of collateral posted or debt owed by the account
getAccountDebtData()
Description: Returns the debt balance of an account based on stored data.
Function signature:
address
account
The address whose debt balance should be calculated
address
token
The eToken address to check debt for
Return data:
uint256
The account's cached debt balance for the token
getUtilizationRate()
Description: Calculates the current utilization rate for an eToken.
Function signature:
address
eToken
The earning token to pull interest rate data for
Return data:
uint256
The utilization rate, in WAD (18 decimals)
getBorrowRatePerYear()
Description: Returns the current borrow interest rate per year for an eToken.
Function signature:
address
eToken
The earning token to pull interest rate data for
Return data:
uint256
The borrow interest rate per year, in WAD (18 decimals)
getPredictedBorrowRatePerYear()
Description: Returns predicted upcoming borrow interest rate per year for an eToken.
Function signature:
address
eToken
The earning token to pull interest rate data for
Return data:
uint256
The predicted borrow interest rate per year, in WAD (18 decimals)
getSupplyRatePerYear()
Description: Returns the current supply interest rate per year for an eToken.
Function signature:
address
eToken
The earning token to pull interest rate data for
Return data:
uint256
The supply interest rate per year, in WAD (18 decimals)
getBaseRewards()
Description: Returns the base rewards for a token.
Function signature:
address
token
The token address to check rewards for
Return data:
uint256
The base rewards for the token
getCVERewards()
Description: Returns the CVE rewards for a token.
Function signature:
address
token
The token address to check CVE rewards for
Return data:
uint256
The CVE rewards for the token
Oracle Manager Functions
getPrices()
Description: Returns price information for multiple assets.
Function signature:
address[]
assets
Array of asset addresses to get prices for
bool[]
inUSD
Boolean array indicating whether to return prices in USD
bool[]
getLower
Boolean array indicating whether to get the lower price
Return data:
uint256[]
Array of asset prices
uint256[]
Array of timestamp information for the prices
hasRewards()
Description: Checks if a user has unclaimed rewards.
Function signature:
address
user
The user address to check for rewards
Return data:
bool
Whether the user has rewards to claim
Market-Specific Functions
getAllMarketData()
Description: Returns comprehensive data for all markets including market information, eToken data, and pToken data.
Function signature:
address
account
The account to get market data for
Return data:
AllMarketData[]
Array of AllMarketData structs containing market data for all markets
getMarketData()
Description: Returns detailed data for a specific market.
Function signature:
address
market
The market to get data for
address
account
The account to get market data for
Return data:
MarketData
A struct containing market data including TVL, collateral, lending, borrows, and user position
getMarketAssetData()
Description: Returns detailed asset data for a specific market, including eToken and pToken information.
Function signature:
address
market
The market to get asset data for
address
account
The account to get asset data for
Return data:
MarketETokenData[]
Array of eToken data for the market
MarketPTokenData[]
Array of pToken data for the market
flaggedForLiquidation()
Description: Determines whether an account can currently be liquidated in a market for specific eToken and pToken.
Function signature:
address
market
The market to check for liquidation flag
address
account
The account to check for liquidation flag
address
eToken
The eToken to be repaid during potential liquidation
address
pToken
The pToken to be seized during potential liquidation
Return data:
bool
Whether the account can be liquidated currently
getMarketTVL()
Description: Returns the current TVL inside a Curvance market.
Function signature:
address
market
The market to query TVL for
Return data:
uint256
The current TVL inside the market, in WAD (18 decimals)
getMarketCollateralTVL()
Description: Returns the current collateral TVL inside a Curvance market.
Function signature:
address
market
The market to query collateral TVL for
Return data:
uint256
The current collateral TVL inside the market, in WAD (18 decimals)
getMarketCollateralPostedByUsd()
Description: Returns the USD value of collateral posted in a market.
Function signature:
address
market
The market to query collateral USD value for
Return data:
uint256
The USD value of collateral posted in the market
getMarketLendingTVL()
Description: Returns the current lending TVL inside a Curvance market.
Function signature:
address
market
The market to query lending TVL for
Return data:
uint256
The current lending TVL inside the market, in WAD (18 decimals)
getMarketBorrows()
Description: Returns the current outstanding borrows inside a Curvance market.
Function signature:
address
market
The market to query outstanding borrows for
Return data:
uint256
The current outstanding borrows inside the market, in WAD (18 decimals)
getMarketCollateralAssets()
Description: Returns listed collateral assets inside a market.
Function signature:
address
market
The market to query collateral assets for
Return data:
address[]
Array of collateral asset addresses in the market
getMarketDebtAssets()
Description: Returns listed debt assets inside a market.
Function signature:
address
market
The market to query debt assets for
Return data:
address[]
Array of debt asset addresses in the market
getMarketAssets()
Description: Returns all listed market assets inside a market.
Function signature:
address
market
The market to query assets for
Return data:
address[]
Array of all asset addresses in the market
Account-Specific Functions
getUserLocks()
Description: Returns information about a user's veCVE locks.
Function signature:
address
account
The account to query lock data for
Return data:
uint256[]
Array of lock amounts
uint256[]
Array of lock end timestamps
getUserLockLength()
Description: Returns the number of veCVE locks a user has.
Function signature:
address
account
The account to query lock count for
Return data:
uint256
The number of locks the user has
getUserLockIndexExists()
Description: Checks if a specific lock index exists for a user.
Function signature:
address
account
The account to check
uint256
lockIndex
The index of the lock to check
Return data:
bool
Whether the specified lock index exists for the user
Token-Specific Data Functions
getTokenTVL()
Description: Returns the current TVL inside an MToken token.
Function signature:
address
token
The token to query TVL for
bool
getLower
Whether to get the lower price for TVL calculation
Return data:
uint256
The current TVL inside the token, in WAD (18 decimals)
getTokenBorrows()
Description: Returns the outstanding underlying tokens borrowed from an EToken market.
Function signature:
address
token
The token to query outstanding borrows for
Return data:
uint256
The outstanding underlying tokens, in WAD (18 decimals)
getTokenPrice()
Description: Returns the price of a token.
Function signature:
address
token
The token to get the price for
Return data:
uint256
The token price
Last updated