Chain Configuration and Addresses
Access all the addresses, contract interfaces, and chain configurations
Being the interface to a cross-chain protocol, the MidasSdk
is configured to seamlessly work across chains, and allows developers to introspect each chain's available infrastructure, as well as the deployed contracts in that chain.
These values are directly available via the instantiated SDK, for the selected chain with which the SDK is instantiated.
E.g.:
Here's an overview of the available properties of MidasSdk
:
MidasSdk.supportedAssets
MidasSdk.supportedAssets
Type: Array of SupportedAsset
Returns an array of the supported assets for Midas Protocol given a specific chain.
E.g.:
MidasSdk.irms
MidasSdk.irms
Type: IrmConfig
Returns an object mapping IRM contract names to their deployment specification, i.e., its address and ABI.
MidasSdk.availableIrms
MidasSdk.availableIrms
Type: Array<
IrmTypes
>
Returns an array of the supported IRMs for a specific chain.
MidasSdk.oracles
MidasSdk.oracles
Type: OracleConfig
Returns an object mapping oracle contract names to their deployment specification, i.e., its address and ABI.
MidasSdk.availableOracles
MidasSdk.availableOracles
Type: Array<
OracleTypes
>
Returns an array of the supported Oracles for a specific chain
MidasSdk.chainSpecificAddresses
MidasSdk.chainSpecificAddresses
Type: ChainAddresses
This object contains a set of addresses for infra specific to this chain. The chain's Native Wrapped Token address, and the main Uniswap-like router and factory addresses are amongst them. Widely used within the SDK.
MidasSdk.chainSpecificParams
MidasSdk.chainSpecificParams
Type: ChainParams
A few chain-specific parameters, such as the Blocks Per Year and the coingecko ID for the chain's native token.
MidasSdk.deployedPlugins
MidasSdk.deployedPlugins
Type: DeployedPlugins
Object containing the address, names, and strategies for the ERC4626 plugins deployed in a specific chain.
MidasSdk.contracts
MidasSdk.contracts
Set of already instantiated ethers.Contract
for the core Midas Protocol contracts that are widely used across the SDK. The functionality of these contracts is mostly wrapped by other SDK functions, so these are unlikely to be widely used by developers. They are given however as instantiated contracts for ease of access from the SDK's codebase.
Type: [contractName: string]: ethers.Contract]
The main contracts are the following:
FuseFeeDistributor
: the "admin" contract, in charge of collecting protocol fees, and of performing admin functionality over the protocolFusePoolDirectory
: a registry contract in charge of keeping track of deployed poolsFusePoolLens
: introspection module for querying Midas Pool's data at different levels of aggregationFusePoolLensSecondary
: secondary introspection module, in charge of querying a specific pool's informationFuseSafeLiquidator
: the contract in charge of performing the liquidations on Fuse Pools
MidasSdk.artifacts
MidasSdk.artifacts
Type: object containing as keys the Contract Name, and as object an Artifact
type. Once more, this is provided as a shorthand for other SDK functions.
E.g, to instantiate a cToken as an ethers.Contract
, the following code is used:
MidasSdk.chainDeployment
MidasSdk.chainDeployment
Type: ChainDeployment
Returns all the contract ABIs and addresses for the Midas Protocol's deployment in a given chain.
E.g.:
Last updated