♾️ INFINIT CLI Alpha release is now available!
API References
@infinit-xyz/init-capital

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:

FieldTypeDescription
feeVaultAddressAddress of the fee vault.
proxyAdminAddressAddress of the proxy admin.
accessControlManagerAddressAddress of the access control manager.
api3ProxyOracleReaderProxyAddressAddress of the API3 proxy oracle reader proxy.
initOracleProxyAddressAddress of the init oracle proxy.
configProxyAddressAddress of the config proxy.
liqIncentiveCalculatorProxyAddressAddress of the liquidity incentive calculator proxy.
posManagerProxyAddressAddress of the position manager proxy.
initCoreProxyAddressAddress of the init core proxy.
riskManagerProxyAddressAddress of the risk manager proxy.
lsdApi3ProxyOracleReaderProxyAddressAddress of the LSD API3 proxy oracle reader proxy.
pythOracleReaderProxyAddressAddress of the Pyth oracle reader proxy.
moneyMarketHookProxyAddressAddress of the money market hook proxy.
initLensAddressAddress of the init lens.
api3ProxyOracleReaderImplAddressAddress of the API3 proxy oracle reader implementation.
initOracleImplAddressAddress of the init oracle implementation.
configImplAddressAddress of the config implementation.
liqIncentiveCalculatorImplAddressAddress of the liquidity incentive calculator implementation.
posManagerImplAddressAddress of the position manager implementation.
initCoreImplAddressAddress of the init core implementation.
riskManagerImplAddressAddress of the risk manager implementation.
lsdApi3ProxyOracleReaderImplAddressAddress of the LSD API3 proxy oracle reader implementation.
pythOracleReaderImplAddressAddress of the Pyth oracle reader implementation.
moneyMarketHookImplAddressAddress of the money market hook implementation.
lendingPoolImplAddressAddress of the lending pool implementation.
irmsobject<string, Address>Record of interest rate models.
lendingPoolsobject<string, [LendingPool](#lending-pool)>Record of lending pools.

LendingPool

FieldTypeDescription
underlyingTokenAddressAddress of the underlying token.
lendingPoolAddressAddress of the lending pool.
irmAddressAddress 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

FieldTypeRequiredDescription
proxyAdminOwnerAddressYesAddress of the owner of the proxy admin
wrappedNativeTokenAddressYesAddress of the wrapped native token (e.g., WETH)
posManagerNftNamestringYesName of the position NFT token
posManagerNftSymbolstringYesSymbol of the position NFT token
maxCollCountnumberYesMaximum number of collateral tokens that can be used in a position
maxLiqIncentiveMultiplierBigInt (opens in a new tab)YesMaximum liquidation incentive multiplier
governorAddressYesAddress of the account who will be granted the governor role
guardianAddressYesAddress of the account who will be granted the guardian role
feeAdminAddressYesAddress of the account who can control the fee vault
treasuryAddressYesAddress 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

FieldTypeRequiredDescription
namestringYesName of the pool e.g. Init Wrapped Bitcoin
symbolstringYesName of the pool's symbol e.g. inWBTC
tokenAddressYesAddress of the token e.g. '0x123...abc'
modeConfigsArray<ModeConfig>YesMode configs for adding new mode
liqIncentiveMultiplierE18BigIntYesLiquidation incentive multiplier in E18 for the token
supplyCapBigIntYesLending pool supply cap
borrowCapBigIntYesLending pool borrow cap
reserveFactorBigIntYesLending pool reserve factor
oracleConfigOracleConfigNoSet oracle sources for the token, not required if the token source is already set
doubleSlopeIRMConfigDoubleSlopeIRMConfigYesParameters for the reserve interest rate model

ModeConfig

FieldTypeRequiredDescription
modenumberYesMode number starting from 0
poolConfigPoolConfigYesPool config
configModeLiquidationConfigNoMode liquidation config, not required if it already set

PoolConfig

FieldTypeRequiredDescription
collFactorE18BigIntYesCollateral factor in E18, should be less than 1e18, e.g. parseUnit('0.8', 18)
borrFactorE18BigIntYesBorrow factor in E18, should be greater than 1e18, e.g. parseUnit('1.1', 18)
debtCeilingBigIntYesDebt 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

FieldTypeRequiredDescription
liqIncentiveMultiplierE18BigIntYesLiquidation incentive multiplier in E18 for the mode
minLiqIncentiveMultiplierE18BigIntYesMin liq incentive multiplier e18
maxHealthAfterLiqE18BigIntYesMax Health after liq in E18, skip the max health validation if set to maxUint64

OracleConfig

FieldTypeRequiredDescription
primarySourceAddressYesPrimary source oracle reader config
secondarySourceAddressNoSecondary source oracle reader config, need to set maxPrivceDeviationE18 if set
maxPriceDeviationE18BigIntNoMax price deviation between primary and secondary sources in E18, need to set secondarySource if set

DoubleSlopeIRMConfig

FieldTypeRequiredDescription
namestringYesName of the reserve interest rate model that will be displayed in the registry
params.baseBorrowRateE18BigIntYesBase borrow rate in E18 (e.g., 10% = 0.1 * 1e18)
params.jumpUtilizationRateE18BigIntYesUtilization rate in E18 where the jump multiplier is applied (e.g., 80% = 0.8 * 1e18)
params.borrowRateMultiplierE18BigIntYesBorrow rate multiplier in E18 (e.g., 1% = 0.01 * 1e18)
params.jumpRateMultiplierE18BigIntYesJump 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

FieldTypeRequiredDescription
doubleSlopeIRMConfigsArray<DoubleSlopeIRMConfig>YesArray of double slope IRM configurations.

DoubleSlopeIRMConfig

FieldTypeRequiredDescription
namestringYesName of the reserve interest rate model that will be displayed in the registry.
params.baseBorrowRateE18BigIntYesBase borrow rate in E18 (e.g., 10% = 0.1 * 1e18).
params.jumpUtilizationRateE18BigIntYesUtilization rate in E18 where the jump multiplier is applied (e.g., 80% = 0.8 * 1e18).
params.borrowRateMultiplierE18BigIntYesBorrow rate multiplier in E18 (e.g., 1% = 0.01 * 1e18).
params.jumpRateMultiplierE18BigIntYesJump 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

FieldTypeRequiredDescription
pythAddressYesPyth 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

FieldTypeRequiredDescription
tokensInfoArray<TokensInfo>YesArray of token information objects. Each object contains the following fields:

TokensInfo

FieldTypeRequiredDescription
tokenAddressYesAddress of token e.g. '0x123...abc'
dataFeedProxyAddressYesAddress of data feed proxy e.g. '0x123...abc', access https://market.api3.org (opens in a new tab) to find the DataFeedProxy
maxStaleTimeBigIntYesMax 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

FieldTypeRequiredDescription
poolAddressYesAddress of lending pool e.g. '0x123...abc'
irmAddressYesAddress 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

FieldTypeRequiredDescription
tokensInfoArray<[TokensInfo](#lsd-tokens-info)>YesArray of token information objects. Each object contains the following fields:

TokensInfo

FieldTypeRequiredDescription
tokenAddressYesAddress of token e.g. '0x123...abc'
dataFeedProxyAddressYesAddress of data feed proxy e.g. '0x123...abc', access https://market.api3.org (opens in a new tab) to find the DataFeedProxy
quoteTokenAddressYesAddress of the quote token e.g. '0x123...abc', where the address is weth for weeth
maxStaleTimeBigIntYesMax 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

FieldTypeRequiredDescription
tokenMaxPriceDeviationsArray<[TokenMaxPriceDeviation](#token-max-price-deviation)>YesArray of token maximum price deviation parameters. Each object contains the following fields:

TokenMaxPriceDeviation

FieldTypeRequiredDescription
tokenAddressYesAddress of the token e.g. '0x123...abc'
maxPriceDeviation_e18BigIntYesMaximum 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

FieldTypeRequiredDescription
modenumberYesMode number starting from 0 e.g. 1
poolFactorsArray<PoolFactor>YesArray of pool factor objects. Each object contains the following fields:

PoolFactor

FieldTypeRequiredDescription
poolAddressYesAddress of pool e.g. '0x123...abc'
collFactorBigIntNoCollateral factor in E18 e.g. 11n * 10n ** 17n
borrFactorBigIntNoBorrow 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

FieldTypeRequiredDescription
configAddressYesAddress of the configuration
modenumberYesMode number starting from 0 e.g. 1
statusArray<ModeStatus>YesStatus object containing the following fields:

ModeStatus

FieldTypeRequiredDescription
canCollateralizebooleanYesWhether collateralization is allowed
canDecollateralizebooleanYesWhether decollateralization is allowed
canBorrowbooleanYesWhether borrowing is allowed
canRepaybooleanYesWhether 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

FieldTypeRequiredDescription
oracleAddressYesAddress 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

FieldTypeRequiredDescription
configAddressYesAddress of the configuration
poolAddressYesAddress of the pool
poolConfigPoolConfigYesConfiguration object containing the following fields:

PoolConfig

FieldTypeRequiredDescription
supplyCapbigintYesSupply cap for the pool
borrowCapbigintYesBorrow cap for the pool
canMintbooleanYesWhether minting is allowed
canBurnbooleanYesWhether burning is allowed
canBorrowbooleanYesWhether borrowing is allowed
canRepaybooleanYesWhether repayment is allowed
canFlashbooleanYesWhether 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

FieldTypeRequiredDescription
tokensInfoArray<[TokensInfo](#pyth-tokens-info)>YesArray of token information objects. Each object contains the following fields:

TokensInfo

FieldTypeRequiredDescription
tokenAddressYesAddress of token e.g. '0x123...abc'
priceIdHexYesPyth's priceId to use for fetching price check https://www.pyth.network/developers/price-feed-ids (opens in a new tab)
maxStaleTimeBigIntYesMax stale time in seconds e.g. 86400n for 1 day

Signers

  • governor: The governor role account of the protocol