This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(umami-finance): GLP vaults (#2791)
* feat(umami-finance): GLP vaults, remove deprecated v1 vault * update to latest deployment * add vaults logo, update main app logo --------- Co-authored-by: William Poulin <[email protected]>
- Loading branch information
1 parent
7f13e14
commit c8f4c9a
Showing
28 changed files
with
6,209 additions
and
6,869 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
src/apps/umami-finance/arbitrum/umami-finance.glp-vaults.token-fetcher.ts
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,80 @@ | ||
import { Inject } from '@nestjs/common'; | ||
|
||
import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; | ||
import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; | ||
import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; | ||
import { | ||
GetAddressesParams, | ||
GetUnderlyingTokensParams, | ||
UnderlyingTokenDefinition, | ||
GetPricePerShareParams, | ||
DefaultAppTokenDataProps, | ||
GetDisplayPropsParams, | ||
} from '~position/template/app-token.template.types'; | ||
|
||
import { UmamiFinanceGlpVaultAddress } from '../common/umami-finance.constants'; | ||
import { UmamiFinanceContractFactory } from '../contracts'; | ||
import { UmamiFinanceGlpVault } from '../contracts/ethers/UmamiFinanceGlpVault'; | ||
|
||
export type UmamiFinanceGlpVaultAppTokenDefinition = { | ||
address: string; | ||
timelockedVaultAddress: string; | ||
}; | ||
|
||
@PositionTemplate() | ||
export class ArbitrumUmamiFinanceGlpVaultsTokenFetcher extends AppTokenTemplatePositionFetcher< | ||
UmamiFinanceGlpVault, | ||
DefaultAppTokenDataProps, | ||
UmamiFinanceGlpVaultAppTokenDefinition | ||
> { | ||
groupLabel: string; | ||
|
||
constructor( | ||
@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, | ||
@Inject(UmamiFinanceContractFactory) private readonly umamiFinanceContractFactory: UmamiFinanceContractFactory, | ||
) { | ||
super(appToolkit); | ||
this.groupLabel = 'GLP Vaults'; | ||
} | ||
|
||
getContract(_address: string): UmamiFinanceGlpVault { | ||
return this.umamiFinanceContractFactory.umamiFinanceGlpVault({ address: _address, network: this.network }); | ||
} | ||
|
||
async getAddresses(_params: GetAddressesParams<UmamiFinanceGlpVaultAppTokenDefinition>): Promise<string[]> { | ||
return [ | ||
UmamiFinanceGlpVaultAddress.GLP_USDC, | ||
UmamiFinanceGlpVaultAddress.GLP_WETH, | ||
UmamiFinanceGlpVaultAddress.GLP_WBTC, | ||
UmamiFinanceGlpVaultAddress.GLP_LINK, | ||
UmamiFinanceGlpVaultAddress.GLP_UNI, | ||
]; | ||
} | ||
|
||
async getUnderlyingTokenDefinitions({ | ||
contract, | ||
}: GetUnderlyingTokensParams<UmamiFinanceGlpVault, UmamiFinanceGlpVaultAppTokenDefinition>): Promise< | ||
UnderlyingTokenDefinition[] | ||
> { | ||
const underlyingToken = await contract.asset(); | ||
return [{ address: underlyingToken, network: this.network }]; | ||
} | ||
|
||
async getPricePerShare({ | ||
contract, | ||
appToken, | ||
}: GetPricePerShareParams< | ||
UmamiFinanceGlpVault, | ||
DefaultAppTokenDataProps, | ||
UmamiFinanceGlpVaultAppTokenDefinition | ||
>): Promise<number[]> { | ||
const pricePerShareRaw = await contract.pps(); | ||
const pricePerShare = Number(pricePerShareRaw) / 10 ** appToken.decimals; | ||
|
||
return [pricePerShare]; | ||
} | ||
|
||
async getLabel({ appToken }: GetDisplayPropsParams<UmamiFinanceGlpVault>): Promise<string> { | ||
return `GLP ${appToken.tokens[0].symbol}`; | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
src/apps/umami-finance/arbitrum/umami-finance.timelocked-glp-vaults.token-fetcher.ts
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,75 @@ | ||
import { Inject } from '@nestjs/common'; | ||
|
||
import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; | ||
import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; | ||
import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; | ||
import { | ||
GetAddressesParams, | ||
DefaultAppTokenDefinition, | ||
GetUnderlyingTokensParams, | ||
UnderlyingTokenDefinition, | ||
GetPricePerShareParams, | ||
DefaultAppTokenDataProps, | ||
GetDisplayPropsParams, | ||
} from '~position/template/app-token.template.types'; | ||
|
||
import { UmamiFinanceTimelockedGlpVaultAddress } from '../common/umami-finance.constants'; | ||
import { UmamiFinanceContractFactory } from '../contracts'; | ||
import { UmamiFinanceTimelockedGlpVault } from '../contracts/ethers/UmamiFinanceTimelockedGlpVault'; | ||
|
||
@PositionTemplate() | ||
export class ArbitrumUmamiFinanceTimelockedGlpVaultsTokenFetcher extends AppTokenTemplatePositionFetcher<UmamiFinanceTimelockedGlpVault> { | ||
groupLabel: string; | ||
|
||
constructor( | ||
@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, | ||
@Inject(UmamiFinanceContractFactory) private readonly umamiFinanceContractFactory: UmamiFinanceContractFactory, | ||
) { | ||
super(appToolkit); | ||
this.groupLabel = 'Timelocked GLP Vaults'; | ||
} | ||
|
||
getContract(_address: string): UmamiFinanceTimelockedGlpVault { | ||
return this.umamiFinanceContractFactory.umamiFinanceTimelockedGlpVault({ | ||
address: _address, | ||
network: this.network, | ||
}); | ||
} | ||
|
||
async getAddresses(_params: GetAddressesParams<DefaultAppTokenDefinition>): Promise<string[]> { | ||
return [ | ||
UmamiFinanceTimelockedGlpVaultAddress.TL_GLP_USDC, | ||
UmamiFinanceTimelockedGlpVaultAddress.TL_GLP_WETH, | ||
UmamiFinanceTimelockedGlpVaultAddress.TL_GLP_WBTC, | ||
UmamiFinanceTimelockedGlpVaultAddress.TL_GLP_LINK, | ||
UmamiFinanceTimelockedGlpVaultAddress.TL_GLP_UNI, | ||
]; | ||
} | ||
|
||
async getUnderlyingTokenDefinitions({ | ||
contract, | ||
}: GetUnderlyingTokensParams<UmamiFinanceTimelockedGlpVault, DefaultAppTokenDefinition>): Promise< | ||
UnderlyingTokenDefinition[] | ||
> { | ||
const underlyingToken = await contract.asset(); | ||
return [{ address: underlyingToken, network: this.network }]; | ||
} | ||
|
||
async getPricePerShare({ | ||
contract, | ||
appToken, | ||
}: GetPricePerShareParams< | ||
UmamiFinanceTimelockedGlpVault, | ||
DefaultAppTokenDataProps, | ||
DefaultAppTokenDefinition | ||
>): Promise<number[]> { | ||
const pricePerShareRaw = await contract.pps(); | ||
const pricePerShare = Number(pricePerShareRaw) / 10 ** appToken.decimals; | ||
|
||
return [pricePerShare]; | ||
} | ||
|
||
async getLabel({ appToken }: GetDisplayPropsParams<UmamiFinanceTimelockedGlpVault>): Promise<string> { | ||
return `Timelocked GLP ${appToken.tokens[0].symbol}`; | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
src/apps/umami-finance/arbitrum/umami-finance.vaults.token-fetcher.ts
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+35.8 KB
src/apps/umami-finance/assets/0x37c0705a65948ea5e0ae1add13552bcad7711a23.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
BIN
+28.2 KB
src/apps/umami-finance/assets/0x6a89faf99587a12e6bb0351f2fa9006c6cd12257.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
BIN
+35.1 KB
src/apps/umami-finance/assets/0x727ed4ef04bb2a96ec77e44c1a91dbb01b605e42.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
BIN
+28.6 KB
src/apps/umami-finance/assets/0x83c19ec75d649aec7c99e2c6663ca055569da7c0.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
BIN
+31.4 KB
src/apps/umami-finance/assets/0xb0d9e1832bd973abd8f3b4d710ead21fcbefcb7c.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
BIN
+30.7 KB
src/apps/umami-finance/assets/0xbb84d79159d6bbe1de148dc82640caa677e06126.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
BIN
+37.9 KB
src/apps/umami-finance/assets/0xdca4e88c00a8800ebcebad63abdbaaaa755557f9.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
BIN
+28.5 KB
src/apps/umami-finance/assets/0xe0a21a475f8da0ee7fa5af8c1809d8ac5257607d.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
BIN
+40.6 KB
src/apps/umami-finance/assets/0xee57e7e3776e4868976f315e07a883955c9225d5.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
BIN
+32.8 KB
src/apps/umami-finance/assets/0xf2ad33e12a9780f1e42d878a29a3e0756008c838.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
export enum UmamiFinanceGlpVaultAddress { | ||
GLP_USDC = '0x727ed4ef04bb2a96ec77e44c1a91dbb01b605e42', | ||
GLP_WETH = '0xbb84d79159d6bbe1de148dc82640caa677e06126', | ||
GLP_WBTC = '0x6a89faf99587a12e6bb0351f2fa9006c6cd12257', | ||
GLP_LINK = '0xe0a21a475f8da0ee7fa5af8c1809d8ac5257607d', | ||
GLP_UNI = '0x37c0705a65948ea5e0ae1add13552bcad7711a23', | ||
} | ||
|
||
export enum UmamiFinanceTimelockedGlpVaultAddress { | ||
TL_GLP_USDC = '0xdca4e88c00a8800ebcebad63abdbaaaa755557f9', | ||
TL_GLP_WETH = '0xf2ad33e12a9780f1e42d878a29a3e0756008c838', | ||
TL_GLP_WBTC = '0x83c19ec75d649aec7c99e2c6663ca055569da7c0', | ||
TL_GLP_LINK = '0xb0d9e1832bd973abd8f3b4d710ead21fcbefcb7c', | ||
TL_GLP_UNI = '0xee57e7e3776e4868976f315e07a883955c9225d5', | ||
} |
Oops, something went wrong.