Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/mis usdt.bas dai #5

Closed
Closed
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
4 changes: 4 additions & 0 deletions containers/Contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ export const UNI_ETH_WBTC_STAKING_REWARDS =
"0xCA35e32e7926b96A9988f61d510E038108d8068e";
export const BASIS_BAC_DAI_STAKING_REWARDS =
"0x067d4D3CE63450E74F880F86b5b52ea3edF9Db0f";
export const BASIS_BAS_DAI_STAKING_REWARDS =
"0x9569d4CD7AC5B010DA5697E952EFB1EC0Efb0D0a";
export const MITH_MIC_USDT_STAKING_REWARDS =
"0x9D9418803F042CCd7647209b0fFd617981D5c619";
export const MITH_MIS_USDT_STAKING_REWARDS =
"0x14E33e1D6Cc4D83D7476492C0A52b3d4F869d892";

export const INSTABRINE = "0x8F9676bfa268E94A2480352cC5296A943D5A2809";
export const SUSHI_CHEF = "0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd";
Expand Down
8 changes: 8 additions & 0 deletions containers/Farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,18 @@ export const FarmInfo: IFarmInfo = {
tokenName: "pMICUSDT",
poolName: "pMICUSDT",
},
"0x0FAA189afE8aE97dE1d2F01E471297678842146d": {
tokenName: "pMISUSDT",
poolName: "MIS Power",
},
"0x2350fc7268F3f5a6cC31f26c38f706E41547505d": {
tokenName: "UNI BAC/DAI",
poolName: "Basis Power",
},
"0x9018eDe0972f7902a852B1332a0F616BDaF4bb17": {
tokenName: "UNI BAS/DAI",
poolName: "BAS Power",
},
};

function useFarms() {
Expand Down
6 changes: 6 additions & 0 deletions containers/Farms/farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ export const JAR_FARM_MAP = {
"0x2350fc7268F3f5a6cC31f26c38f706E41547505d": {
jarName: DEPOSIT_TOKENS_JAR_NAMES.UNIV2_BAC_DAI,
},
"0x9018eDe0972f7902a852B1332a0F616BDaF4bb17": {
jarName: DEPOSIT_TOKENS_JAR_NAMES.UNIV2_BAS_DAI,
},
"0xC66583Dd4E25b3cfc8D881F6DbaD8288C7f5Fd30": {
jarName: DEPOSIT_TOKENS_JAR_NAMES.SUSHI_MIC_USDT,
},
"0x0FAA189afE8aE97dE1d2F01E471297678842146d": {
jarName: DEPOSIT_TOKENS_JAR_NAMES.SUSHI_MIS_USDT,
},
"0x1BB74b5DdC1f4fC91D6f9E7906cf68bc93538e33": {
jarName: DEPOSIT_TOKENS_JAR_NAMES["3CRV"],
},
Expand Down
20 changes: 20 additions & 0 deletions containers/Jars/jars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export const PICKLE_JARS = {

export const JAR_DEPOSIT_TOKENS = {
SUSHI_MIC_USDT: "0xC9cB53B48A2f3A9e75982685644c1870F1405CCb",
SUSHI_MIS_USDT: "0x066F3A3B7C8Fa077c71B9184d862ed0A4D5cF3e0",
UNIV2_BAC_DAI: "0xd4405F0704621DBe9d4dEA60E128E0C3b26bddbD",
UNIV2_BAS_DAI: "0x0379dA7a5895D13037B6937b109fA8607a659ADF",
SUSHI_ETH_DAI: "0xC3D03e4F041Fd4cD388c549Ee2A29a9E5075882f",
SUSHI_ETH_USDC: "0x397FF1542f962076d0BFE58eA045FfA2d347ACa0",
SUSHI_ETH_USDT: "0x06da0fd433C1A5d7a4faa01111c044910A184553",
Expand All @@ -43,7 +45,9 @@ export const DEPOSIT_TOKENS_NAME = {
UNIV2_ETH_USDT: "UNI USDT/ETH",
UNIV2_ETH_WBTC: "UNI WBTC/ETH",
UNIV2_BAC_DAI: "UNI BAC/DAI",
UNIV2_BAS_DAI: "UNI BAS/DAI",
SUSHI_MIC_USDT: "SLP MIC/USDT",
SUSHI_MIS_USDT: "SLP MIS/USDT",
SUSHI_ETH_DAI: "SLP DAI/ETH",
SUSHI_ETH_USDC: "SLP USDC/ETH",
SUSHI_ETH_USDT: "SLP USDT/ETH",
Expand All @@ -61,7 +65,9 @@ export const JAR_ACTIVE: Record<string, boolean> = {
[DEPOSIT_TOKENS_NAME.UNIV2_ETH_USDT]: false,
[DEPOSIT_TOKENS_NAME.UNIV2_ETH_WBTC]: false,
[DEPOSIT_TOKENS_NAME.UNIV2_BAC_DAI]: true,
[DEPOSIT_TOKENS_NAME.UNIV2_BAS_DAI]: true,
[DEPOSIT_TOKENS_NAME.SUSHI_MIC_USDT]: true,
[DEPOSIT_TOKENS_NAME.SUSHI_MIS_USDT]: true,
[DEPOSIT_TOKENS_NAME.SUSHI_ETH_DAI]: true,
[DEPOSIT_TOKENS_NAME.SUSHI_ETH_USDC]: true,
[DEPOSIT_TOKENS_NAME.SUSHI_ETH_USDT]: true,
Expand All @@ -84,8 +90,12 @@ export const DEPOSIT_TOKENS_LINK = {
"https://app.uniswap.org/#/add/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599/ETH",
UNIV2_BAC_DAI:
"https://app.uniswap.org/#/add/0x3449FC1Cd036255BA1EB19d65fF4BA2b8903A69a/0x6B175474E89094C44Da98b954EedeAC495271d0F",
UNIV2_BAS_DAI:
"https://app.uniswap.org/#/add/0xa7ED29B253D8B4E3109ce07c80fc570f81B63696/0x6B175474E89094C44Da98b954EedeAC495271d0F",
SUSHI_MIC_USDT:
"https://exchange.sushiswapclassic.org/#/add/0x368B3a58B5f49392e5C9E4C998cb0bB966752E51/0xdAC17F958D2ee523a2206206994597C13D831ec7",
SUSHI_MIS_USDT:
"https://exchange.sushiswapclassic.org/#/add/0x4b4D2e899658FB59b1D518b68fe836B100ee8958/0xdAC17F958D2ee523a2206206994597C13D831ec7",
SUSHI_ETH_DAI:
"https://exchange.sushiswapclassic.org/#/add/0x6b175474e89094c44da98b954eedeac495271d0f/ETH",
SUSHI_ETH_USDC:
Expand All @@ -108,7 +118,9 @@ export const DEPOSIT_TOKENS_JAR_NAMES = {
UNIV2_ETH_USDT: "pJar 0.69c",
UNIV2_ETH_WBTC: "pJar 0.69d",
UNIV2_BAC_DAI: "pJar 0.99f",
UNIV2_BAS_DAI: "pJar 0.99h",
SUSHI_MIC_USDT: "pJar 0.99g",
SUSHI_MIS_USDT: "pJar 0.99i",
DAI: "pJar 0.88a",
sCRV_OLD: "pJar 0 (old)",
UNIV2_ETH_DAI_OLD: "pJar 0.69a (old)",
Expand Down Expand Up @@ -163,9 +175,17 @@ export const getPriceId = (tokenAddress: string): PriceIds => {
return "bac";
}

if (l === "0xa7ED29B253D8B4E3109ce07c80fc570f81B63696") {
return "bas";
}

if (l === "0x368b3a58b5f49392e5c9e4c998cb0bb966752e51") {
return "mic";
}

if (l === "0x4b4D2e899658FB59b1D518b68fe836B100ee8958") {
return "mis";
}

throw new Error(`Unknown token address: ${tokenAddress}`);
};
22 changes: 22 additions & 0 deletions containers/Jars/useJarsWithAPY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
SCRV_STAKING_REWARDS,
Contracts,
BASIS_BAC_DAI_STAKING_REWARDS,
BASIS_BAS_DAI_STAKING_REWARDS,
MITH_MIC_USDT_STAKING_REWARDS,
MITH_MIS_USDT_STAKING_REWARDS,
} from "../Contracts";
import { Jar } from "./useFetchJars";
import { useCurveRawStats } from "./useCurveRawStats";
Expand Down Expand Up @@ -300,9 +302,15 @@ export const useJarWithAPY = (jars: Input): Output => {
calculateSushiAPY(JAR_DEPOSIT_TOKENS.SUSHI_ETH_WBTC),
calculateSushiAPY(JAR_DEPOSIT_TOKENS.SUSHI_ETH_YFI),
]);
const basisBasDaiApy = await calculateBasisAPY(
BASIS_BAS_DAI_STAKING_REWARDS,
);
const mithMicUsdtApy = await calculateMithAPY(
MITH_MIC_USDT_STAKING_REWARDS,
);
const mithMisUsdtApy = await calculateMithAPY(
MITH_MIS_USDT_STAKING_REWARDS,
);

const promises = jars.map(async (jar) => {
let APYs: Array<JarApy> = [];
Expand Down Expand Up @@ -361,13 +369,27 @@ export const useJarWithAPY = (jars: Input): Output => {
];
}

if (jar.jarName === DEPOSIT_TOKENS_JAR_NAMES.UNIV2_BAS_DAI) {
APYs = [
...basisBasDaiApy,
...getUniPairDayAPY(JAR_DEPOSIT_TOKENS.UNIV2_BAS_DAI),
];
}

if (jar.jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_MIC_USDT) {
APYs = [
...mithMicUsdtApy,
...getSushiPairDayAPY(JAR_DEPOSIT_TOKENS.SUSHI_MIC_USDT),
];
}

if (jar.jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_MIS_USDT) {
APYs = [
...mithMisUsdtApy,
...getSushiPairDayAPY(JAR_DEPOSIT_TOKENS.SUSHI_MIS_USDT),
];
}

if (jar.jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_ETH_DAI) {
APYs = [
...sushiEthDaiApy,
Expand Down
4 changes: 3 additions & 1 deletion containers/Jars/useJarsWithTVL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const isUniPool = (jarName: string): boolean => {
jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_ETH_WBTC ||
jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_ETH_YFI ||
jarName === DEPOSIT_TOKENS_JAR_NAMES.UNIV2_BAC_DAI ||
jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_MIC_USDT
jarName === DEPOSIT_TOKENS_JAR_NAMES.UNIV2_BAS_DAI ||
jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_MIC_USDT ||
jarName === DEPOSIT_TOKENS_JAR_NAMES.SUSHI_MIS_USDT
);
};

Expand Down
1 change: 1 addition & 0 deletions containers/Jars/useSushiPairDayData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const SUSHI_LP_TOKENS = [
JAR_DEPOSIT_TOKENS.SUSHI_ETH_WBTC,
JAR_DEPOSIT_TOKENS.SUSHI_ETH_YFI,
JAR_DEPOSIT_TOKENS.SUSHI_MIC_USDT,
JAR_DEPOSIT_TOKENS.SUSHI_MIS_USDT,
];

export const useSushiPairDayData = () => {
Expand Down
1 change: 1 addition & 0 deletions containers/Jars/useUniPairDayData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const UNI_LP_TOKENS = [
JAR_DEPOSIT_TOKENS.UNIV2_ETH_USDT,
JAR_DEPOSIT_TOKENS.UNIV2_ETH_WBTC,
JAR_DEPOSIT_TOKENS.UNIV2_BAC_DAI,
JAR_DEPOSIT_TOKENS.UNIV2_BAS_DAI,
];

export const useUniPairDayData = () => {
Expand Down
3 changes: 3 additions & 0 deletions containers/SushiPairs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const addresses = {
wbtc: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
yfi: "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e",
mic: "0x368b3a58b5f49392e5c9e4c998cb0bb966752e51",
mis: "0x4b4D2e899658FB59b1D518b68fe836B100ee8958",
};

interface Token {
Expand All @@ -34,6 +35,7 @@ const usdt: Token = { address: addresses.usdt, priceId: "usdt", decimals: 6 };
const yfi: Token = { address: addresses.yfi, priceId: "yfi", decimals: 18 };
const wbtc: Token = { address: addresses.wbtc, priceId: "wbtc", decimals: 8 };
const mic: Token = { address: addresses.mic, priceId: "mic", decimals: 18 };
const mis: Token = { address: addresses.mis, priceId: "mis", decimals: 18 };

interface PairMap {
[key: string]: { a: Token; b: Token };
Expand All @@ -46,6 +48,7 @@ export const PAIR_INFO: PairMap = {
"0xCEfF51756c56CeFFCA006cD410B03FFC46dd3a58": { a: wbtc, b: weth },
"0x088ee5007C98a9677165D78dD2109AE4a3D04d0C": { a: yfi, b: weth },
"0xC9cB53B48A2f3A9e75982685644c1870F1405CCb": { a: mic, b: usdt },
"0x066F3A3B7C8Fa077c71B9184d862ed0A4D5cF3e0": { a: mis, b: usdt },
};

function useSushiPairs() {
Expand Down
3 changes: 3 additions & 0 deletions containers/UniV2Pairs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const addresses = {
susd: "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51",
wbtc: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
bac: "0x3449FC1Cd036255BA1EB19d65fF4BA2b8903A69a",
bas: "0xa7ED29B253D8B4E3109ce07c80fc570f81B63696",
};

interface Token {
Expand All @@ -33,6 +34,7 @@ const usdt: Token = { address: addresses.usdt, priceId: "usdt", decimals: 6 };
const susd: Token = { address: addresses.susd, priceId: "susd", decimals: 18 };
const wbtc: Token = { address: addresses.wbtc, priceId: "wbtc", decimals: 8 };
const bac: Token = { address: addresses.bac, priceId: "bac", decimals: 18 };
const bas: Token = { address: addresses.bac, priceId: "bas", decimals: 18 };

interface PairMap {
[key: string]: { a: Token; b: Token };
Expand All @@ -46,6 +48,7 @@ export const PAIR_INFO: PairMap = {
"0xf80758aB42C3B07dA84053Fd88804bCB6BAA4b5c": { a: susd, b: weth },
"0xBb2b8038a1640196FbE3e38816F3e67Cba72D940": { a: wbtc, b: weth },
"0xd4405F0704621DBe9d4dEA60E128E0C3b26bddbD": { a: bac, b: dai },
"0x0379dA7a5895D13037B6937b109fA8607a659ADF": { a: bas, b: dai },
};

function useUniV2Pairs() {
Expand Down
6 changes: 6 additions & 0 deletions features/Farms/FarmCollapsible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ const FARM_LP_TO_ICON = {
"0x2350fc7268F3f5a6cC31f26c38f706E41547505d": (
<LpIcon swapIconSrc={"/uniswap.png"} tokenIconSrc={"/bac.png"} />
),
"0x9018eDe0972f7902a852B1332a0F616BDaF4bb17": (
<LpIcon swapIconSrc={"/uniswap.png"} tokenIconSrc={"/bas.png"} />
),
"0xC66583Dd4E25b3cfc8D881F6DbaD8288C7f5Fd30": (
<LpIcon swapIconSrc={"/sushiswap.png"} tokenIconSrc={"/mic.png"} />
),
"0x0FAA189afE8aE97dE1d2F01E471297678842146d": (
<LpIcon swapIconSrc={"/sushiswap.png"} tokenIconSrc={"/mis.png"} />
),
};

const setButtonStatus = (
Expand Down
6 changes: 6 additions & 0 deletions features/Jars/JarCollapsible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ export const JAR_DEPOSIT_TOKEN_TO_ICON: {
"0xd4405F0704621DBe9d4dEA60E128E0C3b26bddbD": (
<LpIcon swapIconSrc={"/uniswap.png"} tokenIconSrc={"/bac.png"} />
),
"0x0379dA7a5895D13037B6937b109fA8607a659ADF": (
<LpIcon swapIconSrc={"/uniswap.png"} tokenIconSrc={"/bas.png"} />
),
"0xC9cB53B48A2f3A9e75982685644c1870F1405CCb": (
<LpIcon swapIconSrc={"/sushiswap.png"} tokenIconSrc={"/mic.png"} />
),
"0x066F3A3B7C8Fa077c71B9184d862ed0A4D5cF3e0": (
<LpIcon swapIconSrc={"/sushiswap.png"} tokenIconSrc={"/mis.png"} />
),
};

const setButtonStatus = (
Expand Down
Binary file added public/bas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.