@leather.io/models 0.46.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ import type { FungibleCryptoAsset } from '../../assets/asset.model';
2
+ import type { Money } from '../../money.model';
3
+ import type { BaseYieldPosition } from '../yield-position.base.model';
4
+ import type { YieldProductKeys } from '../yield-product.model';
5
+ import type { YieldProviderKeys } from '../yield-provider.model';
6
+
7
+ export interface ZestBorrowPosition extends BaseYieldPosition {
8
+ provider: typeof YieldProviderKeys.zest;
9
+ product: typeof YieldProductKeys.zestBorrow;
10
+ supplyBalance: Money;
11
+ borrowBalance: Money;
12
+ ltvPercentage: number;
13
+ borrowAssets: ZestBorrowAsset[];
14
+ supplyAssets: ZestBorrowAsset[];
15
+ }
16
+
17
+ export interface ZestBorrowAsset {
18
+ asset: FungibleCryptoAsset;
19
+ apy: number;
20
+ balance: Money;
21
+ balanceQuote: Money;
22
+ }
@@ -0,0 +1,12 @@
1
+ import type { Money } from '../money.model';
2
+ import type { YieldProductKey } from './yield-product.model';
3
+ import type { YieldProviderKey } from './yield-provider.model';
4
+
5
+ export interface BaseYieldPosition {
6
+ readonly provider: YieldProviderKey;
7
+ readonly product: YieldProductKey;
8
+ readonly totalBalance: Money;
9
+ readonly netApy?: number;
10
+ readonly updatedAtBlockHeight: number;
11
+ readonly updatedAt: Date;
12
+ }
@@ -0,0 +1,14 @@
1
+ import type { BitflowAmmLpPosition } from './providers/bitflow.model';
2
+ import type { GraniteV1Position } from './providers/granite.model';
3
+ import type {
4
+ StackingDaoLstPosition,
5
+ StackingDaoPooledStackingPosition,
6
+ } from './providers/stacking-dao.model';
7
+ import type { ZestBorrowPosition } from './providers/zest.model';
8
+
9
+ export type YieldPosition =
10
+ | BitflowAmmLpPosition
11
+ | ZestBorrowPosition
12
+ | GraniteV1Position
13
+ | StackingDaoLstPosition
14
+ | StackingDaoPooledStackingPosition;
@@ -0,0 +1,43 @@
1
+ import type { Money } from '../money.model';
2
+ import { YieldProviderKey, YieldProviderKeys } from './yield-provider.model';
3
+
4
+ export const YieldProductKeys = {
5
+ bitflowAmmLp: 'bitflow-amm-lp',
6
+ zestBorrow: 'zest-borrow',
7
+ graniteV1: 'granite-v1',
8
+ stackingDaoLst: 'stackingdao-lst',
9
+ stackingDaoPooledStacking: 'stackingdao-pooled-stacking',
10
+ // fastPoolPooledStacking: 'fast-pool-pooled-stacking',
11
+ // xversePooledStacking: 'xverse-pooled-stacking',
12
+ } as const;
13
+ export type YieldProductKey = (typeof YieldProductKeys)[keyof typeof YieldProductKeys];
14
+
15
+ export const YieldProductCategories = {
16
+ AMM: 'amm',
17
+ LENDING: 'lending',
18
+ LST: 'lst',
19
+ CDP: 'cdp',
20
+ POOLED_STACKING: 'pooled-stacking',
21
+ PERPS: 'perps',
22
+ } as const;
23
+ export type YieldProductCategory =
24
+ (typeof YieldProductCategories)[keyof typeof YieldProductCategories];
25
+
26
+ export const YieldProductToProtocolMap = {
27
+ [YieldProductKeys.bitflowAmmLp]: YieldProviderKeys.bitflow,
28
+ [YieldProductKeys.zestBorrow]: YieldProviderKeys.zest,
29
+ [YieldProductKeys.graniteV1]: YieldProviderKeys.granite,
30
+ [YieldProductKeys.stackingDaoLst]: YieldProviderKeys.stackingDao,
31
+ [YieldProductKeys.stackingDaoPooledStacking]: YieldProviderKeys.stackingDao,
32
+ // [YieldProductKeys.fastPoolPooledStacking]: YieldProviderKeys.fastPool,
33
+ // [YieldProductKeys.xversePooledStacking]: YieldProviderKeys.xverse,
34
+ } as const;
35
+
36
+ export interface YieldProduct {
37
+ readonly key: YieldProductKey;
38
+ readonly provider: YieldProviderKey;
39
+ readonly name: string;
40
+ readonly url: string;
41
+ readonly category: YieldProductCategory;
42
+ readonly tvl?: Money;
43
+ }
@@ -0,0 +1,16 @@
1
+ export const YieldProviderKeys = {
2
+ bitflow: 'bitflow',
3
+ zest: 'zest',
4
+ granite: 'granite',
5
+ stackingDao: 'stackingdao',
6
+ // fastPool: 'fast-pool',
7
+ // xverse: 'xverse',
8
+ } as const;
9
+ export type YieldProviderKey = (typeof YieldProviderKeys)[keyof typeof YieldProviderKeys];
10
+
11
+ export interface YieldProvider {
12
+ readonly key: YieldProviderKey;
13
+ readonly name: string;
14
+ readonly logo: string;
15
+ readonly url: string;
16
+ }