compound_compatible_lending_pool_risk_parameters_for_company
Schema: lib_risk_models
Description
This function returns Compound-compatible lending pool risk parameters for the given company. Optionally, provide the parameter_name to only return values for the matching risk parameter.
The term "Compound-compatible lending pool risk parameters" refers to parameters that need to be set to run a lending protocol based on the contracts used by Compound. These parameters include:
collateralFactor
: This is like a loan-to-value (LTV) ratio. It tells you the maximum percentage of a deposited asset you can borrow against. For example, if the collateral factor for ETH is 75%, you can borrow up to $75 worth of another asset for every $100 of ETH you deposit.reserveFactor
: This is a fee on borrowing. It's a percentage of the interest paid by borrowers that gets taken out and put into the pool's reserves. This reserve acts like a safety net for the pool in case of loan defaults or unexpected events.borrowCap
: This is an optional limit set on how much of a particular asset can be borrowed in total. It helps the pool manage risk by preventing excessive borrowing of a single asset. A borrow cap ensure that not too much of an asset is borrowed so that there is liquidity if any of the lenders wanted to pull out of the pool
Usage
Signature
lib_risk_models.compound_compatible_lending_pool_risk_parameters_for_company(
company text,
risk_parameter_name text
)
Parameters
Name | Type | Description |
---|---|---|
company | text | Filter to only risk parameters for the specified company (e.g. Hover ) |
risk_parameter_name | text | (Optional) Filter to a specific risk parameter (e.g. collateralFactor ) |
Results
This function returns a table with the following columns:
Column Name | Type | Description |
---|---|---|
id | integer | The unique identifier for the risk parameter |
data_time | timestamptz | The timestamp of the latest lending data used to generate the parameter |
chain | text | The blockchain associated with the risk parameter |
parameter_name | text | The name of the risk parameter |
protocol | text | The protocol associated with the risk parameter |
underlying_contract | text | The address of the underlying contract |
lending_pool_contract | text | The address of the lending pool contract |
val | numeric | The value of the risk parameter |
safe_range | numeric | The safe range for the risk parameter |
updated_time | timestamptz | The timestamp for when the risk parameter was last updated |
lending_pool_symbol | text | The symbol of the lending pool |
underlying_symbol | text | The symbol of the underlying asset |
is_synthetic | boolean | Indicates if the risk parameter is for a synthetic asset |
Examples
Get all risk parameters for a specific company
select * from lib_risk_models.compound_compatible_lending_pool_risk_parameters_for_company('company_name');
Get collateral factor for a specific company
select * from lib_risk_models.compound_compatible_lending_pool_risk_parameters_for_company('company_name', 'collateralFactor');