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

Commit 564f131

Browse files
committed
feat: add bob
1 parent d8009fe commit 564f131

File tree

68 files changed

+59525
-1
lines changed

Some content is hidden

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

68 files changed

+59525
-1
lines changed

chains/assets.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ export enum assetSymbols {
1414
bsdETH = "bsdETH",
1515
SNX = "SNX",
1616
OP = "OP",
17-
LUSD = "LUSD"
17+
LUSD = "LUSD",
18+
SOV = "SOV",
19+
tBTC = "tBTC"
1820
}

chains/bob/addresses.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Address } from "viem";
2+
import { underlying } from "../../chainDeploy/helpers/utils";
3+
import { assetSymbols } from "../assets";
4+
import { ChainAddresses } from "../types";
5+
import { assets } from "./assets";
6+
7+
const chainAddresses: ChainAddresses = {
8+
UNISWAP_V2_FACTORY: "" as Address,
9+
UNISWAP_V2_ROUTER: "" as Address,
10+
STABLE_TOKEN: underlying(assets, assetSymbols.USDC),
11+
UNISWAP_V3: {
12+
FACTORY: "0x8c7d3063579BdB0b90997e18A770eaE32E1eBb08",
13+
QUOTER_V2: "0x33531bDBFE34fa6Fd5963D0423f7699775AacaaF"
14+
},
15+
UNISWAP_V3_ROUTER: "0x3EF68D3f7664b2805D4E88381b64868a56f88bC4",
16+
W_BTC_TOKEN: underlying(assets, assetSymbols.WBTC),
17+
W_TOKEN: underlying(assets, assetSymbols.WETH),
18+
W_TOKEN_USD_CHAINLINK_PRICE_FEED: "0x97CB85Eb5F892Dd02866672EAB137b3C34501b7b"
19+
};
20+
21+
export default chainAddresses;

chains/bob/assets.ts

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import { parseEther, parseUnits } from "viem";
2+
3+
import { ChainlinkFeedBaseCurrency, ChainlinkSpecificParams, OracleTypes, SupportedAsset } from "../types";
4+
import { assetSymbols } from "../assets";
5+
6+
export const WETH = "0x4200000000000000000000000000000000000006";
7+
export const WBTC = "0x03c7054bcb39f7b2e5b2c7acb37583e32d70cfa3";
8+
export const tBTC = "0xBBa2eF945D523C4e2608C9E1214C2Cc64D4fc2e2";
9+
export const USDT = "0x05d032ac25d322df992303dca074ee7392c117b9";
10+
export const SOV = "0xba20a5e63eeEFfFA6fD365E7e540628F8fC61474";
11+
export const USDC = "0xe75D0fB2C24A55cA1e3F96781a2bCC7bdba058F0";
12+
13+
export const assets: SupportedAsset[] = [
14+
{
15+
symbol: assetSymbols.WETH,
16+
underlying: WETH,
17+
name: "Wrapped Ether",
18+
decimals: 18,
19+
oracle: OracleTypes.FixedNativePriceOracle,
20+
initialSupplyCap: parseEther(String(3_000)).toString(),
21+
initialBorrowCap: parseEther("0.01").toString(),
22+
initialCf: "85"
23+
},
24+
{
25+
symbol: assetSymbols.WBTC,
26+
underlying: WBTC,
27+
name: "Wrapped BTC",
28+
decimals: 8,
29+
oracle: OracleTypes.ChainlinkPriceOracleV2,
30+
oracleSpecificParams: {
31+
aggregator: "0x1Ff2fFada49646fB9b326EdF8A91446d3cf9a291",
32+
feedBaseCurrency: ChainlinkFeedBaseCurrency.USD
33+
} as ChainlinkSpecificParams,
34+
initialSupplyCap: parseUnits(String(100), 8).toString(),
35+
initialBorrowCap: parseUnits("0.00001", 8).toString(),
36+
initialCf: "85"
37+
},
38+
{
39+
symbol: assetSymbols.USDT,
40+
underlying: USDT,
41+
name: "Tether USD",
42+
decimals: 6,
43+
oracle: OracleTypes.ChainlinkPriceOracleV2,
44+
oracleSpecificParams: {
45+
aggregator: "0x7D126c43B4A6e3EF39B310bbcC2c4D71C77AD627",
46+
feedBaseCurrency: ChainlinkFeedBaseCurrency.USD
47+
} as ChainlinkSpecificParams,
48+
initialSupplyCap: parseUnits(String(10_000_000), 6).toString(),
49+
initialBorrowCap: parseUnits(String(30), 6).toString(),
50+
initialCf: "85"
51+
},
52+
{
53+
symbol: assetSymbols.tBTC,
54+
underlying: tBTC,
55+
name: "tBTC v2",
56+
decimals: 18,
57+
oracle: OracleTypes.ChainlinkPriceOracleV2,
58+
oracleSpecificParams: {
59+
aggregator: "0xA2C438a949171FAAED89FE05696E2FF31A1d97B3",
60+
feedBaseCurrency: ChainlinkFeedBaseCurrency.USD
61+
} as ChainlinkSpecificParams,
62+
initialSupplyCap: parseUnits(String(100), 18).toString(),
63+
initialBorrowCap: parseUnits("0.00001", 18).toString(),
64+
initialCf: "85"
65+
},
66+
{
67+
symbol: assetSymbols.USDC,
68+
underlying: USDC,
69+
name: "USD Coin",
70+
decimals: 6,
71+
oracle: OracleTypes.ChainlinkPriceOracleV2,
72+
oracleSpecificParams: {
73+
aggregator: "0x1030Be1aFF580687Ca161a96140D146f43Edaa65",
74+
feedBaseCurrency: ChainlinkFeedBaseCurrency.USD
75+
} as ChainlinkSpecificParams,
76+
initialSupplyCap: parseUnits(String(10_000_000), 6).toString(),
77+
initialBorrowCap: parseUnits(String(30), 6).toString(),
78+
initialCf: "85"
79+
},
80+
{
81+
symbol: assetSymbols.SOV,
82+
underlying: SOV,
83+
name: "SOV",
84+
decimals: 18,
85+
oracle: OracleTypes.ChainlinkPriceOracleV2,
86+
oracleSpecificParams: {
87+
aggregator: "0x77466772A46895269bff44e509096E4073d4Dc67",
88+
feedBaseCurrency: ChainlinkFeedBaseCurrency.USD
89+
} as ChainlinkSpecificParams,
90+
initialSupplyCap: parseUnits(String(20_000_000), 18).toString(),
91+
initialBorrowCap: parseUnits(String(69), 18).toString(),
92+
initialCf: "45"
93+
}
94+
];
95+
96+
export default assets;

chains/bob/fundingStrategies.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { FundingStrategy } from "../types";
2+
3+
const fundingStrategies: FundingStrategy[] = [];
4+
5+
export default fundingStrategies;

chains/bob/index.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { bob } from "viem/chains";
2+
import deployments from "../../deploymentsBrief/bob.json";
3+
import { ChainConfig } from "../types";
4+
import chainAddresses from "./addresses";
5+
import { assets } from "./assets";
6+
import fundingStrategies from "./fundingStrategies";
7+
import irms from "./irms";
8+
import leveragePairs from "./leveragePairs";
9+
import liquidationDefaults from "./liquidation";
10+
import oracles from "./oracles";
11+
import specificParams from "./params";
12+
import deployedPlugins from "./plugins";
13+
import redemptionStrategies from "./redemptionStrategies";
14+
15+
const chainConfig: ChainConfig = {
16+
chainId: bob.id,
17+
chainAddresses,
18+
assets,
19+
irms,
20+
liquidationDefaults,
21+
oracles,
22+
specificParams,
23+
deployedPlugins,
24+
redemptionStrategies,
25+
fundingStrategies,
26+
chainDeployments: deployments.contracts,
27+
leveragePairs
28+
};
29+
30+
export default chainConfig;

chains/bob/irms.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { IrmTypes } from "../types";
2+
3+
const baseIrms = [IrmTypes.JumpRateModel];
4+
5+
const irms: IrmTypes[] = [...baseIrms];
6+
7+
export default irms;

chains/bob/leveragePairs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LeveragePoolConfig } from "../types";
2+
3+
const leveragePairs: LeveragePoolConfig[] = [];
4+
5+
export default leveragePairs;

chains/bob/liquidation.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { parseEther, zeroAddress } from "viem";
2+
3+
import chainAddresses from "./addresses";
4+
import { USDC, WETH } from "./assets";
5+
import { LiquidationDefaults, LiquidationStrategy } from "../types";
6+
7+
const liquidationDefaults: LiquidationDefaults = {
8+
DEFAULT_ROUTER: chainAddresses.UNISWAP_V2_ROUTER,
9+
ASSET_SPECIFIC_ROUTER: {},
10+
SUPPORTED_OUTPUT_CURRENCIES: [zeroAddress, WETH, USDC],
11+
SUPPORTED_INPUT_CURRENCIES: [zeroAddress, WETH],
12+
LIQUIDATION_STRATEGY: LiquidationStrategy.UNISWAP,
13+
MINIMUM_PROFIT_NATIVE: parseEther("0.001"),
14+
LIQUIDATION_INTERVAL_SECONDS: 20
15+
};
16+
17+
export default liquidationDefaults;

chains/bob/oracles.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { OracleTypes } from "../types";
2+
3+
const baseOracles = [OracleTypes.FixedNativePriceOracle, OracleTypes.MasterPriceOracle, OracleTypes.SimplePriceOracle];
4+
5+
const oracles: OracleTypes[] = [...baseOracles, OracleTypes.PythPriceOracle];
6+
7+
export default oracles;

chains/bob/params.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Address } from "viem";
2+
3+
import chainAddresses from "./addresses";
4+
import { ChainParams } from "../types";
5+
import { assetSymbols } from "../assets";
6+
7+
const specificParams: ChainParams = {
8+
blocksPerYear: 30 * 60 * 24 * 365, // 30 blocks per minute = 2 sec block time
9+
cgId: "ethereum",
10+
metadata: {
11+
chainIdHex: "0xed88",
12+
name: "Build On Bitcoin",
13+
shortName: "BOB",
14+
uniswapV3Fees: {},
15+
img: "https://icons.llamao.fi/icons/chains/rsz_bob.jpg",
16+
blockExplorerUrls: { default: { name: "bobexplorer", url: "https://explorer.gobob.xyz" } },
17+
rpcUrls: {
18+
default: { http: ["https://rpc.gobob.xyz"] },
19+
public: { http: ["https://rpc.gobob.xyz"] }
20+
},
21+
nativeCurrency: {
22+
symbol: "ETH",
23+
name: "ETH"
24+
},
25+
wrappedNativeCurrency: {
26+
symbol: assetSymbols.WETH,
27+
address: chainAddresses.W_TOKEN as Address,
28+
name: "WETH",
29+
decimals: 18,
30+
color: "#7A88A1",
31+
overlayTextColor: "#fff",
32+
logoURL: "https://d1912tcoux65lj.cloudfront.net/network/ethereum.png"
33+
}
34+
}
35+
};
36+
37+
export default specificParams;

0 commit comments

Comments
 (0)