@curvefi/llamalend-api 1.1.10 → 2.0.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/docs/MIGRATION.md +325 -0
- package/docs/SUPPORT_LLv2.md +409 -0
- package/lib/constants/abis/OneWayLendingFactoryV2ABI.json +543 -0
- package/lib/constants/aliases.d.ts +0 -11
- package/lib/constants/aliases.js +1 -86
- package/lib/constants/coins.d.ts +0 -11
- package/lib/constants/coins.js +0 -14
- package/lib/constants/utils.d.ts +2 -0
- package/lib/constants/utils.js +2 -0
- package/lib/index.d.ts +10 -4
- package/lib/interfaces.d.ts +3 -2
- package/lib/lendMarkets/LendMarketTemplate.d.ts +13 -502
- package/lib/lendMarkets/LendMarketTemplate.js +237 -2860
- package/lib/lendMarkets/fetch/fetchFactoryData.d.ts +13 -0
- package/lib/lendMarkets/fetch/fetchFactoryData.js +101 -0
- package/lib/lendMarkets/fetch/fetchLendMarkets.d.ts +3 -0
- package/lib/lendMarkets/fetch/fetchLendMarkets.js +94 -0
- package/lib/lendMarkets/interfaces/common/amm.d.ts +10 -0
- package/lib/lendMarkets/interfaces/common/amm.js +1 -0
- package/lib/lendMarkets/interfaces/common/index.d.ts +5 -0
- package/lib/lendMarkets/interfaces/common/index.js +5 -0
- package/lib/lendMarkets/interfaces/common/prices.d.ts +13 -0
- package/lib/lendMarkets/interfaces/common/prices.js +1 -0
- package/lib/lendMarkets/interfaces/common/userPosition.d.ts +39 -0
- package/lib/lendMarkets/interfaces/common/userPosition.js +1 -0
- package/lib/lendMarkets/interfaces/common/vault.d.ts +55 -0
- package/lib/lendMarkets/interfaces/common/vault.js +1 -0
- package/lib/lendMarkets/interfaces/common/wallet.d.ts +8 -0
- package/lib/lendMarkets/interfaces/common/wallet.js +1 -0
- package/lib/lendMarkets/interfaces/v1/index.d.ts +4 -0
- package/lib/lendMarkets/interfaces/v1/index.js +4 -0
- package/lib/lendMarkets/interfaces/v1/leverageV1.d.ts +90 -0
- package/lib/lendMarkets/interfaces/v1/leverageV1.js +1 -0
- package/lib/lendMarkets/interfaces/v1/loanV1.d.ts +73 -0
- package/lib/lendMarkets/interfaces/v1/loanV1.js +1 -0
- package/lib/lendMarkets/interfaces/v1/statsV1.d.ts +49 -0
- package/lib/lendMarkets/interfaces/v1/statsV1.js +1 -0
- package/lib/lendMarkets/interfaces/v2/index.d.ts +3 -0
- package/lib/lendMarkets/interfaces/v2/index.js +3 -0
- package/lib/lendMarkets/interfaces/v2/leverageV2.d.ts +90 -0
- package/lib/lendMarkets/interfaces/v2/leverageV2.js +1 -0
- package/lib/lendMarkets/interfaces/v2/loanV2.d.ts +73 -0
- package/lib/lendMarkets/interfaces/v2/loanV2.js +1 -0
- package/lib/lendMarkets/interfaces/v2/statsV2.d.ts +49 -0
- package/lib/lendMarkets/interfaces/v2/statsV2.js +1 -0
- package/lib/lendMarkets/lendMarketConstructor.js +1 -1
- package/lib/lendMarkets/modules/common/amm.d.ts +19 -0
- package/lib/lendMarkets/modules/common/amm.js +137 -0
- package/lib/lendMarkets/modules/common/index.d.ts +9 -0
- package/lib/lendMarkets/modules/common/index.js +9 -0
- package/lib/lendMarkets/modules/common/leverageZapV1Base.d.ts +118 -0
- package/lib/lendMarkets/modules/common/leverageZapV1Base.js +770 -0
- package/lib/lendMarkets/modules/{leverageZapV2.d.ts → common/leverageZapV2Base.d.ts} +10 -5
- package/lib/lendMarkets/modules/{leverageZapV2.js → common/leverageZapV2Base.js} +36 -32
- package/lib/lendMarkets/modules/common/loanBase.d.ts +115 -0
- package/lib/lendMarkets/modules/common/loanBase.js +793 -0
- package/lib/lendMarkets/modules/common/prices.d.ts +19 -0
- package/lib/lendMarkets/modules/common/prices.js +104 -0
- package/lib/lendMarkets/modules/common/statsBase.d.ts +69 -0
- package/lib/lendMarkets/modules/common/statsBase.js +291 -0
- package/lib/lendMarkets/modules/common/userPosition.d.ts +46 -0
- package/lib/lendMarkets/modules/common/userPosition.js +223 -0
- package/lib/lendMarkets/modules/common/vault.d.ts +69 -0
- package/lib/lendMarkets/modules/common/vault.js +535 -0
- package/lib/lendMarkets/modules/common/wallet.d.ts +13 -0
- package/lib/lendMarkets/modules/common/wallet.js +28 -0
- package/lib/lendMarkets/modules/index.d.ts +1 -1
- package/lib/lendMarkets/modules/index.js +1 -1
- package/lib/lendMarkets/modules/v1/index.d.ts +4 -0
- package/lib/lendMarkets/modules/v1/index.js +4 -0
- package/lib/lendMarkets/modules/v1/leverageV1ZapV1.d.ts +3 -0
- package/lib/lendMarkets/modules/v1/leverageV1ZapV1.js +3 -0
- package/lib/lendMarkets/modules/v1/leverageV1ZapV2.d.ts +3 -0
- package/lib/lendMarkets/modules/v1/leverageV1ZapV2.js +3 -0
- package/lib/lendMarkets/modules/v1/loanV1.d.ts +4 -0
- package/lib/lendMarkets/modules/v1/loanV1.js +3 -0
- package/lib/lendMarkets/modules/v1/statsV1.d.ts +3 -0
- package/lib/lendMarkets/modules/v1/statsV1.js +3 -0
- package/lib/lendMarkets/modules/v2/index.d.ts +4 -0
- package/lib/lendMarkets/modules/v2/index.js +4 -0
- package/lib/lendMarkets/modules/v2/leverageV2ZapV1.d.ts +3 -0
- package/lib/lendMarkets/modules/v2/leverageV2ZapV1.js +3 -0
- package/lib/lendMarkets/modules/v2/leverageV2ZapV2.d.ts +3 -0
- package/lib/lendMarkets/modules/v2/leverageV2ZapV2.js +3 -0
- package/lib/lendMarkets/modules/v2/loanV2.d.ts +4 -0
- package/lib/lendMarkets/modules/v2/loanV2.js +3 -0
- package/lib/lendMarkets/modules/v2/statsV2.d.ts +3 -0
- package/lib/lendMarkets/modules/v2/statsV2.js +3 -0
- package/lib/llamalend.d.ts +6 -6
- package/lib/llamalend.js +46 -210
- package/lib/utils.js +2 -33
- package/package.json +1 -1
- package/src/constants/abis/OneWayLendingFactoryV2ABI.json +543 -0
- package/src/constants/aliases.ts +1 -97
- package/src/constants/coins.ts +0 -25
- package/src/constants/utils.ts +4 -0
- package/src/interfaces.ts +3 -2
- package/src/lendMarkets/LendMarketTemplate.ts +318 -3222
- package/src/lendMarkets/fetch/fetchFactoryData.ts +113 -0
- package/src/lendMarkets/fetch/fetchLendMarkets.ts +108 -0
- package/src/lendMarkets/interfaces/common/amm.ts +11 -0
- package/src/lendMarkets/interfaces/common/index.ts +5 -0
- package/src/lendMarkets/interfaces/common/prices.ts +13 -0
- package/src/lendMarkets/interfaces/common/userPosition.ts +24 -0
- package/src/lendMarkets/interfaces/common/vault.ts +48 -0
- package/src/lendMarkets/interfaces/common/wallet.ts +3 -0
- package/src/lendMarkets/interfaces/v1/index.ts +4 -0
- package/src/lendMarkets/interfaces/v1/leverageV1.ts +84 -0
- package/src/lendMarkets/interfaces/v1/loanV1.ts +77 -0
- package/src/lendMarkets/interfaces/v1/statsV1.ts +21 -0
- package/src/lendMarkets/interfaces/v2/index.ts +3 -0
- package/src/lendMarkets/interfaces/v2/leverageV2.ts +84 -0
- package/src/lendMarkets/interfaces/v2/loanV2.ts +77 -0
- package/src/lendMarkets/interfaces/v2/statsV2.ts +21 -0
- package/src/lendMarkets/lendMarketConstructor.ts +1 -1
- package/src/lendMarkets/modules/common/amm.ts +132 -0
- package/src/lendMarkets/modules/common/index.ts +9 -0
- package/src/lendMarkets/modules/common/leverageZapV1Base.ts +912 -0
- package/src/lendMarkets/modules/{leverageZapV2.ts → common/leverageZapV2Base.ts} +41 -37
- package/src/lendMarkets/modules/common/loanBase.ts +773 -0
- package/src/lendMarkets/modules/common/prices.ts +111 -0
- package/src/lendMarkets/modules/common/statsBase.ts +313 -0
- package/src/lendMarkets/modules/common/userPosition.ts +243 -0
- package/src/lendMarkets/modules/common/vault.ts +551 -0
- package/src/lendMarkets/modules/common/wallet.ts +29 -0
- package/src/lendMarkets/modules/index.ts +1 -1
- package/src/lendMarkets/modules/v1/index.ts +4 -0
- package/src/lendMarkets/modules/v1/leverageV1ZapV1.ts +3 -0
- package/src/lendMarkets/modules/v1/leverageV1ZapV2.ts +3 -0
- package/src/lendMarkets/modules/v1/loanV1.ts +4 -0
- package/src/lendMarkets/modules/v1/statsV1.ts +3 -0
- package/src/lendMarkets/modules/v2/index.ts +4 -0
- package/src/lendMarkets/modules/v2/leverageV2ZapV1.ts +3 -0
- package/src/lendMarkets/modules/v2/leverageV2ZapV2.ts +3 -0
- package/src/lendMarkets/modules/v2/loanV2.ts +4 -0
- package/src/lendMarkets/modules/v2/statsV2.ts +3 -0
- package/src/llamalend.ts +47 -244
- package/src/utils.ts +2 -35
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# Migration Guide: Refactoring to Modular Structure
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Methods that were previously defined directly inside the `LendMarketTemplate` class have now been reorganized into separate modules to improve code structure, readability, and maintainability.
|
|
6
|
+
|
|
7
|
+
This guide is required for developers migrating from **version 1.X.X → 2.X.X**.
|
|
8
|
+
|
|
9
|
+
> ℹ️ **Important:**
|
|
10
|
+
> Method signatures, arguments, return types, and internal logic were **not modified**.
|
|
11
|
+
> This release only reorganizes methods into dedicated namespaces for modularization purposes.
|
|
12
|
+
|
|
13
|
+
## Module Structure
|
|
14
|
+
|
|
15
|
+
| Module | Responsibility | Has Changes |
|
|
16
|
+
|--------------------------|--------------------------------------------------------|-------------|
|
|
17
|
+
| `market.prices` | Prices and calculations | Yes ⚠️ |
|
|
18
|
+
| `market.amm` | AMM swap operations | Yes ⚠️ |
|
|
19
|
+
| `market.loan` | Loan operations (create, borrow, repay, liquidate) | Yes ⚠️ |
|
|
20
|
+
| `market.userPosition` | User position information | Yes ⚠️ |
|
|
21
|
+
| `market.stats` | Market statistics | No |
|
|
22
|
+
| `market.wallet` | Wallet balances | No |
|
|
23
|
+
| `market.vault` | Vault operations (deposit, withdraw, stake, rewards) | No |
|
|
24
|
+
| `market.leverage` | Leverage operations | No |
|
|
25
|
+
| `market.leverageZapV2` | Advanced leverage (Zap V2) operations | No |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Legend — Change Types
|
|
30
|
+
|
|
31
|
+
| Icon | Meaning |
|
|
32
|
+
|------|---------|
|
|
33
|
+
| ⚠️ | Method changed namespace and requires refactoring |
|
|
34
|
+
| 🚨 | Method changed namespace **and** method name |
|
|
35
|
+
| 🆕 | New method (no migration required) |
|
|
36
|
+
|
|
37
|
+
## Stats Module (`market.stats`)
|
|
38
|
+
|
|
39
|
+
| Old method | New method | Has Changes |
|
|
40
|
+
|---------------------------------|---------------------------------|-------------|
|
|
41
|
+
| `market.stats.parameters()` | `market.stats.parameters()` | No |
|
|
42
|
+
| `market.stats.rates()` | `market.stats.rates()` | No |
|
|
43
|
+
| `market.stats.futureRates()` | `market.stats.futureRates()` | No |
|
|
44
|
+
| `market.stats.balances()` | `market.stats.balances()` | No |
|
|
45
|
+
| `market.stats.bandsInfo()` | `market.stats.bandsInfo()` | No |
|
|
46
|
+
| `market.stats.bandBalances()` | `market.stats.bandBalances()` | No |
|
|
47
|
+
| `market.stats.bandsBalances()` | `market.stats.bandsBalances()` | No |
|
|
48
|
+
| `market.stats.totalDebt()` | `market.stats.totalDebt()` | No |
|
|
49
|
+
| `market.stats.ammBalances()` | `market.stats.ammBalances()` | No |
|
|
50
|
+
| `market.stats.capAndAvailable()`| `market.stats.capAndAvailable()`| No |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Wallet Module (`market.wallet`)
|
|
55
|
+
|
|
56
|
+
| Old Method | New Method | Has Changes |
|
|
57
|
+
|----------------------------|----------------------------|-------------|
|
|
58
|
+
| `market.wallet.balances()` | `market.wallet.balances()` | No |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Vault Module (`market.vault`)
|
|
63
|
+
|
|
64
|
+
### Deposit Operations
|
|
65
|
+
|
|
66
|
+
| Old Method | New Method | Has Changes |
|
|
67
|
+
|--------------------------------------|------------------------------------|-------------|
|
|
68
|
+
| `market.vault.maxDeposit()` | `market.vault.maxDeposit()` | No |
|
|
69
|
+
| `market.vault.previewDeposit()` | `market.vault.previewDeposit()` | No |
|
|
70
|
+
| `market.vault.depositIsApproved()` | `market.vault.depositIsApproved()` | No |
|
|
71
|
+
| `market.vault.depositApprove()` | `market.vault.depositApprove()` | No |
|
|
72
|
+
| `market.vault.deposit()` | `market.vault.deposit()` | No |
|
|
73
|
+
| `market.vault.estimateGas.deposit()` | `market.vault.estimateGas.deposit()` | No |
|
|
74
|
+
| `market.vault.estimateGas.depositApprove()` | `market.vault.estimateGas.depositApprove()` | No |
|
|
75
|
+
|
|
76
|
+
### Mint Operations
|
|
77
|
+
|
|
78
|
+
| Old Method | New Method | Has Changes |
|
|
79
|
+
|-----------------------------------|-----------------------------------|-------------|
|
|
80
|
+
| `market.vault.maxMint()` | `market.vault.maxMint()` | No |
|
|
81
|
+
| `market.vault.previewMint()` | `market.vault.previewMint()` | No |
|
|
82
|
+
| `market.vault.mintIsApproved()` | `market.vault.mintIsApproved()` | No |
|
|
83
|
+
| `market.vault.mintApprove()` | `market.vault.mintApprove()` | No |
|
|
84
|
+
| `market.vault.mint()` | `market.vault.mint()` | No |
|
|
85
|
+
| `market.vault.estimateGas.mint()` | `market.vault.estimateGas.mint()` | No |
|
|
86
|
+
| `market.vault.estimateGas.mintApprove()` | `market.vault.estimateGas.mintApprove()` | No |
|
|
87
|
+
|
|
88
|
+
### Withdraw Operations
|
|
89
|
+
|
|
90
|
+
| Old Method | New Method | Has Changes |
|
|
91
|
+
|---------------------------------------|---------------------------------------|-------------|
|
|
92
|
+
| `market.vault.maxWithdraw()` | `market.vault.maxWithdraw()` | No |
|
|
93
|
+
| `market.vault.previewWithdraw()` | `market.vault.previewWithdraw()` | No |
|
|
94
|
+
| `market.vault.withdraw()` | `market.vault.withdraw()` | No |
|
|
95
|
+
| `market.vault.estimateGas.withdraw()` | `market.vault.estimateGas.withdraw()` | No |
|
|
96
|
+
|
|
97
|
+
### Redeem Operations
|
|
98
|
+
|
|
99
|
+
| Old Method | New Method | Has Changes |
|
|
100
|
+
|--------------------------------|-------------------------------------|-------------|
|
|
101
|
+
| `market.vault.maxRedeem()` | `market.vault.maxRedeem()` | No |
|
|
102
|
+
| `market.vault.previewRedeem()` | `market.vault.previewRedeem()` | No |
|
|
103
|
+
| `market.vault.redeem()` | `market.vault.redeem()` | No |
|
|
104
|
+
| `market.vault.estimateGas.redeem()` | `market.vault.estimateGas.redeem()` | No |
|
|
105
|
+
|
|
106
|
+
### Conversion & Utilities
|
|
107
|
+
|
|
108
|
+
| Old Method | New Method | Has Changes |
|
|
109
|
+
|-------------------------------------|-------------------------------------|-------------|
|
|
110
|
+
| `market.vault.convertToShares()` | `market.vault.convertToShares()` | No |
|
|
111
|
+
| `market.vault.convertToAssets()` | `market.vault.convertToAssets()` | No |
|
|
112
|
+
| `market.vault.totalLiquidity()` | `market.vault.totalLiquidity()` | No |
|
|
113
|
+
| `market.vault.rewardsOnly()` | `market.vault.rewardsOnly()` | No |
|
|
114
|
+
|
|
115
|
+
### Staking Operations
|
|
116
|
+
|
|
117
|
+
| Old Method | New Method | Has Changes |
|
|
118
|
+
|-------------------------------------------|-------------------------------------------|-------------|
|
|
119
|
+
| `market.vault.stakeIsApproved()` | `market.vault.stakeIsApproved()` | No |
|
|
120
|
+
| `market.vault.stakeApprove()` | `market.vault.stakeApprove()` | No |
|
|
121
|
+
| `market.vault.stake()` | `market.vault.stake()` | No |
|
|
122
|
+
| `market.vault.unstake()` | `market.vault.unstake()` | No |
|
|
123
|
+
| `market.vault.estimateGas.stakeApprove()` | `market.vault.estimateGas.stakeApprove()` | No |
|
|
124
|
+
| `market.vault.estimateGas.stake()` | `market.vault.estimateGas.stake()` | No |
|
|
125
|
+
| `market.vault.estimateGas.unstake()` | `market.vault.estimateGas.unstake()` | No |
|
|
126
|
+
|
|
127
|
+
### Rewards Operations
|
|
128
|
+
|
|
129
|
+
| Old Method | New Method | Has Changes |
|
|
130
|
+
|---------------------------------------|-------------------------------------------|-------------|
|
|
131
|
+
| `market.vault.crvApr()` | `market.vault.crvApr()` | No |
|
|
132
|
+
| `market.vault.claimableCrv()` | `market.vault.claimableCrv()` | No |
|
|
133
|
+
| `market.vault.claimCrv()` | `market.vault.claimCrv()` | No |
|
|
134
|
+
| `market.vault.rewardTokens()` | `market.vault.rewardTokens()` | No |
|
|
135
|
+
| `market.vault.rewardsApr()` | `market.vault.rewardsApr()` | No |
|
|
136
|
+
| `market.vault.claimableRewards()` | `market.vault.claimableRewards()` | No |
|
|
137
|
+
| `market.vault.claimRewards()` | `market.vault.claimRewards()` | No |
|
|
138
|
+
| `market.vault.estimateGas.claimCrv()` | `market.vault.estimateGas.claimCrv()` | No |
|
|
139
|
+
| `market.vault.estimateGas.claimRewards()` | `market.vault.estimateGas.claimRewards()` | No |
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Prices Module (`market.prices`)
|
|
144
|
+
|
|
145
|
+
### Prices Module
|
|
146
|
+
|
|
147
|
+
| Old Method | New Method | Has Changes |
|
|
148
|
+
|----------------------------|-----------------------------------|-------------|
|
|
149
|
+
| `market.A()` | `market.prices.A()` | Yes ⚠️ |
|
|
150
|
+
| `market.basePrice()` | `market.prices.basePrice()` | Yes ⚠️ |
|
|
151
|
+
| `market.oraclePrice()` | `market.prices.oraclePrice()` | Yes ⚠️ |
|
|
152
|
+
| `market.oraclePriceBand()` | `market.prices.oraclePriceBand()` | Yes ⚠️ |
|
|
153
|
+
| `market.price()` | `market.prices.price()` | Yes ⚠️ |
|
|
154
|
+
| `market.calcTickPrice()` | `market.prices.calcTickPrice()` | Yes ⚠️ |
|
|
155
|
+
| `market.calcBandPrices()` | `market.prices.calcBandPrices()` | Yes ⚠️ |
|
|
156
|
+
| `market.calcRangePct()` | `market.prices.calcRangePct()` | Yes ⚠️ |
|
|
157
|
+
| `market._getPrices()` | `market.prices.getPrices()` | Yes 🚨 |
|
|
158
|
+
| `market._calcPrices()` | `market.prices.calcPrices()` | Yes 🚨 |
|
|
159
|
+
| `market._checkRange()` | `market.prices.checkRange()` | Yes 🚨 |
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## AMM Module (`market.amm`)
|
|
164
|
+
|
|
165
|
+
| Old Method | New Method | Has Changes |
|
|
166
|
+
|------------------------------------|----------------------------------------|-------------|
|
|
167
|
+
| `market.maxSwappable()` | `market.amm.maxSwappable()` | Yes ⚠️ |
|
|
168
|
+
| `market.swapExpected()` | `market.amm.swapExpected()` | Yes ⚠️ |
|
|
169
|
+
| `market.swapRequired()` | `market.amm.swapRequired()` | Yes ⚠️ |
|
|
170
|
+
| `market.swapPriceImpact()` | `market.amm.swapPriceImpact()` | Yes ⚠️ |
|
|
171
|
+
| `market.swapIsApproved()` | `market.amm.swapIsApproved()` | Yes ⚠️ |
|
|
172
|
+
| `market.swapApprove()` | `market.amm.swapApprove()` | Yes ⚠️ |
|
|
173
|
+
| `market.swap()` | `market.amm.swap()` | Yes ⚠️ |
|
|
174
|
+
| `market.estimateGas.swapApprove()` | `market.amm.estimateGas.swapApprove()` | Yes ⚠️ |
|
|
175
|
+
| `market.estimateGas.swap()` | `market.amm.estimateGas.swap()` | Yes ⚠️ |
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Loan Module (`market.loan`)
|
|
179
|
+
|
|
180
|
+
### Create Loan
|
|
181
|
+
|
|
182
|
+
| Old Method | New Method | Has Changes |
|
|
183
|
+
|------------------------------------------|-----------------------------------------------|-------------|
|
|
184
|
+
| `market.createLoanMaxRecv()` | `market.loan.createLoanMaxRecv()` | Yes ⚠️ |
|
|
185
|
+
| `market.createLoanMaxRecvAllRanges()` | `market.loan.createLoanMaxRecvAllRanges()` | Yes ⚠️ |
|
|
186
|
+
| `market.getMaxRange()` | `market.loan.getMaxRange()` | Yes ⚠️ |
|
|
187
|
+
| `market.createLoanBands()` | `market.loan.createLoanBands()` | Yes ⚠️ |
|
|
188
|
+
| `market.createLoanBandsAllRanges()` | `market.loan.createLoanBandsAllRanges()` | Yes ⚠️ |
|
|
189
|
+
| `market.createLoanPrices()` | `market.loan.createLoanPrices()` | Yes ⚠️ |
|
|
190
|
+
| `market.createLoanPricesAllRanges()` | `market.loan.createLoanPricesAllRanges()` | Yes ⚠️ |
|
|
191
|
+
| `market.createLoanHealth()` | `market.loan.createLoanHealth()` | Yes ⚠️ |
|
|
192
|
+
| `market.createLoanIsApproved()` | `market.loan.createLoanIsApproved()` | Yes ⚠️ |
|
|
193
|
+
| `market.createLoanApprove()` | `market.loan.createLoanApprove()` | Yes ⚠️ |
|
|
194
|
+
| `market.createLoan()` | `market.loan.createLoan()` | Yes ⚠️ |
|
|
195
|
+
| `market.estimateGas.createLoanApprove()` | `market.loan.estimateGas.createLoanApprove()` | Yes ⚠️ |
|
|
196
|
+
| `market.estimateGas.createLoan()` | `market.loan.estimateGas.createLoan()` | Yes ⚠️ |
|
|
197
|
+
|
|
198
|
+
### Borrow More
|
|
199
|
+
|
|
200
|
+
| Old Method | New Method | Has Changes |
|
|
201
|
+
|------------------------------------------|-----------------------------------------------|-------------|
|
|
202
|
+
| `market.borrowMoreMaxRecv()` | `market.loan.borrowMoreMaxRecv()` | Yes ⚠️ |
|
|
203
|
+
| `market.borrowMoreBands()` | `market.loan.borrowMoreBands()` | Yes ⚠️ |
|
|
204
|
+
| `market.borrowMorePrices()` | `market.loan.borrowMorePrices()` | Yes ⚠️ |
|
|
205
|
+
| `market.borrowMoreHealth()` | `market.loan.borrowMoreHealth()` | Yes ⚠️ |
|
|
206
|
+
| `market.borrowMoreIsApproved()` | `market.loan.borrowMoreIsApproved()` | Yes ⚠️ |
|
|
207
|
+
| `market.borrowMoreApprove()` | `market.loan.borrowMoreApprove()` | Yes ⚠️ |
|
|
208
|
+
| `market.borrowMore()` | `market.loan.borrowMore()` | Yes ⚠️ |
|
|
209
|
+
| `market.borrowMoreFutureLeverage()` | `market.loan.borrowMoreFutureLeverage()` | Yes 🆕 |
|
|
210
|
+
| `market.estimateGas.borrowMoreApprove()` | `market.loan.estimateGas.borrowMoreApprove()` | Yes ⚠️ |
|
|
211
|
+
| `market.estimateGas.borrowMore()` | `market.loan.estimateGas.borrowMore()` | Yes ⚠️ |
|
|
212
|
+
|
|
213
|
+
### Add Collateral
|
|
214
|
+
|
|
215
|
+
| Old Method | New Method | Has Changes |
|
|
216
|
+
|---------------------------------------------|--------------------------------------------------|-------------|
|
|
217
|
+
| `market.addCollateralBands()` | `market.loan.addCollateralBands()` | Yes ⚠️ |
|
|
218
|
+
| `market.addCollateralPrices()` | `market.loan.addCollateralPrices()` | Yes ⚠️ |
|
|
219
|
+
| `market.addCollateralHealth()` | `market.loan.addCollateralHealth()` | Yes ⚠️ |
|
|
220
|
+
| `market.addCollateralIsApproved()` | `market.loan.addCollateralIsApproved()` | Yes ⚠️ |
|
|
221
|
+
| `market.addCollateralApprove()` | `market.loan.addCollateralApprove()` | Yes ⚠️ |
|
|
222
|
+
| `market.addCollateral()` | `market.loan.addCollateral()` | Yes ⚠️ |
|
|
223
|
+
| `market.addCollateralFutureLeverage()` | `market.loan.addCollateralFutureLeverage()` | Yes ⚠️ |
|
|
224
|
+
| `market.estimateGas.addCollateralApprove()` | `market.loan.estimateGas.addCollateralApprove()` | Yes ⚠️ |
|
|
225
|
+
| `market.estimateGas.addCollateral()` | `market.loan.estimateGas.addCollateral()` | Yes ⚠️ |
|
|
226
|
+
|
|
227
|
+
### Remove Collateral
|
|
228
|
+
|
|
229
|
+
| Old Method | New Method | Has Changes |
|
|
230
|
+
|-------------------------------------------|------------------------------------------------|-------------|
|
|
231
|
+
| `market.maxRemovable()` | `market.loan.maxRemovable()` | Yes ⚠️ |
|
|
232
|
+
| `market.removeCollateralBands()` | `market.loan.removeCollateralBands()` | Yes ⚠️ |
|
|
233
|
+
| `market.removeCollateralPrices()` | `market.loan.removeCollateralPrices()` | Yes ⚠️ |
|
|
234
|
+
| `market.removeCollateralHealth()` | `market.loan.removeCollateralHealth()` | Yes ⚠️ |
|
|
235
|
+
| `market.removeCollateral()` | `market.loan.removeCollateral()` | Yes ⚠️ |
|
|
236
|
+
| `market.removeCollateralFutureLeverage()` | `market.loan.removeCollateralFutureLeverage()` | Yes ⚠️ |
|
|
237
|
+
| `market.estimateGas.removeCollateral()` | `market.loan.estimateGas.removeCollateral()` | Yes ⚠️ |
|
|
238
|
+
|
|
239
|
+
### Repay
|
|
240
|
+
|
|
241
|
+
| Old Method | New Method | Has Changes |
|
|
242
|
+
|-------------------------------------|-----------------------------------|-------------|
|
|
243
|
+
| `market.repayBands()` | `market.loan.repayBands()` | Yes ⚠️ |
|
|
244
|
+
| `market.repayPrices()` | `market.loan.repayPrices()` | Yes ⚠️ |
|
|
245
|
+
| `market.repayIsApproved()` | `market.loan.repayIsApproved()` | Yes ⚠️ |
|
|
246
|
+
| `market.repayApprove()` | `market.loan.repayApprove()` | Yes ⚠️ |
|
|
247
|
+
| `market.repayHealth()` | `market.loan.repayHealth()` | Yes ⚠️ |
|
|
248
|
+
| `market.repay()` | `market.loan.repay()` | Yes ⚠️ |
|
|
249
|
+
| — | `market.loan.repayFutureLeverage()` | Yes 🆕 |
|
|
250
|
+
| `market.estimateGas.repayApprove()` | `market.loan.estimateGas.repayApprove()` | Yes ⚠️ |
|
|
251
|
+
| `market.estimateGas.repay()` | `market.loan.estimateGas.repay()` | Yes ⚠️ |
|
|
252
|
+
|
|
253
|
+
### Full Repay
|
|
254
|
+
|
|
255
|
+
| Old Method | New Method | Has Changes |
|
|
256
|
+
|-----------------------------------------|----------------------------------------------|-------------|
|
|
257
|
+
| `market.fullRepayIsApproved()` | `market.loan.fullRepayIsApproved()` | Yes ⚠️ |
|
|
258
|
+
| `market.fullRepayApprove()` | `market.loan.fullRepayApprove()` | Yes ⚠️ |
|
|
259
|
+
| `market.fullRepay()` | `market.loan.fullRepay()` | Yes ⚠️ |
|
|
260
|
+
| `market.estimateGas.fullRepayApprove()` | `market.loan.estimateGas.fullRepayApprove()` | Yes ⚠️ |
|
|
261
|
+
| `market.estimateGas.fullRepay()` | `market.loan.estimateGas.fullRepay()` | Yes ⚠️ |
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
### Liquidation
|
|
265
|
+
|
|
266
|
+
| Old Method | New Method | Has Changes |
|
|
267
|
+
|-----------------------------------------|----------------------------------------------|-------------|
|
|
268
|
+
| `market.tokensToLiquidate()` | `market.loan.tokensToLiquidate()` | Yes ⚠️ |
|
|
269
|
+
| `market.liquidateIsApproved()` | `market.loan.liquidateIsApproved()` | Yes ⚠️ |
|
|
270
|
+
| `market.liquidateApprove()` | `market.loan.liquidateApprove()` | Yes ⚠️ |
|
|
271
|
+
| `market.liquidate()` | `market.loan.liquidate()` | Yes ⚠️ |
|
|
272
|
+
| `market.estimateGas.liquidateApprove()` | `market.loan.estimateGas.liquidateApprove()` | Yes ⚠️ |
|
|
273
|
+
| `market.estimateGas.liquidate()` | `market.loan.estimateGas.liquidate()` | Yes ⚠️ |
|
|
274
|
+
|
|
275
|
+
### Self Liquidation
|
|
276
|
+
|
|
277
|
+
| Old Method | New Method | Has Changes |
|
|
278
|
+
|---------------------------------------------|--------------------------------------------------|-------------|
|
|
279
|
+
| `market.selfLiquidateIsApproved()` | `market.loan.selfLiquidateIsApproved()` | Yes ⚠️ |
|
|
280
|
+
| `market.selfLiquidateApprove()` | `market.loan.selfLiquidateApprove()` | Yes ⚠️ |
|
|
281
|
+
| `market.selfLiquidate()` | `market.loan.selfLiquidate()` | Yes ⚠️ |
|
|
282
|
+
| `market.estimateGas.selfLiquidateApprove()` | `market.loan.estimateGas.selfLiquidateApprove()` | Yes ⚠️ |
|
|
283
|
+
| `market.estimateGas.selfLiquidate()` | `market.loan.estimateGas.selfLiquidate()` | Yes ⚠️ |
|
|
284
|
+
|
|
285
|
+
### Partial Self Liquidation
|
|
286
|
+
|
|
287
|
+
| Old Method | New Method | Has Changes |
|
|
288
|
+
|----------------------------------------------------|---------------------------------------------------------|-------------|
|
|
289
|
+
| `market.calcPartialFrac()` | `market.loan.calcPartialFrac()` | Yes ⚠️ |
|
|
290
|
+
| `market.partialSelfLiquidateIsApproved()` | `market.loan.partialSelfLiquidateIsApproved()` | Yes ⚠️ |
|
|
291
|
+
| `market.partialSelfLiquidateApprove()` | `market.loan.partialSelfLiquidateApprove()` | Yes ⚠️ |
|
|
292
|
+
| `market.partialSelfLiquidate()` | `market.loan.partialSelfLiquidate()` | Yes ⚠️ |
|
|
293
|
+
| `market.estimateGas.partialSelfLiquidateApprove()` | `market.loan.estimateGas.partialSelfLiquidateApprove()` | Yes ⚠️ |
|
|
294
|
+
| `market.estimateGas.partialSelfLiquidate()` | `market.loan.estimateGas.partialSelfLiquidate()` | Yes ⚠️ |
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## User Position Module (`market.userPosition`)
|
|
299
|
+
|
|
300
|
+
| Old Method | New Method | Has Changes |
|
|
301
|
+
|------------------------------------|----------------------------------------------|-------------|
|
|
302
|
+
| `market.userLoanExists()` | `market.userPosition.userLoanExists()` | Yes ⚠️ |
|
|
303
|
+
| `market.userState()` | `market.userPosition.userState()` | Yes ⚠️ |
|
|
304
|
+
| — | `market.userPosition.userStateBigInt()` | Yes 🆕 |
|
|
305
|
+
| `market.userHealth()` | `market.userPosition.userHealth()` | Yes ⚠️ |
|
|
306
|
+
| `market.userBands()` | `market.userPosition.userBands()` | Yes ⚠️ |
|
|
307
|
+
| — | `market.userPosition.userBandsBigInt()` | Yes 🆕 |
|
|
308
|
+
| `market.userRange()` | `market.userPosition.userRange()` | Yes ⚠️ |
|
|
309
|
+
| `market.userPrices()` | `market.userPosition.userPrices()` | Yes ⚠️ |
|
|
310
|
+
| `market.userLoss()` | `market.userPosition.userLoss()` | Yes ⚠️ |
|
|
311
|
+
| `market.userBandsBalances()` | `market.userPosition.userBandsBalances()` | Yes ⚠️ |
|
|
312
|
+
| `market.currentLeverage()` | `market.userPosition.currentLeverage()` | Yes ⚠️ |
|
|
313
|
+
| `market.currentPnL()` | `market.userPosition.currentPnL()` | Yes ⚠️ |
|
|
314
|
+
| `market.userBoost()` | `market.userPosition.userBoost()` | Yes ⚠️ |
|
|
315
|
+
| `market.forceUpdateUserState()` | `market.userPosition.forceUpdateUserState()` | Yes ⚠️ |
|
|
316
|
+
| — | `market.userPosition.getCurrentLeverageParams()` | Yes 🆕 |
|
|
317
|
+
|
|
318
|
+
## Leverage Module (`market.leverage`)
|
|
319
|
+
|
|
320
|
+
The `leverage` and `leverageZapV2` methods remain unchanged.
|
|
321
|
+
|
|
322
|
+
No refactoring was applied to leverage-related logic.
|
|
323
|
+
There were no namespace changes, signature changes, or internal modifications.
|
|
324
|
+
|
|
325
|
+
All leverage functionality continues to work exactly as before and does not require any migration updates.
|