Skip to content

Commit 3a7353b

Browse files
authored
Merge pull request #1084 from ionicprotocol/development
merge
2 parents 77e6ca3 + 1dc75f0 commit 3a7353b

43 files changed

Lines changed: 12921 additions & 1090 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/package-sdk-pull-request-build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v4
3232

33-
- uses: actions/setup-node@v2
33+
- uses: actions/setup-node@v4
3434
with:
3535
node-version: 20
3636
cache: 'yarn'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { PythAssetConfig } from '../types';
2+
3+
import { pythConfig as commonPythConfig } from './common';
4+
5+
export const pythConfig: PythAssetConfig[] = [
6+
...commonPythConfig,
7+
{
8+
// price feed for oUSDT
9+
priceId: '0x2dc7f272d3010abe4de48755a50fcf5bd9eefd3b4af01d8f39f6c80ae51544fe',
10+
configRefreshRateInSeconds: 3600,
11+
validTimePeriodSeconds: 86400, // 24 hrs
12+
deviationThresholdBps: 100, // 1%
13+
},
14+
];

packages/chains/src/superseed/addresses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { assets } from "./assets";
55

66
const chainAddresses: ChainAddresses = {
77
PAIR_INIT_HASH: "", // TODO is this used anywhere?
8-
STABLE_TOKEN: zeroAddress,
8+
STABLE_TOKEN: underlying(assets, assetSymbols.USDC),
99
UNISWAP_V2_ROUTER: zeroAddress,
1010
UNISWAP_V2_FACTORY: zeroAddress,
1111
UNISWAP_V3: {

packages/chains/src/superseed/assets.ts

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
import { assetSymbols, OracleTypes, SupportedAsset, SupportedChains } from "@ionicprotocol/types";
2-
import { parseEther } from "viem";
1+
import { assetSymbols, OracleTypes, PythSpecificParams, SupportedAsset, SupportedChains } from "@ionicprotocol/types";
2+
import { parseEther, parseUnits } from "viem";
33

44
import { wrappedAssetDocs } from "../common";
55

66
export const WETH = "0x4200000000000000000000000000000000000006";
7+
export const USDC = "0xc316c8252b5f2176d0135ebb0999e99296998f2e";
8+
export const oUSDT = "0x1217bfe6c773eec6cc4a38b5dc45b92292b6e189";
79

810
export const assets: SupportedAsset[] = [
911
{
@@ -16,6 +18,34 @@ export const assets: SupportedAsset[] = [
1618
initialBorrowCap: parseEther("100").toString(),
1719
initialSupplyCap: parseEther("100").toString(),
1820
initialCf: "0.5"
21+
},
22+
{
23+
symbol: assetSymbols.USDC,
24+
underlying: USDC,
25+
name: "USD Coin",
26+
decimals: 6,
27+
oracle: OracleTypes.PythPriceOracle,
28+
oracleSpecificParams: {
29+
feed: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a"
30+
} as PythSpecificParams,
31+
extraDocs: wrappedAssetDocs(SupportedChains.superseed),
32+
initialBorrowCap: parseUnits("20000", 6).toString(),
33+
initialSupplyCap: parseUnits("40000", 6).toString(),
34+
initialCf: "0.5"
35+
},
36+
{
37+
symbol: assetSymbols.oUSDT,
38+
underlying: oUSDT,
39+
name: "OpenUSDT",
40+
decimals: 6,
41+
oracle: OracleTypes.PythPriceOracle,
42+
oracleSpecificParams: {
43+
feed: "0x2dc7f272d3010abe4de48755a50fcf5bd9eefd3b4af01d8f39f6c80ae51544fe"
44+
} as PythSpecificParams,
45+
extraDocs: wrappedAssetDocs(SupportedChains.superseed),
46+
initialBorrowCap: parseUnits("20000", 6).toString(),
47+
initialSupplyCap: parseUnits("40000", 6).toString(),
48+
initialCf: "0.5"
1949
}
2050
];
2151

packages/contracts/chainDeploy/mainnets/lisk.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export const deploy = async ({
6868
deployments,
6969
deployConfig,
7070
assets: lisk.assets,
71-
chainlinkAssets
71+
chainlinkAssets,
72+
chainId: lisk.chainId
7273
});
7374

7475
const ion = assets.find((asset) => asset.symbol === assetSymbols.ION)?.underlying;
@@ -89,4 +90,15 @@ export const deploy = async ({
8990
waitConfirmations: 1
9091
});
9192
console.log("UniswapV3LiquidatorFunder: ", uniswapV3LiquidatorFunder.address);
93+
94+
const uniswapLpTokenPriceOracle = await deployments.get("UniswapLpTokenPriceOracle");
95+
for (const lpToken of deployConfig.veION.lpTokens) {
96+
await addUnderlyingsToMpo(
97+
mpo as any,
98+
[lpToken],
99+
uniswapLpTokenPriceOracle.address as Address,
100+
deployer,
101+
publicClient
102+
);
103+
}
92104
};

packages/contracts/chainDeploy/mainnets/superseed.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { superseed } from "@ionicprotocol/chains";
22

3-
import { ChainDeployConfig } from "../helpers";
4-
import { Address } from "viem";
3+
import { ChainDeployConfig, deployPythPriceOracle } from "../helpers";
4+
import { Address, zeroAddress } from "viem";
55
import { HardhatRuntimeEnvironment } from "hardhat/types";
6+
import { OracleTypes, PythSpecificParams } from "@ionicprotocol/types";
7+
import { PythAsset } from "../types";
8+
9+
const PYTH_ADDRESS = "0x2880aB155794e7179c9eE2e38200202908C17B43";
10+
const PYTH_ETH_USD_FEED = "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace";
611

712
const assets = superseed.assets;
813

@@ -23,7 +28,9 @@ export const deployConfig: ChainDeployConfig = {
2328
uniswapV3Quoter: superseed.chainAddresses.UNISWAP_V3?.QUOTER_V2 as Address
2429
},
2530
wtoken: superseed.chainAddresses.W_TOKEN as Address,
26-
nativeTokenUsdChainlinkFeed: superseed.chainAddresses.W_TOKEN_USD_CHAINLINK_PRICE_FEED as Address
31+
nativeTokenUsdChainlinkFeed: superseed.chainAddresses.W_TOKEN_USD_CHAINLINK_PRICE_FEED as Address,
32+
ION: zeroAddress,
33+
veION: {} as any
2734
};
2835

2936
export const deploy = async ({
@@ -35,6 +42,26 @@ export const deploy = async ({
3542
const { deployer } = await getNamedAccounts();
3643
const publicClient = await viem.getPublicClient();
3744

45+
const pythAssets: PythAsset[] = assets
46+
.filter((asset) => asset.oracle === OracleTypes.PythPriceOracle)
47+
.map((asset) => ({
48+
underlying: asset.underlying,
49+
feed: (asset.oracleSpecificParams as PythSpecificParams).feed as Address
50+
}));
51+
52+
await deployPythPriceOracle({
53+
chainId: superseed.chainId,
54+
viem,
55+
getNamedAccounts,
56+
deployments,
57+
run,
58+
pythAddress: PYTH_ADDRESS,
59+
usdToken: superseed.chainAddresses.STABLE_TOKEN as Address,
60+
pythAssets,
61+
deployConfig,
62+
nativeTokenUsdFeed: PYTH_ETH_USD_FEED
63+
});
64+
3865
//// Uniswap V3 Liquidator Funder
3966
const uniswapV3LiquidatorFunder = await deployments.deploy("UniswapV3LiquidatorFunder", {
4067
from: deployer,

packages/contracts/deploy/05-deploy-flywheel.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ const func: DeployFunction = async ({ run, viem, getNamedAccounts, deployments,
3232
await publicClient.waitForTransactionReceipt({ hash: booster.transactionHash as Address });
3333
console.log("LooplessFlywheelBooster: ", booster.address);
3434
if (booster.newlyDeployed) await run("flywheels:booster:update");
35+
36+
const ibooster = await deployments.deploy(`IonicFlywheelBorrowBooster_ION`, {
37+
contract: "IonicFlywheelBorrowBooster",
38+
from: deployer,
39+
log: true,
40+
args: [],
41+
waitConfirmations: 1
42+
});
43+
if (ibooster.transactionHash)
44+
await publicClient.waitForTransactionReceipt({ hash: ibooster.transactionHash as Address });
45+
console.log("IonicFlywheelBorrowBooster_ION: ", ibooster.address);
3546
};
3647

3748
func.tags = ["prod", "deploy-flywheel"];

packages/contracts/deployments/lisk/IonicFlywheelBorrowBooster_ION.json

Lines changed: 122 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)