Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
Expand Down
14 changes: 14 additions & 0 deletions packages/bots/pyth-updater/src/config/superseed.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { PythAssetConfig } from '../types';

import { pythConfig as commonPythConfig } from './common';

export const pythConfig: PythAssetConfig[] = [
...commonPythConfig,
{
// price feed for oUSDT
priceId: '0x2dc7f272d3010abe4de48755a50fcf5bd9eefd3b4af01d8f39f6c80ae51544fe',
configRefreshRateInSeconds: 3600,
validTimePeriodSeconds: 86400, // 24 hrs
deviationThresholdBps: 100, // 1%
},
];
2 changes: 1 addition & 1 deletion packages/chains/src/superseed/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { assets } from "./assets";

const chainAddresses: ChainAddresses = {
PAIR_INIT_HASH: "", // TODO is this used anywhere?
STABLE_TOKEN: zeroAddress,
STABLE_TOKEN: underlying(assets, assetSymbols.USDC),
UNISWAP_V2_ROUTER: zeroAddress,
UNISWAP_V2_FACTORY: zeroAddress,
UNISWAP_V3: {
Expand Down
34 changes: 32 additions & 2 deletions packages/chains/src/superseed/assets.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { assetSymbols, OracleTypes, SupportedAsset, SupportedChains } from "@ionicprotocol/types";
import { parseEther } from "viem";
import { assetSymbols, OracleTypes, PythSpecificParams, SupportedAsset, SupportedChains } from "@ionicprotocol/types";
import { parseEther, parseUnits } from "viem";

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

export const WETH = "0x4200000000000000000000000000000000000006";
export const USDC = "0xc316c8252b5f2176d0135ebb0999e99296998f2e";
export const oUSDT = "0x1217bfe6c773eec6cc4a38b5dc45b92292b6e189";

export const assets: SupportedAsset[] = [
{
Expand All @@ -16,6 +18,34 @@ export const assets: SupportedAsset[] = [
initialBorrowCap: parseEther("100").toString(),
initialSupplyCap: parseEther("100").toString(),
initialCf: "0.5"
},
{
symbol: assetSymbols.USDC,
underlying: USDC,
name: "USD Coin",
decimals: 6,
oracle: OracleTypes.PythPriceOracle,
oracleSpecificParams: {
feed: "0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a"
} as PythSpecificParams,
extraDocs: wrappedAssetDocs(SupportedChains.superseed),
initialBorrowCap: parseUnits("20000", 6).toString(),
initialSupplyCap: parseUnits("40000", 6).toString(),
initialCf: "0.5"
},
{
symbol: assetSymbols.oUSDT,
underlying: oUSDT,
name: "OpenUSDT",
decimals: 6,
oracle: OracleTypes.PythPriceOracle,
oracleSpecificParams: {
feed: "0x2dc7f272d3010abe4de48755a50fcf5bd9eefd3b4af01d8f39f6c80ae51544fe"
} as PythSpecificParams,
extraDocs: wrappedAssetDocs(SupportedChains.superseed),
initialBorrowCap: parseUnits("20000", 6).toString(),
initialSupplyCap: parseUnits("40000", 6).toString(),
initialCf: "0.5"
}
];

Expand Down
33 changes: 30 additions & 3 deletions packages/contracts/chainDeploy/mainnets/superseed.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { superseed } from "@ionicprotocol/chains";

import { ChainDeployConfig } from "../helpers";
import { Address } from "viem";
import { ChainDeployConfig, deployPythPriceOracle } from "../helpers";
import { Address, zeroAddress } from "viem";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { OracleTypes, PythSpecificParams } from "@ionicprotocol/types";
import { PythAsset } from "../types";

const PYTH_ADDRESS = "0x2880aB155794e7179c9eE2e38200202908C17B43";
const PYTH_ETH_USD_FEED = "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace";

const assets = superseed.assets;

Expand All @@ -23,7 +28,9 @@ export const deployConfig: ChainDeployConfig = {
uniswapV3Quoter: superseed.chainAddresses.UNISWAP_V3?.QUOTER_V2 as Address
},
wtoken: superseed.chainAddresses.W_TOKEN as Address,
nativeTokenUsdChainlinkFeed: superseed.chainAddresses.W_TOKEN_USD_CHAINLINK_PRICE_FEED as Address
nativeTokenUsdChainlinkFeed: superseed.chainAddresses.W_TOKEN_USD_CHAINLINK_PRICE_FEED as Address,
ION: zeroAddress,
veION: {} as any
};

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

const pythAssets: PythAsset[] = assets
.filter((asset) => asset.oracle === OracleTypes.PythPriceOracle)
.map((asset) => ({
underlying: asset.underlying,
feed: (asset.oracleSpecificParams as PythSpecificParams).feed as Address
}));

await deployPythPriceOracle({
chainId: superseed.chainId,
viem,
getNamedAccounts,
deployments,
run,
pythAddress: PYTH_ADDRESS,
usdToken: superseed.chainAddresses.STABLE_TOKEN as Address,
pythAssets,
deployConfig,
nativeTokenUsdFeed: PYTH_ETH_USD_FEED
});

//// Uniswap V3 Liquidator Funder
const uniswapV3LiquidatorFunder = await deployments.deploy("UniswapV3LiquidatorFunder", {
from: deployer,
Expand Down
Loading
Loading