Curvance
  • Protocol Overview
    • Click Less, Earn More
    • Protocol Architecture
    • Asset Types
    • Liquidity Markets
      • Borrowing
      • Liquidations
      • Interest Rates
      • Oracles
      • Collateral Caps
      • Bad Debt Socialization
    • Application Specific Sequencing
    • New Age Liquidity Mining
      • Protocols
    • How Are New Assets Integrated
    • Plugin System
    • Universal Account Balance
    • Token Approval Management
    • Lending Risks
  • Security
    • Security and Audits
  • Miscellaneous
    • RPCs and Testnet Stability
    • Glossary
    • TL;DR
      • Customer Types and Benefits
    • Brand Assets
    • Weblinks
    • Disclaimer
    • Frequently Asked Questions
  • Developer Docs
    • Overview
    • Quick Start Guides
      • Atlas Fastlane Auctions (coming soon)
      • Plugin Integration
        • List of Delegable Actions
      • Loans & Collateral
        • Lend Assets
        • Deposit into pTokens
        • Withdraw Loans
        • Withdraw pTokens
      • Borrowing & Repayment
        • Borrow
        • Repaying Debt
      • Leverage
        • Leveraging
        • Deleveraging
    • Lending Protocol
      • Market Manager
      • Position Tokens (pToken)
      • Earn Tokens (eTokens)
      • Dynamic Interest Rate Model
      • Universal Balance
    • Position Management
      • Leverage
      • Deleverage / Fold
    • Dynamic Liquidation Engine (DLE)
      • Orderflow Auction System
      • Bad Debt Socialization
    • Plugin & Delegation System
      • Transfer Lock Mechanism
      • Delegable Actions
    • Cross-Chain Functionality
      • Messaging Hub
      • Fee Manager
      • Reward Manager
    • Auxiliary Functionality
Powered by GitBook
On this page
  • Overview
  • User Interaction Functions
  • Chain-Wide Functions
  • Token-Specific Functions
  • Oracle Manager Functions
  • Market-Specific Functions
  • Token-Specific Data Functions
Export as PDF
  1. Developer Docs

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:

function getTotalTVL() public view returns (uint256 result)

Return data:

Type
Description

uint256

The current TVL inside Curvance, in WAD (18 decimals)


getTotalCollateralTVL()

Description: Returns the current collateral TVL across all Curvance markets.

Function signature:

function getTotalCollateralTVL() public view returns (uint256 result)

Return data:

Type
Description

uint256

The current collateral TVL inside Curvance, in WAD (18 decimals)


getTotalLendingTVL()

Description: Returns the current lending TVL across all Curvance markets.

Function signature:

function getTotalLendingTVL() public view returns (uint256 result)

Return data:

Type
Description

uint256

The current lending TVL inside Curvance, in WAD (18 decimals)


getTotalBorrows()

Description: Returns the current outstanding borrows across all Curvance markets.

Function signature:

function getTotalBorrows() public view returns (uint256 result)

Return data:

Type
Description

uint256

The current outstanding borrows inside Curvance, in WAD (18 decimals)


getMarketManagers()

Description: Returns all registered market managers from the Central Registry.

Function signature:

function getMarketManagers() public view returns (address[] memory)

Return data:

Type
Description

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:

function getAccountTokenData(
    address account, 
    address token) public view 
    returns (bool hasPosition, 
            uint256 balanceOf, 
            uint256 collateralOrDebtAmount)
Type
Name
Description

address

account

The address of the account to check token data of

address

token

The address of the market token

Return data:

Type
Description

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:

function getAccountDebtData(
    address account, 
    address token) public view returns (uint256)
Type
Name
Description

address

account

The address whose debt balance should be calculated

address

token

The eToken address to check debt for

Return data:

Type
Description

uint256

The account's cached debt balance for the token


getUtilizationRate()

Description: Calculates the current utilization rate for an eToken.

Function signature:

function getUtilizationRate(address eToken) public view returns (uint256)
Type
Name
Description

address

eToken

The earning token to pull interest rate data for

Return data:

Type
Description

uint256

The utilization rate, in WAD (18 decimals)


getBorrowRatePerYear()

Description: Returns the current borrow interest rate per year for an eToken.

Function signature:

function getBorrowRatePerYear(address eToken) public view returns (uint256)
Type
Name
Description

address

eToken

The earning token to pull interest rate data for

Return data:

Type
Description

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:

function getPredictedBorrowRatePerYear(address eToken) public view returns (uint256)
Type
Name
Description

address

eToken

The earning token to pull interest rate data for

Return data:

Type
Description

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:

function getSupplyRatePerYear(address eToken) public view returns (uint256)
Type
Name
Description

address

eToken

The earning token to pull interest rate data for

Return data:

Type
Description

uint256

The supply interest rate per year, in WAD (18 decimals)


getBaseRewards()

Description: Returns the base rewards for a token.

Function signature:

function getBaseRewards(address token) public view returns (uint256)
Type
Name
Description

address

token

The token address to check rewards for

Return data:

Type
Description

uint256

The base rewards for the token



Oracle Manager Functions

getPrices()

Description: Returns price information for multiple assets.

Function signature:

function getPrices(
    address[] calldata assets, 
    bool[] calldata inUSD, 
    bool[] calldata getLower) public view 
    returns (uint256[] memory, uint256[] memory)
Type
Name
Description

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:

Type
Description

uint256[]

Array of asset prices

uint256[]

Array of timestamp information for the prices


hasRewards()

Description: Checks if a user has unclaimed rewards.

Function signature:

function hasRewards(address user) public view returns (bool)
Type
Name
Description

address

user

The user address to check for rewards

Return data:

Type
Description

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:

function getAllMarketData(address account) public view returns (AllMarketData[] memory)
Type
Name
Description

address

account

The account to get market data for

Return data:

Type
Description

AllMarketData[]

Array of AllMarketData structs containing market data for all markets


getMarketData()

Description: Returns detailed data for a specific market.

Function signature:

function getMarketData(
    address market, 
    address account) public view 
    returns (MarketData memory result)
Type
Name
Description

address

market

The market to get data for

address

account

The account to get market data for

Return data:

Type
Description

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:

function getMarketAssetData(
    address market, 
    address account) public view 
    returns (MarketETokenData[] memory, MarketPTokenData[] memory)
Type
Name
Description

address

market

The market to get asset data for

address

account

The account to get asset data for

Return data:

Type
Description

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:

function flaggedForLiquidation(
    address market, 
    address account, 
    address eToken, 
    address pToken) external view returns (bool)
Type
Name
Description

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:

Type
Description

bool

Whether the account can be liquidated currently


getMarketTVL()

Description: Returns the current TVL inside a Curvance market.

Function signature:

function getMarketTVL(address market) public view returns (uint256 result)
Type
Name
Description

address

market

The market to query TVL for

Return data:

Type
Description

uint256

The current TVL inside the market, in WAD (18 decimals)


getMarketCollateralTVL()

Description: Returns the current collateral TVL inside a Curvance market.

Function signature:

function getMarketCollateralTVL(address market) public view returns (uint256 result)
Type
Name
Description

address

market

The market to query collateral TVL for

Return data:

Type
Description

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:

function getMarketCollateralPostedByUsd(address market) public view 
    returns (uint256 result)
Type
Name
Description

address

market

The market to query collateral USD value for

Return data:

Type
Description

uint256

The USD value of collateral posted in the market


getMarketLendingTVL()

Description: Returns the current lending TVL inside a Curvance market.

Function signature:

function getMarketLendingTVL(address market) public view returns (uint256 result)
Type
Name
Description

address

market

The market to query lending TVL for

Return data:

Type
Description

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:

function getMarketBorrows(address market) public view returns (uint256 result)
Type
Name
Description

address

market

The market to query outstanding borrows for

Return data:

Type
Description

uint256

The current outstanding borrows inside the market, in WAD (18 decimals)


getMarketCollateralAssets()

Description: Returns listed collateral assets inside a market.

Function signature:

function getMarketCollateralAssets(address market) public view 
    returns (address[] memory)
Type
Name
Description

address

market

The market to query collateral assets for

Return data:

Type
Description

address[]

Array of collateral asset addresses in the market


getMarketDebtAssets()

Description: Returns listed debt assets inside a market.

Function signature:

function getMarketDebtAssets(address market) public view returns (address[] memory)
Type
Name
Description

address

market

The market to query debt assets for

Return data:

Type
Description

address[]

Array of debt asset addresses in the market


getMarketAssets()

Description: Returns all listed market assets inside a market.

Function signature:

function getMarketAssets(address market) public view returns (address[] memory)
Type
Name
Description

address

market

The market to query assets for

Return data:

Type
Description

address[]

Array of all asset addresses in the market


Token-Specific Data Functions

getTokenTVL()

Description: Returns the current TVL inside an MToken token.

Function signature:

function getTokenTVL(address token, bool getLower) public view returns (uint256 result)
Type
Name
Description

address

token

The token to query TVL for

bool

getLower

Whether to get the lower price for TVL calculation

Return data:

Type
Description

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:

function getTokenBorrows(address token) public view returns (uint256 result)
Type
Name
Description

address

token

The token to query outstanding borrows for

Return data:

Type
Description

uint256

The outstanding underlying tokens, in WAD (18 decimals)


getTokenPrice()

Description: Returns the price of a token.

Function signature:

function getTokenPrice(address token) public view returns (uint256)
Type
Name
Description

address

token

The token to get the price for

Return data:

Type
Description

uint256

The token price

PreviousReward Manager

Last updated 14 days ago