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

Commit 8822c69

Browse files
committed
feat: lev pairs
1 parent 2aed06e commit 8822c69

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

chains/base/leveragePairs.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
import { Address } from "viem";
12
import { LeveragePoolConfig } from "../types";
23

3-
const leveragePairs: LeveragePoolConfig[] = [];
4+
const collaterals: Address[] = [
5+
"0x079f84161642D81aaFb67966123C9949F9284bf5", // ionezETH
6+
"0x9D62e30c6cB7964C99314DCf5F847e36Fcb29ca9", // ionwstETH
7+
"0x9c201024A62466F9157b2dAaDda9326207ADDd29", // ioncbETH
8+
"0x014e08F05ac11BB532BE62774A4C548368f59779", // ionAERO
9+
"0xa900A17a49Bc4D442bA7F72c39FA2108865671f0", // ionUSDC
10+
"0x9c2A4f9c5471fd36bE3BBd8437A33935107215A1", // ionEUSD
11+
"0x49420311B518f3d0c94e897592014de53831cfA3", // ionWETH
12+
"0x84341B650598002d427570298564d6701733c805", // ionweETH
13+
"0x3D9669DE9E3E98DB41A1CbF6dC23446109945E3C" // ionbsdETH
14+
];
15+
const borrows: Address[] = [
16+
"0xa900A17a49Bc4D442bA7F72c39FA2108865671f0", // ionUSDC
17+
"0x49420311B518f3d0c94e897592014de53831cfA3", // ionWETH
18+
"0x9c2A4f9c5471fd36bE3BBd8437A33935107215A1" // ionEUSD
19+
];
20+
21+
const leveragePairs: LeveragePoolConfig[] = [
22+
{
23+
pool: "Main" as Address,
24+
pairs: collaterals.flatMap((collateral) => borrows.map((borrow) => ({ collateral, borrow })))
25+
}
26+
];
427

528
export default leveragePairs;

tasks/leverage/configurePair.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { task } from "hardhat/config";
22
import { chainIdToConfig } from "../../chains";
33
import { Address, encodeFunctionData } from "viem";
4-
import { addTransaction, writeTransactionsToFile } from "../../chainDeploy/helpers/logging";
4+
import { addTransaction } from "../../chainDeploy/helpers/logging";
55

66
export default task("levered-positions:configure-pairs").setAction(
77
async ({}, { viem, getChainId, deployments, getNamedAccounts }) => {
88
const { deployer } = await getNamedAccounts();
99
console.log("deployer: ", deployer);
1010
const publicClient = await viem.getPublicClient();
11-
const walletClient = await viem.getWalletClient(deployer as Address);
1211
const chainId = parseInt(await getChainId());
1312
const leveredPairsConfig = chainIdToConfig[chainId].leveragePairs;
1413

@@ -66,15 +65,13 @@ export default task("levered-positions:configure-pairs").setAction(
6665
});
6766
} else {
6867
const tx = await factory.write._setPairWhitelisted([collateral, borrow, true]);
69-
await publicClient.waitForTransactionReceipt({ hash: tx });
68+
await publicClient.waitForTransactionReceipt({ hash: tx, confirmations: 2 });
7069
console.log(
71-
`configured the markets pair:\n - BORROW (market: ${borrow}, underlying: ${borrowToken})\n - COLLATERAL: (market: ${collateral}, underlying: ${collateralToken}) as whitelisted for levered positions`
70+
`configured the markets pair:\n - BORROW (market: ${borrow}, underlying: ${borrowToken})\n - COLLATERAL: (market: ${collateral}, underlying: ${collateralToken}) as whitelisted for levered positions: ${tx}`
7271
);
7372
}
7473
}
7574
}
7675
}
77-
78-
await writeTransactionsToFile();
7976
}
8077
);

0 commit comments

Comments
 (0)