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

FIX: Wrong vault configuration on ethereum #332

Merged
merged 1 commit into from
Dec 20, 2024
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
28 changes: 23 additions & 5 deletions src/lib/config/metadataTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type ApiProvider =
| "jones"
| "dinero";

export interface VaultMetadata {
interface VaultMetadataBase {
label: string;
image: string;
synthAssetType: SynthAsset;
Expand All @@ -75,18 +75,36 @@ export interface VaultMetadata {
disabledDepositTokens: Address[];
disabledWithdrawTokens: Address[];
wethGateway?: Address;
gateway?: Address;
strategy?: string;
beta?: boolean;
}

interface VaultMetadataWithYieldTokenOverride extends VaultMetadataBase {
gateway: Address;
/**
* This is the address of the actual yield (bearing for aave) token,
* the regular yield token address in this case becomes a (static token adapter for aave or staking token for yearn),
* that we use for the vaults.
* If it exists, means the vault is using (static token adapter for aave or staking token for yearn).
*/
yieldTokenOverride?: Address;
strategy?: string;
beta?: boolean;
yieldTokenOverride: Address;
}

interface VaultMetadataWithoutYieldTokenOverride extends VaultMetadataBase {
gateway?: never;
/**
* This is the address of the actual yield (bearing for aave) token,
* the regular yield token address in this case becomes a (static token adapter for aave or staking token for yearn),
* that we use for the vaults.
* If it exists, means the vault is using (static token adapter for aave or staking token for yearn).
*/
yieldTokenOverride?: never;
}

export type VaultMetadata =
| VaultMetadataWithYieldTokenOverride
| VaultMetadataWithoutYieldTokenOverride;

/**
* Handle fetching APR data
*/
Expand Down
6 changes: 5 additions & 1 deletion src/lib/config/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const VAULTS: VaultsConfig = {
image: "aDAI.svg",
messages: [],
yieldTokenOverride: "0x028171bCA77440897B824Ca71D1c56caC55b68A3",
gateway: "0x67EC822A2F981Ef2db6Afce4E8dF57ff1439f4d3",
api: {
apr: getAaveApr,
yieldType: "APR",
Expand All @@ -114,6 +115,7 @@ export const VAULTS: VaultsConfig = {
image: "aUSDC.svg",
messages: [],
yieldTokenOverride: "0xBcca60bB61934080951369a648Fb03DF4F96263C",
gateway: "0x67EC822A2F981Ef2db6Afce4E8dF57ff1439f4d3",
api: {
apr: getAaveApr,
yieldType: "APR",
Expand All @@ -131,6 +133,7 @@ export const VAULTS: VaultsConfig = {
image: "aUSDT.svg",
messages: [],
yieldTokenOverride: "0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811",
gateway: "0x67EC822A2F981Ef2db6Afce4E8dF57ff1439f4d3",
api: {
apr: getAaveApr,
yieldType: "APR",
Expand Down Expand Up @@ -212,6 +215,7 @@ export const VAULTS: VaultsConfig = {
image: "aFRAX.svg",
messages: [],
yieldTokenOverride: "0xd4937682df3C8aEF4FE912A96A74121C0829E664",
gateway: "0x67EC822A2F981Ef2db6Afce4E8dF57ff1439f4d3",
api: {
apr: getAaveApr,
yieldType: "APR",
Expand Down Expand Up @@ -247,7 +251,6 @@ export const VAULTS: VaultsConfig = {
image: "wstETH.svg",
messages: [],
wethGateway: "0xA22a7ec2d82A471B1DAcC4B37345Cf428E76D67A",
gateway: "0xA22a7ec2d82A471B1DAcC4B37345Cf428E76D67A",
api: {
apr: getLidoApy,
yieldType: "APR",
Expand Down Expand Up @@ -283,6 +286,7 @@ export const VAULTS: VaultsConfig = {
messages: [],
wethGateway: "0xA22a7ec2d82A471B1DAcC4B37345Cf428E76D67A",
yieldTokenOverride: "0x030bA81f1c18d280636F32af80b9AAd02Cf0854e",
gateway: "0xA067C885d958aec176eC3D8dAdc847e0c9384809",
api: {
apr: getAaveApr,
yieldType: "APR",
Expand Down
Loading