@zofai/zo-sdk 0.1.93 → 0.1.94
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/consts/deployments-slp-mainnet.json +1 -1
- package/dist/consts/deployments-usdz-mainnet.json +1 -1
- package/dist/consts/deployments-zlp-mainnet.json +1 -1
- package/dist/implementations/SLPDataAPI.cjs +212 -47
- package/dist/implementations/SLPDataAPI.cjs.map +1 -1
- package/dist/implementations/SLPDataAPI.d.cts +8 -1
- package/dist/implementations/SLPDataAPI.d.cts.map +1 -1
- package/dist/implementations/SLPDataAPI.d.mts +8 -1
- package/dist/implementations/SLPDataAPI.d.mts.map +1 -1
- package/dist/implementations/SLPDataAPI.mjs +212 -47
- package/dist/implementations/SLPDataAPI.mjs.map +1 -1
- package/dist/implementations/USDZDataAPI.cjs +197 -44
- package/dist/implementations/USDZDataAPI.cjs.map +1 -1
- package/dist/implementations/USDZDataAPI.d.cts +8 -1
- package/dist/implementations/USDZDataAPI.d.cts.map +1 -1
- package/dist/implementations/USDZDataAPI.d.mts +8 -1
- package/dist/implementations/USDZDataAPI.d.mts.map +1 -1
- package/dist/implementations/USDZDataAPI.mjs +197 -44
- package/dist/implementations/USDZDataAPI.mjs.map +1 -1
- package/dist/implementations/ZLPDataAPI.cjs +200 -46
- package/dist/implementations/ZLPDataAPI.cjs.map +1 -1
- package/dist/implementations/ZLPDataAPI.d.cts +8 -1
- package/dist/implementations/ZLPDataAPI.d.cts.map +1 -1
- package/dist/implementations/ZLPDataAPI.d.mts +8 -1
- package/dist/implementations/ZLPDataAPI.d.mts.map +1 -1
- package/dist/implementations/ZLPDataAPI.mjs +200 -46
- package/dist/implementations/ZLPDataAPI.mjs.map +1 -1
- package/dist/interfaces/base.d.cts +22 -0
- package/dist/interfaces/base.d.cts.map +1 -1
- package/dist/interfaces/base.d.mts +22 -0
- package/dist/interfaces/base.d.mts.map +1 -1
- package/dist/interfaces/slp.d.cts +6 -1
- package/dist/interfaces/slp.d.cts.map +1 -1
- package/dist/interfaces/slp.d.mts +6 -1
- package/dist/interfaces/slp.d.mts.map +1 -1
- package/dist/interfaces/usdz.d.cts +6 -1
- package/dist/interfaces/usdz.d.cts.map +1 -1
- package/dist/interfaces/usdz.d.mts +6 -1
- package/dist/interfaces/usdz.d.mts.map +1 -1
- package/dist/interfaces/zlp.d.cts +6 -1
- package/dist/interfaces/zlp.d.cts.map +1 -1
- package/dist/interfaces/zlp.d.mts +6 -1
- package/dist/interfaces/zlp.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/consts/deployments-slp-mainnet.json +1 -1
- package/src/consts/deployments-usdz-mainnet.json +1 -1
- package/src/consts/deployments-zlp-mainnet.json +1 -1
- package/src/implementations/SLPDataAPI.ts +235 -19
- package/src/implementations/USDZDataAPI.ts +221 -16
- package/src/implementations/ZLPDataAPI.ts +222 -17
- package/src/interfaces/base.ts +26 -0
- package/src/interfaces/slp.ts +6 -0
- package/src/interfaces/usdz.ts +6 -0
- package/src/interfaces/zlp.ts +6 -0
package/src/interfaces/base.ts
CHANGED
|
@@ -18,6 +18,32 @@ export interface IBaseMarketValuationInfo {
|
|
|
18
18
|
apr?: number
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
export interface ISwapFeeBreakdown {
|
|
22
|
+
/** Swap notional value (in USD terms using oracle prices) */
|
|
23
|
+
swapValue: number
|
|
24
|
+
/** Total value of all vaults (in USD terms using oracle prices) */
|
|
25
|
+
totalVaultsValue: number
|
|
26
|
+
|
|
27
|
+
/** Rebase fee rate applied to swap-in leg (source token) */
|
|
28
|
+
rebaseFeeInRate: number
|
|
29
|
+
/** Rebase fee rate applied to swap-out leg (dest token) */
|
|
30
|
+
rebaseFeeOutRate: number
|
|
31
|
+
/** Rebase fee value for swap-in leg (USD value) */
|
|
32
|
+
rebaseFeeInValue: number
|
|
33
|
+
/** Rebase fee value for swap-out leg (USD value) */
|
|
34
|
+
rebaseFeeOutValue: number
|
|
35
|
+
|
|
36
|
+
/** Swap impact fee value (USD value) */
|
|
37
|
+
swapImpactFeeValue: number
|
|
38
|
+
/** EMA volatility fee value (USD value) */
|
|
39
|
+
emaVolatilityFeeValue: number
|
|
40
|
+
|
|
41
|
+
/** Sum of all fee components (USD value) */
|
|
42
|
+
totalFeeValue: number
|
|
43
|
+
/** totalFeeValue / swapValue (0 when swapValue is 0) */
|
|
44
|
+
totalFeeRate: number
|
|
45
|
+
}
|
|
46
|
+
|
|
21
47
|
export interface IBaseMarketInfo {
|
|
22
48
|
lpSupply: string
|
|
23
49
|
positionId: string
|
package/src/interfaces/slp.ts
CHANGED
|
@@ -25,6 +25,7 @@ import type {
|
|
|
25
25
|
IBaseStakePool,
|
|
26
26
|
IBaseSymbolInfo,
|
|
27
27
|
IBaseVaultInfo,
|
|
28
|
+
ISwapFeeBreakdown,
|
|
28
29
|
} from './base'
|
|
29
30
|
|
|
30
31
|
// SLP-specific interfaces
|
|
@@ -102,6 +103,10 @@ export interface ISLPOiFundingState {
|
|
|
102
103
|
enabled: boolean
|
|
103
104
|
last_update: number
|
|
104
105
|
model: ISLPOiFundingModel
|
|
106
|
+
/** OI cap for long side (optional; when set with maxOiShort, uses capped skew formula) */
|
|
107
|
+
maxOiLong?: number
|
|
108
|
+
/** OI cap for short side (optional; when set with maxOiLong, uses capped skew formula) */
|
|
109
|
+
maxOiShort?: number
|
|
105
110
|
}
|
|
106
111
|
|
|
107
112
|
/**
|
|
@@ -211,6 +216,7 @@ export interface ISLPDataAPI extends IBaseDataAPI {
|
|
|
211
216
|
getCumulativeApr: () => Promise<number>
|
|
212
217
|
getSymbolConfig: (indexToken: string, long: boolean) => Promise<ISLPSymbolConfig | null>
|
|
213
218
|
getPriceImpactConfig: (indexToken: string) => Promise<ISLPPriceImpactConfig | null>
|
|
219
|
+
calculateSwapFeeBreakdown: (fromToken: string, toToken: string, fromAmount: number) => Promise<ISwapFeeBreakdown>
|
|
214
220
|
}
|
|
215
221
|
|
|
216
222
|
// SLP-specific API interface
|
package/src/interfaces/usdz.ts
CHANGED
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
IBaseStakePool,
|
|
24
24
|
IBaseSymbolInfo,
|
|
25
25
|
IBaseVaultInfo,
|
|
26
|
+
ISwapFeeBreakdown,
|
|
26
27
|
} from './base'
|
|
27
28
|
|
|
28
29
|
// USDZ-specific interfaces
|
|
@@ -103,6 +104,10 @@ export interface IUSDZOiFundingState {
|
|
|
103
104
|
enabled: boolean
|
|
104
105
|
last_update: number
|
|
105
106
|
model: IUSDZOiFundingModel
|
|
107
|
+
/** OI cap for long side (optional; when set with maxOiShort, uses capped skew formula) */
|
|
108
|
+
maxOiLong?: number
|
|
109
|
+
/** OI cap for short side (optional; when set with maxOiLong, uses capped skew formula) */
|
|
110
|
+
maxOiShort?: number
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
/**
|
|
@@ -133,6 +138,7 @@ export interface IUSDZPriceImpactConfig {
|
|
|
133
138
|
export interface IUSDZDataAPI extends IBaseDataAPI {
|
|
134
139
|
getSymbolConfig: (indexToken: string, long: boolean) => Promise<IUSDZSymbolConfig | null>
|
|
135
140
|
getPriceImpactConfig: (indexToken: string) => Promise<IUSDZPriceImpactConfig | null>
|
|
141
|
+
calculateSwapFeeBreakdown: (fromToken: string, toToken: string, fromAmount: number) => Promise<ISwapFeeBreakdown>
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
// USDZ-specific API interface
|
package/src/interfaces/zlp.ts
CHANGED
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
IBaseStakePool,
|
|
24
24
|
IBaseSymbolInfo,
|
|
25
25
|
IBaseVaultInfo,
|
|
26
|
+
ISwapFeeBreakdown,
|
|
26
27
|
} from './base'
|
|
27
28
|
|
|
28
29
|
// ZLP-specific interfaces
|
|
@@ -103,6 +104,10 @@ export interface IZLPOiFundingState {
|
|
|
103
104
|
enabled: boolean
|
|
104
105
|
last_update: number
|
|
105
106
|
model: IZLPOiFundingModel
|
|
107
|
+
/** OI cap for long side (optional; when set with maxOiShort, uses capped skew formula) */
|
|
108
|
+
maxOiLong?: number
|
|
109
|
+
/** OI cap for short side (optional; when set with maxOiLong, uses capped skew formula) */
|
|
110
|
+
maxOiShort?: number
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
/**
|
|
@@ -133,6 +138,7 @@ export interface IZLPPriceImpactConfig {
|
|
|
133
138
|
export interface IZLPDataAPI extends IBaseDataAPI {
|
|
134
139
|
getSymbolConfig: (indexToken: string, long: boolean) => Promise<IZLPSymbolConfig | null>
|
|
135
140
|
getPriceImpactConfig: (indexToken: string) => Promise<IZLPPriceImpactConfig | null>
|
|
141
|
+
calculateSwapFeeBreakdown: (fromToken: string, toToken: string, fromAmount: number) => Promise<ISwapFeeBreakdown>
|
|
136
142
|
}
|
|
137
143
|
|
|
138
144
|
// ZLP-specific API interface
|