@cygnus-wealth/data-models 1.1.2 → 1.2.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.
- package/dist/cjs/enums/VaultStrategyType.js +34 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/interfaces/VaultPosition.js +2 -0
- package/dist/enums/VaultStrategyType.d.ts +30 -0
- package/dist/enums/VaultStrategyType.js +31 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/Account.d.ts +3 -0
- package/dist/interfaces/VaultPosition.d.ts +110 -0
- package/dist/interfaces/VaultPosition.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VaultStrategyType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Strategy type for yield vault positions.
|
|
6
|
+
*
|
|
7
|
+
* Classifies the underlying strategy used by a yield vault to generate returns.
|
|
8
|
+
* Different strategy types carry different risk profiles and return characteristics.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { VaultStrategyType } from '@cygnus-wealth/data-models';
|
|
13
|
+
*
|
|
14
|
+
* const strategyType = VaultStrategyType.YIELD_AGGREGATOR;
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @since 1.2.0
|
|
18
|
+
* @stability extended
|
|
19
|
+
*
|
|
20
|
+
* @see {@link VaultPosition} for usage in vault positions
|
|
21
|
+
*/
|
|
22
|
+
var VaultStrategyType;
|
|
23
|
+
(function (VaultStrategyType) {
|
|
24
|
+
/** Auto-compounding yield aggregator (e.g., Yearn, Beefy) */
|
|
25
|
+
VaultStrategyType["YIELD_AGGREGATOR"] = "YIELD_AGGREGATOR";
|
|
26
|
+
/** Single-asset lending vault (e.g., Yearn USDC vault lending on Aave) */
|
|
27
|
+
VaultStrategyType["LENDING"] = "LENDING";
|
|
28
|
+
/** Liquidity provision strategy (vault deposits into LP pools) */
|
|
29
|
+
VaultStrategyType["LIQUIDITY_PROVISION"] = "LIQUIDITY_PROVISION";
|
|
30
|
+
/** Delta-neutral or options-based structured product */
|
|
31
|
+
VaultStrategyType["STRUCTURED_PRODUCT"] = "STRUCTURED_PRODUCT";
|
|
32
|
+
/** Strategy type not covered by other categories */
|
|
33
|
+
VaultStrategyType["OTHER"] = "OTHER";
|
|
34
|
+
})(VaultStrategyType || (exports.VaultStrategyType = VaultStrategyType = {}));
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LendingPositionType = exports.AccountType = exports.TransactionType = exports.IntegrationSource = exports.Chain = exports.AssetType = void 0;
|
|
3
|
+
exports.VaultStrategyType = exports.LendingPositionType = exports.AccountType = exports.TransactionType = exports.IntegrationSource = exports.Chain = exports.AssetType = void 0;
|
|
4
4
|
// Enums
|
|
5
5
|
var AssetType_1 = require("./enums/AssetType");
|
|
6
6
|
Object.defineProperty(exports, "AssetType", { enumerable: true, get: function () { return AssetType_1.AssetType; } });
|
|
@@ -14,3 +14,5 @@ var AccountType_1 = require("./enums/AccountType");
|
|
|
14
14
|
Object.defineProperty(exports, "AccountType", { enumerable: true, get: function () { return AccountType_1.AccountType; } });
|
|
15
15
|
var LendingPositionType_1 = require("./enums/LendingPositionType");
|
|
16
16
|
Object.defineProperty(exports, "LendingPositionType", { enumerable: true, get: function () { return LendingPositionType_1.LendingPositionType; } });
|
|
17
|
+
var VaultStrategyType_1 = require("./enums/VaultStrategyType");
|
|
18
|
+
Object.defineProperty(exports, "VaultStrategyType", { enumerable: true, get: function () { return VaultStrategyType_1.VaultStrategyType; } });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy type for yield vault positions.
|
|
3
|
+
*
|
|
4
|
+
* Classifies the underlying strategy used by a yield vault to generate returns.
|
|
5
|
+
* Different strategy types carry different risk profiles and return characteristics.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { VaultStrategyType } from '@cygnus-wealth/data-models';
|
|
10
|
+
*
|
|
11
|
+
* const strategyType = VaultStrategyType.YIELD_AGGREGATOR;
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @since 1.2.0
|
|
15
|
+
* @stability extended
|
|
16
|
+
*
|
|
17
|
+
* @see {@link VaultPosition} for usage in vault positions
|
|
18
|
+
*/
|
|
19
|
+
export declare enum VaultStrategyType {
|
|
20
|
+
/** Auto-compounding yield aggregator (e.g., Yearn, Beefy) */
|
|
21
|
+
YIELD_AGGREGATOR = "YIELD_AGGREGATOR",
|
|
22
|
+
/** Single-asset lending vault (e.g., Yearn USDC vault lending on Aave) */
|
|
23
|
+
LENDING = "LENDING",
|
|
24
|
+
/** Liquidity provision strategy (vault deposits into LP pools) */
|
|
25
|
+
LIQUIDITY_PROVISION = "LIQUIDITY_PROVISION",
|
|
26
|
+
/** Delta-neutral or options-based structured product */
|
|
27
|
+
STRUCTURED_PRODUCT = "STRUCTURED_PRODUCT",
|
|
28
|
+
/** Strategy type not covered by other categories */
|
|
29
|
+
OTHER = "OTHER"
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy type for yield vault positions.
|
|
3
|
+
*
|
|
4
|
+
* Classifies the underlying strategy used by a yield vault to generate returns.
|
|
5
|
+
* Different strategy types carry different risk profiles and return characteristics.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { VaultStrategyType } from '@cygnus-wealth/data-models';
|
|
10
|
+
*
|
|
11
|
+
* const strategyType = VaultStrategyType.YIELD_AGGREGATOR;
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @since 1.2.0
|
|
15
|
+
* @stability extended
|
|
16
|
+
*
|
|
17
|
+
* @see {@link VaultPosition} for usage in vault positions
|
|
18
|
+
*/
|
|
19
|
+
export var VaultStrategyType;
|
|
20
|
+
(function (VaultStrategyType) {
|
|
21
|
+
/** Auto-compounding yield aggregator (e.g., Yearn, Beefy) */
|
|
22
|
+
VaultStrategyType["YIELD_AGGREGATOR"] = "YIELD_AGGREGATOR";
|
|
23
|
+
/** Single-asset lending vault (e.g., Yearn USDC vault lending on Aave) */
|
|
24
|
+
VaultStrategyType["LENDING"] = "LENDING";
|
|
25
|
+
/** Liquidity provision strategy (vault deposits into LP pools) */
|
|
26
|
+
VaultStrategyType["LIQUIDITY_PROVISION"] = "LIQUIDITY_PROVISION";
|
|
27
|
+
/** Delta-neutral or options-based structured product */
|
|
28
|
+
VaultStrategyType["STRUCTURED_PRODUCT"] = "STRUCTURED_PRODUCT";
|
|
29
|
+
/** Strategy type not covered by other categories */
|
|
30
|
+
VaultStrategyType["OTHER"] = "OTHER";
|
|
31
|
+
})(VaultStrategyType || (VaultStrategyType = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { IntegrationSource } from './enums/IntegrationSource';
|
|
|
4
4
|
export { TransactionType } from './enums/TransactionType';
|
|
5
5
|
export { AccountType } from './enums/AccountType';
|
|
6
6
|
export { LendingPositionType } from './enums/LendingPositionType';
|
|
7
|
+
export { VaultStrategyType } from './enums/VaultStrategyType';
|
|
7
8
|
export { BaseEntity } from './interfaces/BaseEntity';
|
|
8
9
|
export { Metadata } from './interfaces/Metadata';
|
|
9
10
|
export { Asset } from './interfaces/Asset';
|
|
@@ -14,6 +15,7 @@ export { Balance } from './interfaces/Balance';
|
|
|
14
15
|
export { LiquidityPosition } from './interfaces/LiquidityPosition';
|
|
15
16
|
export { StakedPosition } from './interfaces/StakedPosition';
|
|
16
17
|
export { LendingPosition } from './interfaces/LendingPosition';
|
|
18
|
+
export { VaultPosition } from './interfaces/VaultPosition';
|
|
17
19
|
export { Account } from './interfaces/Account';
|
|
18
20
|
export { Portfolio } from './interfaces/Portfolio';
|
|
19
21
|
export { PortfolioAsset } from './interfaces/PortfolioAsset';
|
package/dist/index.js
CHANGED
|
@@ -5,3 +5,4 @@ export { IntegrationSource } from './enums/IntegrationSource';
|
|
|
5
5
|
export { TransactionType } from './enums/TransactionType';
|
|
6
6
|
export { AccountType } from './enums/AccountType';
|
|
7
7
|
export { LendingPositionType } from './enums/LendingPositionType';
|
|
8
|
+
export { VaultStrategyType } from './enums/VaultStrategyType';
|
|
@@ -4,6 +4,7 @@ import { Balance } from './Balance';
|
|
|
4
4
|
import { LiquidityPosition } from './LiquidityPosition';
|
|
5
5
|
import { StakedPosition } from './StakedPosition';
|
|
6
6
|
import { LendingPosition } from './LendingPosition';
|
|
7
|
+
import { VaultPosition } from './VaultPosition';
|
|
7
8
|
import { NFT } from './NFT';
|
|
8
9
|
import { Price } from './Price';
|
|
9
10
|
import { Metadata } from './Metadata';
|
|
@@ -105,6 +106,8 @@ export interface Account {
|
|
|
105
106
|
stakedPositions?: StakedPosition[];
|
|
106
107
|
/** Array of lending/borrowing positions (for DeFi money markets) */
|
|
107
108
|
lendingPositions?: LendingPosition[];
|
|
109
|
+
/** Array of yield vault positions (for vault deposits) */
|
|
110
|
+
vaultPositions?: VaultPosition[];
|
|
108
111
|
/** Array of NFTs held in this account */
|
|
109
112
|
nfts?: NFT[];
|
|
110
113
|
/** Total value of all holdings in this account (sum of all positions) */
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Chain } from '../enums/Chain';
|
|
2
|
+
import { VaultStrategyType } from '../enums/VaultStrategyType';
|
|
3
|
+
import { Asset } from './Asset';
|
|
4
|
+
import { Price } from './Price';
|
|
5
|
+
import { Metadata } from './Metadata';
|
|
6
|
+
/**
|
|
7
|
+
* Yield vault deposit position tracking shares and performance.
|
|
8
|
+
*
|
|
9
|
+
* Represents user deposits in yield-generating vaults (Yearn, Beefy, Harvest,
|
|
10
|
+
* Sommelier, etc.) where assets are deposited into a vault contract that
|
|
11
|
+
* executes automated strategies. Tracks deposited amount, vault share tokens,
|
|
12
|
+
* APY, and underlying asset.
|
|
13
|
+
*
|
|
14
|
+
* **Design Pattern:** DeFi position entity for vault operations. Vaults issue
|
|
15
|
+
* share tokens representing proportional ownership. The share price (pricePerShare)
|
|
16
|
+
* increases over time as the vault earns yield, meaning the same number of shares
|
|
17
|
+
* becomes redeemable for more underlying tokens.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { VaultPosition, VaultStrategyType, Chain, AssetType } from '@cygnus-wealth/data-models';
|
|
22
|
+
*
|
|
23
|
+
* // Yearn USDC vault deposit
|
|
24
|
+
* const yearnPosition: VaultPosition = {
|
|
25
|
+
* id: 'yearn-usdc-vault-123',
|
|
26
|
+
* protocol: 'Yearn V3',
|
|
27
|
+
* vaultAddress: '0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE',
|
|
28
|
+
* vaultName: 'USDC yVault',
|
|
29
|
+
* chain: Chain.ETHEREUM,
|
|
30
|
+
* strategyType: VaultStrategyType.YIELD_AGGREGATOR,
|
|
31
|
+
* depositAsset: {
|
|
32
|
+
* id: 'ethereum-usdc',
|
|
33
|
+
* symbol: 'USDC',
|
|
34
|
+
* name: 'USD Coin',
|
|
35
|
+
* type: AssetType.CRYPTOCURRENCY,
|
|
36
|
+
* decimals: 6
|
|
37
|
+
* },
|
|
38
|
+
* depositedAmount: '50000.000000',
|
|
39
|
+
* shareBalance: '48500.000000',
|
|
40
|
+
* pricePerShare: 1.0309,
|
|
41
|
+
* apy: 8.5,
|
|
42
|
+
* value: {
|
|
43
|
+
* value: 50000,
|
|
44
|
+
* currency: 'USD',
|
|
45
|
+
* timestamp: new Date()
|
|
46
|
+
* }
|
|
47
|
+
* };
|
|
48
|
+
*
|
|
49
|
+
* // Beefy auto-compounder on Arbitrum
|
|
50
|
+
* const beefyPosition: VaultPosition = {
|
|
51
|
+
* id: 'beefy-arb-eth-usdc-456',
|
|
52
|
+
* protocol: 'Beefy',
|
|
53
|
+
* vaultAddress: '0xDeadBeef...',
|
|
54
|
+
* vaultName: 'mooArbETH-USDC',
|
|
55
|
+
* chain: Chain.ARBITRUM,
|
|
56
|
+
* strategyType: VaultStrategyType.LIQUIDITY_PROVISION,
|
|
57
|
+
* depositAsset: {
|
|
58
|
+
* id: 'arbitrum-eth',
|
|
59
|
+
* symbol: 'ETH',
|
|
60
|
+
* name: 'Ethereum',
|
|
61
|
+
* type: AssetType.CRYPTOCURRENCY,
|
|
62
|
+
* decimals: 18
|
|
63
|
+
* },
|
|
64
|
+
* depositedAmount: '2.5',
|
|
65
|
+
* shareBalance: '2.35',
|
|
66
|
+
* pricePerShare: 1.0638,
|
|
67
|
+
* apy: 12.3,
|
|
68
|
+
* value: {
|
|
69
|
+
* value: 5000,
|
|
70
|
+
* currency: 'USD',
|
|
71
|
+
* timestamp: new Date()
|
|
72
|
+
* }
|
|
73
|
+
* };
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @since 1.2.0
|
|
77
|
+
* @stability extended
|
|
78
|
+
*
|
|
79
|
+
* @see {@link VaultStrategyType} for vault strategy classification
|
|
80
|
+
* @see {@link Asset} for deposit asset definition
|
|
81
|
+
* @see {@link Account} for position aggregation
|
|
82
|
+
*/
|
|
83
|
+
export interface VaultPosition {
|
|
84
|
+
/** Unique identifier for this vault position */
|
|
85
|
+
id: string;
|
|
86
|
+
/** Vault protocol name (e.g., 'Yearn V3', 'Beefy', 'Harvest', 'Sommelier') */
|
|
87
|
+
protocol: string;
|
|
88
|
+
/** Smart contract address of the vault */
|
|
89
|
+
vaultAddress: string;
|
|
90
|
+
/** Human-readable vault name (e.g., 'USDC yVault', 'mooArbETH-USDC') */
|
|
91
|
+
vaultName: string;
|
|
92
|
+
/** Blockchain network where the vault exists */
|
|
93
|
+
chain: Chain;
|
|
94
|
+
/** Classification of the vault's underlying strategy */
|
|
95
|
+
strategyType: VaultStrategyType;
|
|
96
|
+
/** Asset deposited into the vault (the underlying token) */
|
|
97
|
+
depositAsset: Asset;
|
|
98
|
+
/** Amount of underlying asset deposited (as string for precision) */
|
|
99
|
+
depositedAmount: string;
|
|
100
|
+
/** Amount of vault share tokens held (as string for precision) */
|
|
101
|
+
shareBalance?: string;
|
|
102
|
+
/** Current price per share in terms of deposit asset (e.g., 1.03 means 3% profit) */
|
|
103
|
+
pricePerShare?: number;
|
|
104
|
+
/** Annual Percentage Yield for the vault (e.g., 8.5 = 8.5%) */
|
|
105
|
+
apy?: number;
|
|
106
|
+
/** Current total value of the vault position */
|
|
107
|
+
value?: Price;
|
|
108
|
+
/** Protocol-specific metadata (strategy details, harvest frequency, TVL, etc.) */
|
|
109
|
+
metadata?: Metadata;
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|