-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #864 from ionicprotocol/feat/superseed
Feat/superseed
- Loading branch information
Showing
108 changed files
with
41,815 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Chain, createPublicClient, fallback, http, PublicClientConfig } from "viem"; | ||
|
||
export function createIonicPublicClient(chain: Chain, rpcUrls: string[]) { | ||
const config: PublicClientConfig = { | ||
chain, | ||
transport: fallback(rpcUrls.map((url) => http(url))), | ||
batch: { multicall: { wait: 16 } }, | ||
cacheTime: 4_000, | ||
pollingInterval: 4_000, | ||
}; | ||
|
||
return createPublicClient(config); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { assetSymbols, ChainAddresses, underlying } from "@ionicprotocol/types"; | ||
import { zeroAddress } from "viem"; | ||
|
||
import { assets } from "./assets"; | ||
|
||
const chainAddresses: ChainAddresses = { | ||
PAIR_INIT_HASH: "", // TODO is this used anywhere? | ||
STABLE_TOKEN: zeroAddress, | ||
UNISWAP_V2_ROUTER: zeroAddress, | ||
UNISWAP_V2_FACTORY: zeroAddress, | ||
UNISWAP_V3: { | ||
FACTORY: zeroAddress, | ||
PAIR_INIT_HASH: "", | ||
QUOTER_V2: zeroAddress // unused | ||
}, | ||
UNISWAP_V3_ROUTER: zeroAddress, // universal router, need to check if this works | ||
W_BTC_TOKEN: zeroAddress, // underlying(assets, assetSymbols.WBTC), | ||
W_TOKEN: underlying(assets, assetSymbols.WETH), | ||
W_TOKEN_USD_CHAINLINK_PRICE_FEED: zeroAddress | ||
}; | ||
|
||
export default chainAddresses; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { assetSymbols, OracleTypes, SupportedAsset, SupportedChains } from "@ionicprotocol/types"; | ||
import { parseEther } from "viem"; | ||
|
||
import { wrappedAssetDocs } from "../common"; | ||
|
||
export const WETH = "0x4200000000000000000000000000000000000006"; | ||
|
||
export const assets: SupportedAsset[] = [ | ||
{ | ||
symbol: assetSymbols.WETH, | ||
underlying: WETH, | ||
name: "Wrapped Ether", | ||
decimals: 18, | ||
oracle: OracleTypes.FixedNativePriceOracle, | ||
extraDocs: wrappedAssetDocs(SupportedChains.superseed), | ||
initialBorrowCap: parseEther("100").toString(), | ||
initialSupplyCap: parseEther("100").toString(), | ||
initialCf: "0.5" | ||
} | ||
]; | ||
|
||
export default assets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { FundingStrategy } from "@ionicprotocol/types"; | ||
|
||
const fundingStrategies: FundingStrategy[] = []; | ||
|
||
export default fundingStrategies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ChainConfig, SupportedChains } from "@ionicprotocol/types"; | ||
|
||
import deployments from "../../../sdk/deployments/superseed.json"; | ||
|
||
import chainAddresses from "./addresses"; | ||
import { assets } from "./assets"; | ||
import fundingStrategies from "./fundingStrategies"; | ||
import irms from "./irms"; | ||
import leveragePairs from "./leveragePairs"; | ||
import liquidationDefaults from "./liquidation"; | ||
import oracles from "./oracles"; | ||
import specificParams from "./params"; | ||
import deployedPlugins from "./plugins"; | ||
import redemptionStrategies from "./redemptionStrategies"; | ||
|
||
const chainConfig: ChainConfig = { | ||
chainId: SupportedChains.superseed, | ||
chainAddresses, | ||
assets, | ||
irms, | ||
liquidationDefaults, | ||
oracles, | ||
specificParams, | ||
deployedPlugins, | ||
redemptionStrategies, | ||
fundingStrategies, | ||
chainDeployments: deployments.contracts, | ||
leveragePairs | ||
}; | ||
|
||
export default chainConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IrmTypes } from "@ionicprotocol/types"; | ||
|
||
const baseIrms = [IrmTypes.JumpRateModel]; | ||
|
||
const irms: IrmTypes[] = [...baseIrms]; | ||
|
||
export default irms; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LeveragePoolConfig } from "@ionicprotocol/types"; | ||
|
||
const leveragePairs: LeveragePoolConfig[] = []; | ||
|
||
export default leveragePairs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { LiquidationDefaults, LiquidationStrategy } from "@ionicprotocol/types"; | ||
import { zeroAddress } from "viem"; | ||
|
||
import chainAddresses from "./addresses"; | ||
import { WETH } from "./assets"; | ||
|
||
const liquidationDefaults: LiquidationDefaults = { | ||
DEFAULT_ROUTER: chainAddresses.UNISWAP_V2_ROUTER, | ||
ASSET_SPECIFIC_ROUTER: {}, | ||
SUPPORTED_OUTPUT_CURRENCIES: [zeroAddress, WETH], | ||
SUPPORTED_INPUT_CURRENCIES: [zeroAddress, WETH], | ||
LIQUIDATION_STRATEGY: LiquidationStrategy.UNISWAP, | ||
MINIMUM_PROFIT_NATIVE: 0n, | ||
LIQUIDATION_INTERVAL_SECONDS: 20, | ||
jarvisPools: [], | ||
balancerPools: [] | ||
}; | ||
|
||
export default liquidationDefaults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { OracleTypes } from "@ionicprotocol/types"; | ||
|
||
const baseOracles = [OracleTypes.FixedNativePriceOracle, OracleTypes.MasterPriceOracle, OracleTypes.SimplePriceOracle]; | ||
|
||
const oracles: OracleTypes[] = [...baseOracles]; | ||
|
||
export default oracles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { assetSymbols, ChainParams } from "@ionicprotocol/types"; | ||
import { Address } from "viem"; | ||
|
||
import chainAddresses from "./addresses"; | ||
|
||
const specificParams: ChainParams = { | ||
blocksPerYear: BigInt(30 * 60 * 24 * 365), // 30 blocks per minute = 2 sec block time | ||
cgId: "ethereum", | ||
metadata: { | ||
chainIdHex: "0x14d2", | ||
name: "Superseed", | ||
shortName: "Superseed", | ||
uniswapV3Fees: {}, | ||
img: "https://raw.githubusercontent.com/superseed-xyz/brand-kit/227ecaadf8da2ad9acb208428ff178a2cd345565/logos-wordmarks/logos/small-black.svg", | ||
blockExplorerUrls: { default: { name: "superseed", url: "https://explorer-superseed-mainnet-0.t.conduit.xyz" } }, | ||
rpcUrls: { | ||
default: { | ||
http: ["https://mainnet.superseed.xyz"] | ||
}, | ||
public: { | ||
http: ["https://mainnet.superseed.xyz"] | ||
} | ||
}, | ||
nativeCurrency: { | ||
symbol: "ETH", | ||
name: "ETH" | ||
}, | ||
wrappedNativeCurrency: { | ||
symbol: assetSymbols.WETH, | ||
address: chainAddresses.W_TOKEN as Address, | ||
name: "WETH", | ||
decimals: 18, | ||
color: "#7A88A1", | ||
overlayTextColor: "#fff", | ||
logoURL: "https://d1912tcoux65lj.cloudfront.net/network/ethereum.png" | ||
} | ||
} | ||
}; | ||
|
||
export default specificParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { DeployedPlugins } from "@ionicprotocol/types"; | ||
|
||
const deployedPlugins: DeployedPlugins = {}; | ||
|
||
export default deployedPlugins; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RedemptionStrategy } from "@ionicprotocol/types"; | ||
|
||
const redemptionStrategies: RedemptionStrategy[] = []; | ||
|
||
export default redemptionStrategies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.