@steerprotocol/sdk 1.19.14 → 1.19.16
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/README.md +281 -11
- package/dist/cjs/base/VaultClient.js +95 -1
- package/dist/cjs/base/VaultClient.js.map +1 -1
- package/dist/cjs/base/vault/single-asset/calculateLimitPrice.js +231 -0
- package/dist/cjs/base/vault/single-asset/calculateLimitPrice.js.map +1 -0
- package/dist/cjs/base/vault/single-asset/calculateSwapAmount.js +68 -0
- package/dist/cjs/base/vault/single-asset/calculateSwapAmount.js.map +1 -0
- package/dist/cjs/base/vault/single-asset/estimateLpTokens.js +355 -0
- package/dist/cjs/base/vault/single-asset/estimateLpTokens.js.map +1 -0
- package/dist/cjs/base/vault/single-asset/index.js +109 -0
- package/dist/cjs/base/vault/single-asset/index.js.map +1 -0
- package/dist/cjs/base/vault/single-asset/simulateSwap.js +291 -0
- package/dist/cjs/base/vault/single-asset/simulateSwap.js.map +1 -0
- package/dist/cjs/base/vault/single-asset/singleAssetDeposit.js +324 -0
- package/dist/cjs/base/vault/single-asset/singleAssetDeposit.js.map +1 -0
- package/dist/cjs/base/vault/single-asset/types.js +15 -0
- package/dist/cjs/base/vault/single-asset/types.js.map +1 -0
- package/dist/cjs/base/vault/utils.js +229 -18
- package/dist/cjs/base/vault/utils.js.map +1 -1
- package/dist/cjs/const/abis/index.js +3 -0
- package/dist/cjs/const/abis/index.js.map +1 -1
- package/dist/cjs/const/abis/quoter.js +248 -0
- package/dist/cjs/const/abis/quoter.js.map +1 -0
- package/dist/cjs/const/abis/singleTokenDeposit.js +925 -0
- package/dist/cjs/const/abis/singleTokenDeposit.js.map +1 -0
- package/dist/cjs/const/amm/configs/protocols/quickswap-integral.js +3 -0
- package/dist/cjs/const/amm/configs/protocols/quickswap-integral.js.map +1 -1
- package/dist/cjs/const/amm/configs/protocols/uniswap.js +15 -0
- package/dist/cjs/const/amm/configs/protocols/uniswap.js.map +1 -1
- package/dist/cjs/const/deployments/abis.js +277 -0
- package/dist/cjs/const/deployments/abis.js.map +1 -1
- package/dist/cjs/const/deployments/polygon.js +8 -0
- package/dist/cjs/const/deployments/polygon.js.map +1 -1
- package/dist/cjs/const/index.js +6 -5
- package/dist/cjs/const/index.js.map +1 -1
- package/dist/cjs/const/network.js.map +1 -1
- package/dist/cjs/const/quoter.js +38 -0
- package/dist/cjs/const/quoter.js.map +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/base/VaultClient.js +81 -1
- package/dist/esm/base/VaultClient.js.map +1 -1
- package/dist/esm/base/vault/single-asset/calculateLimitPrice.js +224 -0
- package/dist/esm/base/vault/single-asset/calculateLimitPrice.js.map +1 -0
- package/dist/esm/base/vault/single-asset/calculateSwapAmount.js +65 -0
- package/dist/esm/base/vault/single-asset/calculateSwapAmount.js.map +1 -0
- package/dist/esm/base/vault/single-asset/estimateLpTokens.js +350 -0
- package/dist/esm/base/vault/single-asset/estimateLpTokens.js.map +1 -0
- package/dist/esm/base/vault/single-asset/index.js +83 -0
- package/dist/esm/base/vault/single-asset/index.js.map +1 -0
- package/dist/esm/base/vault/single-asset/simulateSwap.js +285 -0
- package/dist/esm/base/vault/single-asset/simulateSwap.js.map +1 -0
- package/dist/esm/base/vault/single-asset/singleAssetDeposit.js +320 -0
- package/dist/esm/base/vault/single-asset/singleAssetDeposit.js.map +1 -0
- package/dist/esm/base/vault/single-asset/types.js +12 -0
- package/dist/esm/base/vault/single-asset/types.js.map +1 -0
- package/dist/esm/base/vault/utils.js +226 -18
- package/dist/esm/base/vault/utils.js.map +1 -1
- package/dist/esm/const/abis/index.js +3 -0
- package/dist/esm/const/abis/index.js.map +1 -1
- package/dist/esm/const/abis/quoter.js +245 -0
- package/dist/esm/const/abis/quoter.js.map +1 -0
- package/dist/esm/const/abis/singleTokenDeposit.js +922 -0
- package/dist/esm/const/abis/singleTokenDeposit.js.map +1 -0
- package/dist/esm/const/amm/configs/protocols/quickswap-integral.js +3 -0
- package/dist/esm/const/amm/configs/protocols/quickswap-integral.js.map +1 -1
- package/dist/esm/const/amm/configs/protocols/uniswap.js +15 -0
- package/dist/esm/const/amm/configs/protocols/uniswap.js.map +1 -1
- package/dist/esm/const/deployments/abis.js +277 -0
- package/dist/esm/const/deployments/abis.js.map +1 -1
- package/dist/esm/const/deployments/polygon.js +8 -0
- package/dist/esm/const/deployments/polygon.js.map +1 -1
- package/dist/esm/const/index.js +6 -5
- package/dist/esm/const/index.js.map +1 -1
- package/dist/esm/const/network.js.map +1 -1
- package/dist/esm/const/quoter.js +34 -0
- package/dist/esm/const/quoter.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/types/base/VaultClient.d.ts +136 -4
- package/dist/types/base/VaultClient.d.ts.map +1 -1
- package/dist/types/base/vault/single-asset/calculateLimitPrice.d.ts +59 -0
- package/dist/types/base/vault/single-asset/calculateLimitPrice.d.ts.map +1 -0
- package/dist/types/base/vault/single-asset/calculateSwapAmount.d.ts +30 -0
- package/dist/types/base/vault/single-asset/calculateSwapAmount.d.ts.map +1 -0
- package/dist/types/base/vault/single-asset/estimateLpTokens.d.ts +61 -0
- package/dist/types/base/vault/single-asset/estimateLpTokens.d.ts.map +1 -0
- package/dist/types/base/vault/single-asset/index.d.ts +80 -0
- package/dist/types/base/vault/single-asset/index.d.ts.map +1 -0
- package/dist/types/base/vault/single-asset/simulateSwap.d.ts +119 -0
- package/dist/types/base/vault/single-asset/simulateSwap.d.ts.map +1 -0
- package/dist/types/base/vault/single-asset/singleAssetDeposit.d.ts +141 -0
- package/dist/types/base/vault/single-asset/singleAssetDeposit.d.ts.map +1 -0
- package/dist/types/base/vault/single-asset/types.d.ts +167 -0
- package/dist/types/base/vault/single-asset/types.d.ts.map +1 -0
- package/dist/types/base/vault/utils.d.ts +95 -0
- package/dist/types/base/vault/utils.d.ts.map +1 -1
- package/dist/types/const/abis/index.d.ts +3 -0
- package/dist/types/const/abis/index.d.ts.map +1 -1
- package/dist/types/const/abis/quoter.d.ts +206 -0
- package/dist/types/const/abis/quoter.d.ts.map +1 -0
- package/dist/types/const/abis/singleTokenDeposit.d.ts +47 -0
- package/dist/types/const/abis/singleTokenDeposit.d.ts.map +1 -0
- package/dist/types/const/amm/configs/protocols/quickswap-integral.d.ts.map +1 -1
- package/dist/types/const/amm/configs/protocols/uniswap.d.ts.map +1 -1
- package/dist/types/const/deployments/abis.d.ts +215 -0
- package/dist/types/const/deployments/abis.d.ts.map +1 -1
- package/dist/types/const/deployments/polygon.d.ts.map +1 -1
- package/dist/types/const/index.d.ts +6 -5
- package/dist/types/const/index.d.ts.map +1 -1
- package/dist/types/const/network.d.ts +2 -0
- package/dist/types/const/network.d.ts.map +1 -1
- package/dist/types/const/quoter.d.ts +17 -0
- package/dist/types/const/quoter.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +3 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { abis } from '../../../const/deployments/abis';
|
|
2
|
+
import { getContractAddressByChainIdAndContractName } from '../../../const/network';
|
|
3
|
+
// Use the vault ABI for reading vault state
|
|
4
|
+
const VAULT_ABI = abis.QuickSwapUniv3MultiPositionLiquidityManager;
|
|
5
|
+
/**
|
|
6
|
+
* Estimates the amount of LP tokens that will be received based on the final token amounts
|
|
7
|
+
* This calculation follows the Solidity getShares implementation from the vault contract
|
|
8
|
+
*
|
|
9
|
+
* @param publicClient - Viem public client for blockchain reads
|
|
10
|
+
* @param params - Parameters for LP token estimation
|
|
11
|
+
* @returns Promise resolving to the estimated LP tokens and final amounts
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const result = await estimateLpTokens(publicClient, {
|
|
16
|
+
* vault: '0x...',
|
|
17
|
+
* originalAssets: parseEther('100'),
|
|
18
|
+
* swapAmount: parseEther('50'),
|
|
19
|
+
* swapResult: { amount0: -parseEther('50'), amount1: parseEther('150') },
|
|
20
|
+
* isToken0: true
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* if (result.success) {
|
|
24
|
+
* console.log('Estimated LP tokens:', result.data.lpTokens);
|
|
25
|
+
* console.log('Final amount0:', result.data.finalAmount0);
|
|
26
|
+
* console.log('Final amount1:', result.data.finalAmount1);
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export async function estimateLpTokens(publicClient, params) {
|
|
31
|
+
try {
|
|
32
|
+
// Calculate final amounts based on original deposit and swap results
|
|
33
|
+
const finalAmount0 = params.isToken0
|
|
34
|
+
? params.originalAssets - params.swapAmount + (params.swapResult.amount0 < 0n ? -params.swapResult.amount0 : params.swapResult.amount0)
|
|
35
|
+
: (params.swapResult.amount0 < 0n ? -params.swapResult.amount0 : params.swapResult.amount0);
|
|
36
|
+
const finalAmount1 = params.isToken0
|
|
37
|
+
? (params.swapResult.amount1 < 0n ? -params.swapResult.amount1 : params.swapResult.amount1)
|
|
38
|
+
: params.originalAssets - params.swapAmount + (params.swapResult.amount1 < 0n ? -params.swapResult.amount1 : params.swapResult.amount1);
|
|
39
|
+
// Get vault reserves and total supply
|
|
40
|
+
const [totalSupply, tokenBalances] = await Promise.all([
|
|
41
|
+
publicClient.readContract({
|
|
42
|
+
address: params.vault,
|
|
43
|
+
abi: [{
|
|
44
|
+
"inputs": [],
|
|
45
|
+
"name": "totalSupply",
|
|
46
|
+
"outputs": [
|
|
47
|
+
{
|
|
48
|
+
"internalType": "uint256",
|
|
49
|
+
"name": "",
|
|
50
|
+
"type": "uint256"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"stateMutability": "view",
|
|
54
|
+
"type": "function"
|
|
55
|
+
},],
|
|
56
|
+
functionName: 'totalSupply'
|
|
57
|
+
}),
|
|
58
|
+
// Get token0 address first, then balance
|
|
59
|
+
publicClient.readContract({
|
|
60
|
+
address: params.vault,
|
|
61
|
+
abi: [{
|
|
62
|
+
"inputs": [],
|
|
63
|
+
"name": "getTotalAmounts",
|
|
64
|
+
"outputs": [
|
|
65
|
+
{
|
|
66
|
+
"internalType": "uint256",
|
|
67
|
+
"name": "total0",
|
|
68
|
+
"type": "uint256"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"internalType": "uint256",
|
|
72
|
+
"name": "total1",
|
|
73
|
+
"type": "uint256"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"stateMutability": "view",
|
|
77
|
+
"type": "function"
|
|
78
|
+
},],
|
|
79
|
+
functionName: 'getTotalAmounts'
|
|
80
|
+
})
|
|
81
|
+
]);
|
|
82
|
+
const chainId = await publicClient.getChainId();
|
|
83
|
+
const helper = getContractAddressByChainIdAndContractName(chainId, 'Helper');
|
|
84
|
+
const [shares, amount0Used, amount1Used] = await publicClient.readContract({
|
|
85
|
+
address: helper,
|
|
86
|
+
abi: [{
|
|
87
|
+
"inputs": [
|
|
88
|
+
{
|
|
89
|
+
"internalType": "uint256",
|
|
90
|
+
"name": "_totalSupply",
|
|
91
|
+
"type": "uint256"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"internalType": "uint256",
|
|
95
|
+
"name": "total0",
|
|
96
|
+
"type": "uint256"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"internalType": "uint256",
|
|
100
|
+
"name": "total1",
|
|
101
|
+
"type": "uint256"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"internalType": "uint256",
|
|
105
|
+
"name": "amount0Desired",
|
|
106
|
+
"type": "uint256"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"internalType": "uint256",
|
|
110
|
+
"name": "amount1Desired",
|
|
111
|
+
"type": "uint256"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"internalType": "uint256",
|
|
115
|
+
"name": "amount0Min",
|
|
116
|
+
"type": "uint256"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"internalType": "uint256",
|
|
120
|
+
"name": "amount1Min",
|
|
121
|
+
"type": "uint256"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"internalType": "uint256",
|
|
125
|
+
"name": "minShares",
|
|
126
|
+
"type": "uint256"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"name": "getShares",
|
|
130
|
+
"outputs": [
|
|
131
|
+
{
|
|
132
|
+
"internalType": "uint256",
|
|
133
|
+
"name": "shares",
|
|
134
|
+
"type": "uint256"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"internalType": "uint256",
|
|
138
|
+
"name": "amount0Used",
|
|
139
|
+
"type": "uint256"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"internalType": "uint256",
|
|
143
|
+
"name": "amount1Used",
|
|
144
|
+
"type": "uint256"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"stateMutability": "pure",
|
|
148
|
+
"type": "function"
|
|
149
|
+
}],
|
|
150
|
+
functionName: 'getShares',
|
|
151
|
+
args: [
|
|
152
|
+
totalSupply,
|
|
153
|
+
tokenBalances[0],
|
|
154
|
+
tokenBalances[1],
|
|
155
|
+
finalAmount0,
|
|
156
|
+
finalAmount1,
|
|
157
|
+
0n, // amount0Min = 0 as requested
|
|
158
|
+
0n, // amount1Min = 0 as requested
|
|
159
|
+
0n // minShares = 0
|
|
160
|
+
]
|
|
161
|
+
});
|
|
162
|
+
return {
|
|
163
|
+
data: {
|
|
164
|
+
lpTokens: shares,
|
|
165
|
+
finalAmount0: amount0Used,
|
|
166
|
+
finalAmount1: amount1Used
|
|
167
|
+
},
|
|
168
|
+
status: 200,
|
|
169
|
+
success: true
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
return {
|
|
174
|
+
data: null,
|
|
175
|
+
status: 500,
|
|
176
|
+
success: false,
|
|
177
|
+
error: error instanceof Error ? error.message : 'Failed to estimate LP tokens'
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Calculates shares (LP tokens) based on deposit amounts and vault reserves
|
|
183
|
+
* This is a TypeScript implementation of the Solidity getShares function
|
|
184
|
+
*
|
|
185
|
+
* @param totalSupply - Current total supply of LP tokens
|
|
186
|
+
* @param total0 - Current balance of token0 in vault
|
|
187
|
+
* @param total1 - Current balance of token1 in vault
|
|
188
|
+
* @param amount0Desired - Desired amount of token0 to deposit
|
|
189
|
+
* @param amount1Desired - Desired amount of token1 to deposit
|
|
190
|
+
* @param amount0Min - Minimum amount of token0 (set to 0n)
|
|
191
|
+
* @param amount1Min - Minimum amount of token1 (set to 0n)
|
|
192
|
+
* @param minShares - Minimum shares required (set to 0n)
|
|
193
|
+
* @returns Object with shares, amount0Used, and amount1Used
|
|
194
|
+
*/
|
|
195
|
+
export function getShares(totalSupply, total0, total1, amount0Desired, amount1Desired, amount0Min, amount1Min, minShares) {
|
|
196
|
+
// If total supply > 0, vault can't be empty.
|
|
197
|
+
if (!(totalSupply === 0n || total0 > 0n || total1 > 0n)) {
|
|
198
|
+
throw new Error('Invalid vault state');
|
|
199
|
+
}
|
|
200
|
+
let shares;
|
|
201
|
+
let amount0Used = 0n;
|
|
202
|
+
let amount1Used = 0n;
|
|
203
|
+
if (totalSupply === 0n) {
|
|
204
|
+
// For first deposit, just use the amounts desired
|
|
205
|
+
amount0Used = amount0Desired;
|
|
206
|
+
amount1Used = amount1Desired;
|
|
207
|
+
shares = amount0Used > amount1Used ? amount0Used : amount1Used;
|
|
208
|
+
if (shares < minShares) {
|
|
209
|
+
throw new Error('Insufficient shares for minimum requirement');
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else if (total0 === 0n) {
|
|
213
|
+
// Vault only has token1
|
|
214
|
+
shares = mulDiv(amount1Desired, totalSupply, total1);
|
|
215
|
+
amount1Used = mulDivRoundingUp(shares, total1, totalSupply);
|
|
216
|
+
amount0Used = 0n;
|
|
217
|
+
}
|
|
218
|
+
else if (total1 === 0n) {
|
|
219
|
+
// Vault only has token0
|
|
220
|
+
shares = mulDiv(amount0Desired, totalSupply, total0);
|
|
221
|
+
amount0Used = mulDivRoundingUp(shares, total0, totalSupply);
|
|
222
|
+
amount1Used = 0n;
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// Both tokens present - calculate cross product
|
|
226
|
+
const cross = min(amount0Desired * total1, amount1Desired * total0);
|
|
227
|
+
if (cross === 0n) {
|
|
228
|
+
throw new Error('Invalid deposit ratio - cross product is zero');
|
|
229
|
+
}
|
|
230
|
+
// Round up amounts
|
|
231
|
+
amount0Used = ((cross - 1n) / total1) + 1n;
|
|
232
|
+
amount1Used = ((cross - 1n) / total0) + 1n;
|
|
233
|
+
shares = mulDiv(cross, totalSupply, total0) / total1;
|
|
234
|
+
}
|
|
235
|
+
// Validate requirements
|
|
236
|
+
if (shares === 0n) {
|
|
237
|
+
throw new Error('Zero shares calculated');
|
|
238
|
+
}
|
|
239
|
+
if (amount0Used < amount0Min) {
|
|
240
|
+
throw new Error('Amount0 used less than minimum');
|
|
241
|
+
}
|
|
242
|
+
if (amount1Used < amount1Min) {
|
|
243
|
+
throw new Error('Amount1 used less than minimum');
|
|
244
|
+
}
|
|
245
|
+
return { shares, amount0Used, amount1Used };
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Multiplies two BigInt values and divides by a third (a * b / c)
|
|
249
|
+
* Equivalent to Solidity's FullMath.mulDiv
|
|
250
|
+
*/
|
|
251
|
+
function mulDiv(a, b, c) {
|
|
252
|
+
if (c === 0n) {
|
|
253
|
+
throw new Error('Division by zero');
|
|
254
|
+
}
|
|
255
|
+
return (a * b) / c;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Multiplies two BigInt values, divides by a third, and rounds up
|
|
259
|
+
* Equivalent to Solidity's FullMath.mulDivRoundingUp
|
|
260
|
+
*/
|
|
261
|
+
function mulDivRoundingUp(a, b, c) {
|
|
262
|
+
if (c === 0n) {
|
|
263
|
+
throw new Error('Division by zero');
|
|
264
|
+
}
|
|
265
|
+
const result = (a * b) / c;
|
|
266
|
+
const remainder = (a * b) % c;
|
|
267
|
+
return remainder > 0n ? result + 1n : result;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Returns the minimum of two BigInt values
|
|
271
|
+
*/
|
|
272
|
+
function min(a, b) {
|
|
273
|
+
return a < b ? a : b;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Gets the current vault reserves for both tokens
|
|
277
|
+
*
|
|
278
|
+
* @param publicClient - Viem public client for blockchain reads
|
|
279
|
+
* @param vaultAddress - Address of the vault
|
|
280
|
+
* @returns Promise resolving to [token0Balance, token1Balance, totalSupply]
|
|
281
|
+
*/
|
|
282
|
+
export async function getVaultReserves(publicClient, vaultAddress) {
|
|
283
|
+
try {
|
|
284
|
+
const [totalSupply, token0Address, token1Address] = await Promise.all([
|
|
285
|
+
publicClient.readContract({
|
|
286
|
+
address: vaultAddress,
|
|
287
|
+
abi: VAULT_ABI,
|
|
288
|
+
functionName: 'totalSupply'
|
|
289
|
+
}),
|
|
290
|
+
publicClient.readContract({
|
|
291
|
+
address: vaultAddress,
|
|
292
|
+
abi: VAULT_ABI,
|
|
293
|
+
functionName: 'token0'
|
|
294
|
+
}),
|
|
295
|
+
publicClient.readContract({
|
|
296
|
+
address: vaultAddress,
|
|
297
|
+
abi: VAULT_ABI,
|
|
298
|
+
functionName: 'token1'
|
|
299
|
+
})
|
|
300
|
+
]);
|
|
301
|
+
const [token0Balance, token1Balance] = await Promise.all([
|
|
302
|
+
publicClient.readContract({
|
|
303
|
+
address: token0Address,
|
|
304
|
+
abi: [
|
|
305
|
+
{
|
|
306
|
+
type: 'function',
|
|
307
|
+
name: 'balanceOf',
|
|
308
|
+
inputs: [{ name: 'account', type: 'address', internalType: 'address' }],
|
|
309
|
+
outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
|
|
310
|
+
stateMutability: 'view'
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
functionName: 'balanceOf',
|
|
314
|
+
args: [vaultAddress]
|
|
315
|
+
}),
|
|
316
|
+
publicClient.readContract({
|
|
317
|
+
address: token1Address,
|
|
318
|
+
abi: [
|
|
319
|
+
{
|
|
320
|
+
type: 'function',
|
|
321
|
+
name: 'balanceOf',
|
|
322
|
+
inputs: [{ name: 'account', type: 'address', internalType: 'address' }],
|
|
323
|
+
outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
|
|
324
|
+
stateMutability: 'view'
|
|
325
|
+
}
|
|
326
|
+
],
|
|
327
|
+
functionName: 'balanceOf',
|
|
328
|
+
args: [vaultAddress]
|
|
329
|
+
})
|
|
330
|
+
]);
|
|
331
|
+
return {
|
|
332
|
+
data: {
|
|
333
|
+
token0Balance,
|
|
334
|
+
token1Balance,
|
|
335
|
+
totalSupply
|
|
336
|
+
},
|
|
337
|
+
status: 200,
|
|
338
|
+
success: true
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
catch (error) {
|
|
342
|
+
return {
|
|
343
|
+
data: null,
|
|
344
|
+
status: 500,
|
|
345
|
+
success: false,
|
|
346
|
+
error: error instanceof Error ? error.message : 'Failed to get vault reserves'
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=estimateLpTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateLpTokens.js","sourceRoot":"","sources":["../../../../../src/base/vault/single-asset/estimateLpTokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,0CAA0C,EAAE,MAAM,wBAAwB,CAAC;AAIpF,4CAA4C;AAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,2CAA2C,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;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BACb,WAAW;aACZ;YACD,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,8BAA8B;SAC/E,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Export all types
|
|
2
|
+
export * from './types';
|
|
3
|
+
// Export individual functions for separate testing and usage
|
|
4
|
+
export { calculateSwapAmount } from './calculateSwapAmount';
|
|
5
|
+
export { calculateLimitPrice, getPoolSlot0 } from './calculateLimitPrice';
|
|
6
|
+
export { simulateSwap, determineSwapDirection, validateSwapParams } from './simulateSwap';
|
|
7
|
+
export { estimateLpTokens, getVaultReserves } from './estimateLpTokens';
|
|
8
|
+
// Export the main client
|
|
9
|
+
export { SingleAssetDepositClient } from './singleAssetDeposit';
|
|
10
|
+
/**
|
|
11
|
+
* @fileoverview Single-Asset Deposit Module
|
|
12
|
+
*
|
|
13
|
+
* This module provides comprehensive functionality for single-asset deposits into liquidity vaults.
|
|
14
|
+
* The process allows users to deposit only one token (token0 or token1), while the contract
|
|
15
|
+
* internally performs a swap to balance the token pair before depositing into the vault.
|
|
16
|
+
*
|
|
17
|
+
* ## Architecture
|
|
18
|
+
*
|
|
19
|
+
* The single-asset deposit process is broken down into separate, testable functions:
|
|
20
|
+
*
|
|
21
|
+
* 1. **calculateSwapAmount** - Determines how much of the input token needs to be swapped
|
|
22
|
+
* 2. **calculateLimitPrice** - Calculates slippage protection limits for the internal swap
|
|
23
|
+
* 3. **simulateSwap** - Simulates the swap to preview expected output amounts
|
|
24
|
+
* 4. **estimateLpTokens** - Estimates the final LP tokens that will be received
|
|
25
|
+
* 5. **SingleAssetDepositClient** - Main orchestrator that combines all steps
|
|
26
|
+
*
|
|
27
|
+
* ## Supported AMM Types
|
|
28
|
+
*
|
|
29
|
+
* Currently supports:
|
|
30
|
+
* - UniswapV3 (fully implemented)
|
|
31
|
+
* - Algebra variants (planned for future implementation)
|
|
32
|
+
*
|
|
33
|
+
* ## Example Usage
|
|
34
|
+
*
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import { SingleAssetDepositClient, AMMType } from '@steerprotocol/sdk';
|
|
37
|
+
* import { parseEther } from 'viem';
|
|
38
|
+
*
|
|
39
|
+
* // Initialize the client
|
|
40
|
+
* const client = new SingleAssetDepositClient(publicClient, walletClient);
|
|
41
|
+
*
|
|
42
|
+
* // Preview the deposit
|
|
43
|
+
* const preview = await client.previewDeposit({
|
|
44
|
+
* assets: parseEther('100'),
|
|
45
|
+
* receiver: userAddress,
|
|
46
|
+
* vault: vaultAddress,
|
|
47
|
+
* isToken0: true,
|
|
48
|
+
* depositSlippagePercent: 5n,
|
|
49
|
+
* swapSlippageBP: 500,
|
|
50
|
+
* ammType: AMMType.UniswapV3,
|
|
51
|
+
* singleAssetDepositContract: contractAddress
|
|
52
|
+
* }, poolAddress);
|
|
53
|
+
*
|
|
54
|
+
* if (preview.success) {
|
|
55
|
+
* console.log('Expected LP tokens:', preview.data.lpEstimation.lpTokens);
|
|
56
|
+
*
|
|
57
|
+
* // Execute the deposit
|
|
58
|
+
* const result = await client.deposit(params);
|
|
59
|
+
* if (result.success) {
|
|
60
|
+
* console.log('Transaction hash:', result.data);
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* ## Testing Individual Functions
|
|
66
|
+
*
|
|
67
|
+
* Each function can be tested separately:
|
|
68
|
+
*
|
|
69
|
+
* ```typescript
|
|
70
|
+
* import { calculateSwapAmount, AMMType } from '@steerprotocol/sdk';
|
|
71
|
+
*
|
|
72
|
+
* // Test swap amount calculation
|
|
73
|
+
* const result = await calculateSwapAmount(publicClient, {
|
|
74
|
+
* depositAmount: parseEther('100'),
|
|
75
|
+
* isToken0: true,
|
|
76
|
+
* vault: vaultAddress,
|
|
77
|
+
* pool: poolAddress,
|
|
78
|
+
* ammType: AMMType.UniswapV3,
|
|
79
|
+
* singleAssetDepositContract: contractAddress
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/vault/single-asset/index.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,cAAc,SAAS,CAAC;AAExB,6DAA6D;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAExE,yBAAyB;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG"}
|