INIT Capital Module
Config
protocol_module
=init-capital
Registry
The available fields in the Token module to use in the infinit.registry.json
are as follows:
Field | Type | Description |
---|---|---|
feeVault | Address | Address of the fee vault. |
proxyAdmin | Address | Address of the proxy admin. |
accessControlManager | Address | Address of the access control manager. |
api3ProxyOracleReaderProxy | Address | Address of the API3 proxy oracle reader proxy. |
initOracleProxy | Address | Address of the init oracle proxy. |
configProxy | Address | Address of the config proxy. |
liqIncentiveCalculatorProxy | Address | Address of the liquidity incentive calculator proxy. |
posManagerProxy | Address | Address of the position manager proxy. |
initCoreProxy | Address | Address of the init core proxy. |
riskManagerProxy | Address | Address of the risk manager proxy. |
lsdApi3ProxyOracleReaderProxy | Address | Address of the LSD API3 proxy oracle reader proxy. |
pythOracleReaderProxy | Address | Address of the Pyth oracle reader proxy. |
moneyMarketHookProxy | Address | Address of the money market hook proxy. |
initLens | Address | Address of the init lens. |
api3ProxyOracleReaderImpl | Address | Address of the API3 proxy oracle reader implementation. |
initOracleImpl | Address | Address of the init oracle implementation. |
configImpl | Address | Address of the config implementation. |
liqIncentiveCalculatorImpl | Address | Address of the liquidity incentive calculator implementation. |
posManagerImpl | Address | Address of the position manager implementation. |
initCoreImpl | Address | Address of the init core implementation. |
riskManagerImpl | Address | Address of the risk manager implementation. |
lsdApi3ProxyOracleReaderImpl | Address | Address of the LSD API3 proxy oracle reader implementation. |
pythOracleReaderImpl | Address | Address of the Pyth oracle reader implementation. |
moneyMarketHookImpl | Address | Address of the money market hook implementation. |
lendingPoolImpl | Address | Address of the lending pool implementation. |
irms | object<string, Address> | Record of interest rate models. |
lendingPools | object<string, [LendingPool](#lending-pool)> | Record of lending pools. |
LendingPool
Field | Type | Description |
---|---|---|
underlyingToken | Address | Address of the underlying token. |
lendingPool | Address | Address of the lending pool. |
irm | Address | Address of the interest rate model. |
Actions
The actions available in the @infinit-xyz/init-capital/actions
are as follows:
import {
DeployInitCapitalAction,
DeployApi3ProxyOracleReaderAction,
DeployDoubleSlopeIRMsAction,
DeployPythOracleReaderAction,
SetApi3ProxyOracleReaderTokensInfoAction,
SetIrmAction,
SetMaxPriceDeviationAction,
SetModeFactorsAction,
SetModeStatusAction,
SetOracleAction,
SetPoolConfigAction,
SetPythOracleReaderTokensInfoAction,
SupportNewPoolsAction,
ChangeIrmAction,
} from '@infinit-xyz/init-capital/actions'
DeployInitCapitalAction
DeployInitCapitalAction
is an action that deploys the INIT Capital protocol.
Parameters
Field | Type | Required | Description |
---|---|---|---|
proxyAdminOwner | Address | Yes | Address of the owner of the proxy admin |
wrappedNativeToken | Address | Yes | Address of the wrapped native token (e.g., WETH) |
posManagerNftName | string | Yes | Name of the position NFT token |
posManagerNftSymbol | string | Yes | Symbol of the position NFT token |
maxCollCount | number | Yes | Maximum number of collateral tokens that can be used in a position |
maxLiqIncentiveMultiplier | BigInt (opens in a new tab) | Yes | Maximum liquidation incentive multiplier |
governor | Address | Yes | Address of the account who will be granted the governor role |
guardian | Address | Yes | Address of the account who will be granted the guardian role |
feeAdmin | Address | Yes | Address of the account who can control the fee vault |
treasury | Address | Yes | Address of the account who receives the fee from the fee vault |
Signers
deployer
: Deployer of the protocol will be assigned as the owner of the proxy admin.accessControlManagerOwner
: Owner of the access control manager.
SupportNewPoolsAction
SupportNewPoolsAction
is an action that add new pools to the protocol.
Parameters
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the pool e.g. Init Wrapped Bitcoin |
symbol | string | Yes | Name of the pool's symbol e.g. inWBTC |
token | Address | Yes | Address of the token e.g. '0x123...abc' |
modeConfigs | Array<ModeConfig> | Yes | Mode configs for adding new mode |
liqIncentiveMultiplierE18 | BigInt | Yes | Liquidation incentive multiplier in E18 for the token |
supplyCap | BigInt | Yes | Lending pool supply cap |
borrowCap | BigInt | Yes | Lending pool borrow cap |
reserveFactor | BigInt | Yes | Lending pool reserve factor |
oracleConfig | OracleConfig | No | Set oracle sources for the token, not required if the token source is already set |
doubleSlopeIRMConfig | DoubleSlopeIRMConfig | Yes | Parameters for the reserve interest rate model |
ModeConfig
Field | Type | Required | Description |
---|---|---|---|
mode | number | Yes | Mode number starting from 0 |
poolConfig | PoolConfig | Yes | Pool config |
config | ModeLiquidationConfig | No | Mode liquidation config, not required if it already set |
PoolConfig
Field | Type | Required | Description |
---|---|---|---|
collFactorE18 | BigInt | Yes | Collateral factor in E18, should be less than 1e18, e.g. parseUnit('0.8', 18) |
borrFactorE18 | BigInt | Yes | Borrow factor in E18, should be greater than 1e18, e.g. parseUnit('1.1', 18) |
debtCeiling | BigInt | Yes | Debt ceiling for the pool in this mode, user could no longer borrow from the pool for this mode if the debt ceiling is reached |
ModeLiquidationConfig
Field | Type | Required | Description |
---|---|---|---|
liqIncentiveMultiplierE18 | BigInt | Yes | Liquidation incentive multiplier in E18 for the mode |
minLiqIncentiveMultiplierE18 | BigInt | Yes | Min liq incentive multiplier e18 |
maxHealthAfterLiqE18 | BigInt | Yes | Max Health after liq in E18, skip the max health validation if set to maxUint64 |
OracleConfig
Field | Type | Required | Description |
---|---|---|---|
primarySource | Address | Yes | Primary source oracle reader config |
secondarySource | Address | No | Secondary source oracle reader config, need to set maxPrivceDeviationE18 if set |
maxPriceDeviationE18 | BigInt | No | Max price deviation between primary and secondary sources in E18, need to set secondarySource if set |
DoubleSlopeIRMConfig
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the reserve interest rate model that will be displayed in the registry |
params.baseBorrowRateE18 | BigInt | Yes | Base borrow rate in E18 (e.g., 10% = 0.1 * 1e18) |
params.jumpUtilizationRateE18 | BigInt | Yes | Utilization rate in E18 where the jump multiplier is applied (e.g., 80% = 0.8 * 1e18) |
params.borrowRateMultiplierE18 | BigInt | Yes | Borrow rate multiplier in E18 (e.g., 1% = 0.01 * 1e18) |
params.jumpRateMultiplierE18 | BigInt | Yes | Jump multiplier rate in E18 (e.g., 1% = 0.01 * 1e18) |
Signers
deployer
: Any account can deploy the INIT Capital protocol.governor
: The governor role account of the protocol.guardian
: The guardian role account of the protocol.
DeployApi3ProxyOracleReaderAction
DeployApi3ProxyOracleReaderAction
is an action that deploys the API3 proxy oracle reader (This action doesn't required any parameters).
Signers
deployer
: Any account can deploy the API3 proxy oracle reader.
DeployDoubleSlopeIRMsAction
DeployDoubleSlopeIRMsAction
is an action that deploys the double slope IRMs for the lending pool to collect the interest on the protocol.
Parameters
Field | Type | Required | Description |
---|---|---|---|
doubleSlopeIRMConfigs | Array<DoubleSlopeIRMConfig> | Yes | Array of double slope IRM configurations. |
DoubleSlopeIRMConfig
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the reserve interest rate model that will be displayed in the registry. |
params.baseBorrowRateE18 | BigInt | Yes | Base borrow rate in E18 (e.g., 10% = 0.1 * 1e18). |
params.jumpUtilizationRateE18 | BigInt | Yes | Utilization rate in E18 where the jump multiplier is applied (e.g., 80% = 0.8 * 1e18). |
params.borrowRateMultiplierE18 | BigInt | Yes | Borrow rate multiplier in E18 (e.g., 1% = 0.01 * 1e18). |
params.jumpRateMultiplierE18 | BigInt | Yes | Jump multiplier rate in E18 (e.g., 1% = 0.01 * 1e18). |
Signers
deployer
: Any account can deploy the double slope IRMs.
DeployPythOracleReaderAction
DeployPythOracleReaderAction
is an action that deploys the Pyth oracle reader.
Parameters
Field | Type | Required | Description |
---|---|---|---|
pyth | Address | Yes | Pyth Oracle address to be used for fetching oracle data. See Pyth Network Documentation (opens in a new tab). |
Signers
deployer
: Any account can deploy the Pyth oracle reader.
SetApi3ProxyOracleReaderTokensInfoAction
SetApi3ProxyOracleReaderTokensInfoAction
is an action that sets the tokens info for the API3 proxy oracle reader.
Parameters
Field | Type | Required | Description |
---|---|---|---|
tokensInfo | Array<TokensInfo> | Yes | Array of token information objects. Each object contains the following fields: |
TokensInfo
Field | Type | Required | Description |
---|---|---|---|
token | Address | Yes | Address of token e.g. '0x123...abc' |
dataFeedProxy | Address | Yes | Address of data feed proxy e.g. '0x123...abc', access https://market.api3.org (opens in a new tab) to find the DataFeedProxy |
maxStaleTime | BigInt | Yes | Max stale time in seconds e.g. 86400n for 1 day |
Signers
governor
: The governor role account of the protocol
SetIrmAction
SetIrmAction
is an action that sets the deployed interest rate model for the lending pool.
Parameters
Field | Type | Required | Description |
---|---|---|---|
pool | Address | Yes | Address of lending pool e.g. '0x123...abc' |
irm | Address | Yes | Address of interest rate model e.g. '0x123...abc' |
Signers
guardian
: The guardian role account of the protocol
SetLsdApi3ProxyOracleReaderTokensInfoAction
SetLsdApi3ProxyOracleReaderTokensInfoAction
is an action that sets the tokens info for the LSD API3 proxy oracle reader.
Parameters
Field | Type | Required | Description |
---|---|---|---|
tokensInfo | Array<[TokensInfo](#lsd-tokens-info)> | Yes | Array of token information objects. Each object contains the following fields: |
TokensInfo
Field | Type | Required | Description |
---|---|---|---|
token | Address | Yes | Address of token e.g. '0x123...abc' |
dataFeedProxy | Address | Yes | Address of data feed proxy e.g. '0x123...abc', access https://market.api3.org (opens in a new tab) to find the DataFeedProxy |
quoteToken | Address | Yes | Address of the quote token e.g. '0x123...abc', where the address is weth for weeth |
maxStaleTime | BigInt | Yes | Max stale time in seconds e.g. 86400n for 1 day |
Signers
governor
: The governor role account of the protocol
SetMaxPriceDeviationAction
SetMaxPriceDeviationAction
is an action that sets the oracle maximum price deviation for the asset in the lending pool.
Parameters
Field | Type | Required | Description |
---|---|---|---|
tokenMaxPriceDeviations | Array<[TokenMaxPriceDeviation](#token-max-price-deviation)> | Yes | Array of token maximum price deviation parameters. Each object contains the following fields: |
TokenMaxPriceDeviation
Field | Type | Required | Description |
---|---|---|---|
token | Address | Yes | Address of the token e.g. '0x123...abc' |
maxPriceDeviation_e18 | BigInt | Yes | Maximum price deviation in E18 (e.g., 10% = 0.1 * 1e18). |
Signers
governor
: The governor role account of the protocol
SetModeFactorsAction
SetModeFactorsAction
is an action that sets the assets collateral/borrow factors of each Mode under the protocol.
Parameters
Field | Type | Required | Description |
---|---|---|---|
mode | number | Yes | Mode number starting from 0 e.g. 1 |
poolFactors | Array<PoolFactor> | Yes | Array of pool factor objects. Each object contains the following fields: |
PoolFactor
Field | Type | Required | Description |
---|---|---|---|
pool | Address | Yes | Address of pool e.g. '0x123...abc' |
collFactor | BigInt | No | Collateral factor in E18 e.g. 11n * 10n ** 17n |
borrFactor | BigInt | No | Borrow factor in E18 e.g. 9n * 10n ** 17n |
Signers
governor
: The governor role account of the protocol
SetModeStatusAction
SetModeStatusAction
is an action that sets the status (collateral/borrow/decollateral/repay) of the Mode under the protocol.
Parameters
SetModeStatusAction
SetModeStatusAction
is an action that sets the status (collateral/borrow/decollateral/repay) of the Mode under the protocol.
Parameters
Field | Type | Required | Description |
---|---|---|---|
config | Address | Yes | Address of the configuration |
mode | number | Yes | Mode number starting from 0 e.g. 1 |
status | Array<ModeStatus> | Yes | Status object containing the following fields: |
ModeStatus
Field | Type | Required | Description |
---|---|---|---|
canCollateralize | boolean | Yes | Whether collateralization is allowed |
canDecollateralize | boolean | Yes | Whether decollateralization is allowed |
canBorrow | boolean | Yes | Whether borrowing is allowed |
canRepay | boolean | Yes | Whether repayment is allowed |
Signers
guardian
: The guardian role account of the protocol
SetOracleAction
SetOracleAction
is an action that sets the oracle for the lending pool.
Parameters
Field | Type | Required | Description |
---|---|---|---|
oracle | Address | Yes | Address of oracle e.g. '0x123...abc' |
Signers
governor
: The governor role account of the protocol
SetPoolConfigAction
SetPoolConfigAction
is an action that sets the configuration for the lending pool including the pool status and caps of the pool.
Parameters
Field | Type | Required | Description |
---|---|---|---|
config | Address | Yes | Address of the configuration |
pool | Address | Yes | Address of the pool |
poolConfig | PoolConfig | Yes | Configuration object containing the following fields: |
PoolConfig
Field | Type | Required | Description |
---|---|---|---|
supplyCap | bigint | Yes | Supply cap for the pool |
borrowCap | bigint | Yes | Borrow cap for the pool |
canMint | boolean | Yes | Whether minting is allowed |
canBurn | boolean | Yes | Whether burning is allowed |
canBorrow | boolean | Yes | Whether borrowing is allowed |
canRepay | boolean | Yes | Whether repayment is allowed |
canFlash | boolean | Yes | Whether flash loans are allowed |
Signers
guardian
: The guardian role account of the protocol
SetPythOracleReaderTokensInfoAction
SetPythOracleReaderTokensInfoAction
is an action that sets the tokens info for the Pyth oracle reader.
Parameters
Field | Type | Required | Description |
---|---|---|---|
tokensInfo | Array<[TokensInfo](#pyth-tokens-info)> | Yes | Array of token information objects. Each object contains the following fields: |
TokensInfo
Field | Type | Required | Description |
---|---|---|---|
token | Address | Yes | Address of token e.g. '0x123...abc' |
priceId | Hex | Yes | Pyth's priceId to use for fetching price check https://www.pyth.network/developers/price-feed-ids (opens in a new tab) |
maxStaleTime | BigInt | Yes | Max stale time in seconds e.g. 86400n for 1 day |
Signers
governor
: The governor role account of the protocol