# Chain Configuration and Addresses

Being the interface to a cross-chain protocol, the `IonicSdk` 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.:

```typescript
import { IonicSdk } from '@ionicprotocol/sdk';
import { ethers } from "ethers";

const chainId = 56;  // for BSC mainnet
const provider = new ethers.providers.JsonRpcProvider('<YOUR-ENDPOINT-HERE>')

const sdk = new IonicSdk(provider, chainId);

console.log(sdk.oracles)
>>> ["FixedNativePriceOracle", "MasterPriceOracle", "ChainlinkPriceOracleV2", "CurveLpTokenPriceOracleNoRegistry", "UniswapLpTokenPriceOracle", "UniswapTwapPriceOracleV2"]
```

Here's an overview of the available properties of `MidasSdk`:

```typescript
IonicSdk.provider         // the passed in provider
IonicSdk.chainId          // the passed in chain id 
IonicSdk.supportedAssets
IonicSdk.chainDeployment
IonicSdk.contracts 
IonicSdk.artifacts
IonicSdk.irms
IonicSdk.availableIrms
IonicSdk.oracles
IonicSdk.availableOracles
IonicSdk.chainSpecificAddresses
IonicSdk.chainSpecificParams
IonicSdk.deployedPlugins
```

### `IonicSdk.supportedAssets`

**Type:** Array of [`SupportedAsset`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#supportedasset)

Returns an array of the supported assets for Ionic Protocol given a specific chain.

E.g.:

```typescript
console.log(sdk.supportedAssets)
>>> 
[
  {
    symbol: 'WBNB',
    underlying: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
    name: 'Wrapped Binance Network Token',
    decimals: 18,
    oracle: 'FixedNativePriceOracle'
  },
  {
    symbol: 'BUSD',
    underlying: '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56',
    name: 'Binance USD',
    decimals: 18,
    oracle: 'ChainlinkPriceOracleV2'
  },
  {
    symbol: 'BTCB',
    underlying: '0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c',
    name: 'Binance BTC',
    decimals: 18,
    oracle: 'ChainlinkPriceOracleV2'
  },
  ...
```

### `IonicSdk.irms`

**Type:** [`IrmConfig`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#chaindeployment-oracleconfig-irmconfig)

Returns an object mapping IRM contract names to their deployment specification, i.e., its address and ABI.

### `IonicSdk.availableIrms`

**Type:** `Array<`[`IrmTypes`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#irmtypes)`>`

Returns an array of the supported IRMs for a specific chain.

### `IonicSdk.oracles`

**Type:** [`OracleConfig`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#chaindeployment-oracleconfig-irmconfig)

Returns an object mapping oracle contract names to their deployment specification, i.e., its address and ABI.

### `IonicSdk.availableOracles`

**Type:** `Array<`[`OracleTypes`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#oracletypes)`>`

Returns an array of the supported Oracles for a specific chain

### `IonicSdk.chainSpecificAddresses`

**Type:** [`ChainAddresses`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#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.

### `IonicSdk.chainSpecificParams`

**Type:** [`ChainParams`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#chainparams)

A few chain-specific parameters, such as the Blocks Per Year and the coingecko ID for the chain's native token.

### `IonicSdk.deployedPlugins`

**Type**: [**`DeployedPlugins`**](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#deployedplugins)

Object containing the address, names, and strategies for the ERC4626 plugins deployed in a specific chain.

### `IonicSdk.contracts`

Set of already instantiated [`ethers.Contract`](https://docs.ethers.io/v5/api/contract/contract/#Contract) for the core Ionic 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 protocol
* `FusePoolDirectory`: a registry contract in charge of keeping track of deployed pools
* `FusePoolLens`: introspection module for querying Ionic Pool's data at different levels of aggregation
* `FusePoolLensSecondary`: secondary introspection module, in charge of querying a specific pool's information
* `FuseSafeLiquidator`: the contract in charge of performing the liquidations on Fuse Pools

### `IonicSdk.artifacts`

**Type:** object containing as keys the Contract Name, and as object an [`Artifact`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#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:

```
const assetContract = new Contract(
    assetAddress, 
    this.artifacts.CTokenInterface.abi, 
    this.provider
);
```

### `IonicSdk.chainDeployment`

**Type:** [`ChainDeployment`](/developers/ionic-sdk/api-reference-typing-and-interfaces.md#chaindeployment)

Returns all the contract ABIs and addresses for the Ionic Protocol's deployment in a given chain.

E.g.:

```typescript
console.log(sdk.chainDeployment.Comptroller)
>>> 
{
  address: '0x713B66c31833FF5E70123701a7368A2d28ea6485',
  abi: [
    {
      inputs: [Array],
      stateMutability: 'nonpayable',
      type: 'constructor'
    },
    {
      anonymous: false,
      inputs: [Array],
      name: 'ActionPaused',
      type: 'event'
    },
     ...
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionic.money/developers/ionic-sdk/chain-configuration-and-addresses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
