Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit ac13aeb

Browse files
committed
fix: cf
1 parent e4993dc commit ac13aeb

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

chains/base/assets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const assets: SupportedAsset[] = [
110110
aggregator: "0xFC1415403EbB0c693f9a7844b92aD2Ff24775C65",
111111
feedBaseCurrency: ChainlinkFeedBaseCurrency.ETH
112112
},
113-
initialCf: "70"
113+
initialCf: "0.70"
114114
},
115115
{
116116
symbol: assetSymbols.eUSD,
@@ -124,7 +124,7 @@ export const assets: SupportedAsset[] = [
124124
} as ChainlinkSpecificParams,
125125
initialSupplyCap: parseEther(String(10_000_000)).toString(),
126126
initialBorrowCap: parseEther(String(8_000_000)).toString(),
127-
initialCf: "80"
127+
initialCf: "0.80"
128128
},
129129
{
130130
symbol: assetSymbols.bsdETH,
@@ -138,7 +138,7 @@ export const assets: SupportedAsset[] = [
138138
},
139139
initialSupplyCap: parseEther(String(6_500)).toString(),
140140
initialBorrowCap: parseEther(String(5_200)).toString(),
141-
initialCf: "70"
141+
initialCf: "0.70"
142142
},
143143
{
144144
symbol: assetSymbols.ION,

tasks/chain-specific/base.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
import { task } from "hardhat/config";
22
import { Address, parseEther, zeroAddress } from "viem";
3+
import { assets as baseAssets } from "../../chains/base/assets";
4+
5+
task("market:set-cf:base:main", "Sets caps on a market").setAction(async (_, { viem, run }) => {
6+
const COMPTROLLER = "0x05c9C6417F246600f8f5f49fcA9Ee991bfF73D13";
7+
for (const asset of baseAssets) {
8+
const pool = await viem.getContractAt("IonicComptroller", COMPTROLLER);
9+
const cToken = await pool.read.cTokensByUnderlying([asset.underlying]);
10+
console.log("cToken: ", cToken, asset.symbol);
11+
12+
if (asset.initialCf) {
13+
await run("market:set:ltv", {
14+
marketAddress: cToken,
15+
ltv: asset.initialCf
16+
});
17+
}
18+
}
19+
});
320

421
task("market:base:rsr-ion-rewards", "Sets caps on a market").setAction(
522
async (_, { viem, run, deployments, getNamedAccounts }) => {

0 commit comments

Comments
 (0)