Structs
Copy struct ProtocolBalance {
ProtocolMetadata metadata;
AdapterBalance [] adapterBalances;
}
struct ProtocolMetadata {
string name;
string description;
string websiteURL;
string iconURL;
uint256 version;
}
struct AdapterBalance {
AdapterMetadata metadata;
FullTokenBalance [] balances;
}
// Adapter type may be "Asset" or "Debt"
struct AdapterMetadata {
address adapterAddress;
string adapterType;
}
// Base token and its underlying tokens (if exist) balances
struct FullTokenBalance {
TokenBalance base;
TokenBalance [] underlying;
}
struct TokenBalance {
TokenMetadata metadata;
uint256 amount;
}
// ERC20-style token metadata
// 0xEeee...EEeE address is used for ETH
struct TokenMetadata {
address token;
string name;
string symbol;
uint8 decimals;
}
view
functions
getBalances
Copy function getBalances (address account) returns (ProtocolBalance[])
Iterates over all the supported protocols, their adapters and supported tokens and appends balances.
NOTE! Filters out zero balances, adapters, and protocols without positive balances.
getProtocolBalances
Copy function getProtocolBalances (address account , string[] protocolNames) returns (ProtocolBalance[])
Iterates over the protocolNames
, their adapters and supported tokens and appends balances.
NOTE! Filters out zero balances, adapters, and protocols without positive balances.
getAdapterBalances
Copy function getAdapterBalances (address account , address[] adapters) returns (AdapterBalance[])
Iterates over adapters
and their tokens and appends balances.
NOTE! Filters out zero balances and adapters without positive balances.
getAdapterBalance
Copy function getAdapterBalance (address account , address adapter , address[] tokens) returns (AdapterBalance)
Iterates over tokens
and appends balances.
NOTE! Filters out zero balances.
getFullTokenBalance
Copy function getFullTokenBalance (string tokenType , address token) returns (FullTokenBalance)
Returns the representation of the token's full share (1e18) in the underlying tokens. This function will show the real underlying tokens (e.g. cDAI and cUSDC for Curve Compound pool).
getFinalFullTokenBalance
Copy function getFinalFullTokenBalance (string tokenType , address token) returns (FullTokenBalance)
Returns the representation of the token's full share (1e18) in the underlying tokens. This function will try to recover the "deepest" underlying tokens (e.g. DAI and USDC for Curve Compound pool).
getProtocolNames
Copy function getProtocolNames () returns (string[])
Returns list of protocols' names.
getProtocolMetadata
Copy function getProtocolMetadata (string protocolName) returns (ProtocolMetadata)
Returns name, description, websiteURL, iconURL and version of the protocol.
getProtocolAdapters
Copy function getProtocolAdapters (string protocolName) returns (address[])
Returns adapters addresses.
getSupportedTokens
Copy function getSupportedTokens (address adapter) returns (address[])
Returns adapter's supported tokens.
isValidProtocol
Copy function isValidProtocol (string protocolName) returns (bool)
Returns true
if protocol name is listed in the registry and false
otherwise.
getTokenAdapterNames
Copy function getTokenAdapterNames () returns (string[])
Returns list of token adapters' names.
getTokenAdapter
Copy function getTokenAdapter (string tokenAdapterName) returns (address)
Returns token adapter address.
isValidTokenAdapter
Copy function isValidTokenAdapter (string tokenAdapterName) returns (bool)
Returns true
if token adapter name is listed in the registry and false
otherwise.
onlyOwner
functions
Copy function addProtocols (string[] protocolNames , ProtocolMetadata[] metadata , address[][] adapters , address[][][] tokens)
Copy function removeProtocols (string[] protocolNames)
Copy function updateProtocolMetadata (string protocolName , string name , string description , string websiteURL , string iconURL)
Increases protocol version by 1.
Copy function addProtocolAdapters (string protocolName , address[] adapters , address[][] tokens)
Increases protocol version by 1.
Copy function removeProtocolAdapters (string protocolName , uint256[] adapterIndices)
Increases protocol version by 1.
Copy function updateProtocolAdapter (string protocolName , uint256 index , address newAdapterAddress , address[] newSupportedTokens)
Increases protocol version by 1.
Copy function addTokenAdapters (string[] tokenAdapterNames , address[] adapters)
Copy function removeTokenAdapters (string[] tokenAdapterNames)
Copy function updateTokenAdapter (string tokenAdapterName , address adapter)