@babylonlabs-io/ts-sdk 0.15.4-rc-0.16.0 → 0.16.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/LICENSE ADDED
@@ -0,0 +1,169 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+
7
+ -----------------------------------------------------------------------------
8
+
9
+ Parameters
10
+
11
+ Licensor: Babylon Labs Ltd.
12
+
13
+ Licensed Work: babylon-toolkit
14
+ The Licensed Work is (c) 2024 Babylon Labs Ltd.
15
+
16
+ Additional Use Grant:
17
+
18
+ In addition to the uses permitted under the non-production license below,
19
+ we grant you a limited, non-exclusive, non-transferable, non-sublicensable,
20
+ revocable license, limited as set forth below, to use the Licensed Work
21
+ in this repository for production commercial uses built on or using and integrated
22
+ with the Babylon Protocol, not including Competing Uses.
23
+
24
+ Any use beyond the scope of this license, including uses that are not built on or
25
+ using and integrated with the Babylon Protocol, or are Competing Uses,
26
+ will terminate this license to you, automatically and without notice.
27
+
28
+ This License applies separately and solely to the specific versions of the Licensed Work
29
+ in the specified repository on or before the date of this License, and we may require a
30
+ different license and different provisions for each subsequent version of the
31
+ Licensed Work released by us.
32
+
33
+ "Babylon Labs", "we", "our", or "us" means Babylon Labs Ltd.
34
+
35
+ "Babylon Protocol" means the Bitcoin staking protocol as further described in the documentation
36
+ here (https://docs.babylonlabs.io/docs/introduction/babylon-overview), as updated from time to time.
37
+
38
+ "Competing Use" means any use of the Licensed Work in any product, software, protocol, network,
39
+ application, or service that is made available to any party and that
40
+ (i) substitutes for the use of the Babylon Protocol,
41
+ (ii) offers the same or substantially similar functionality as the Babylon Protocol or
42
+ (iii) is built on or uses a protocol with substantially similar functionality as the Babylon Protocol
43
+ or otherwise facilitates the staking of bitcoin other than by utilizing the Babylon Protocol.
44
+
45
+ The provisions in this License apply to each individual, entity, group, or association
46
+ (each and collectively, "you" or "your") who uses the Licensed Work for production,
47
+ and you agree to such provisions. Your production use of the Licensed Work is conditional on your
48
+ agreement to this License. If you do not agree and consent to be bound to this License,
49
+ do not so use the Software.
50
+
51
+ If you do not fall within the limited scope of this license as described above or below,
52
+ or are otherwise not in strict compliance with this License, then this production license does not
53
+ extend to you and does not grant you any production use, including any copying, distributing, or
54
+ making any derivative use of the Licensed Work for production purposes.
55
+
56
+ Limited Scope of License. Your commercial production license to the Licensed Work
57
+ under this License does not extend to any use:
58
+
59
+ 1. unless you have legal capacity to consent and agree to be bound by this License;
60
+ 2. unless you have the technical knowledge necessary or advisable to understand and evaluate the
61
+ risks of using the Licensed Work and the Babylon Protocol;
62
+ 3. if you are a resident or agent of, or an entity organized, incorporated or doing business in,
63
+ Afghanistan, Belarus, Bosnia and Herzegovina, Burundi, Central African Republic, Crimea, Cuba,
64
+ Democratic People's Republic of Korea, Democratic Republic of the Congo,
65
+ Donetsk or Luhansk Regions of Ukraine, Eritrea, Guinea, Guinea-Bissau, Haiti, Iran, Iraq, Lebanon,
66
+ Libya, Mali, Myanmar, Nicaragua, Russia, Somalia, South Sudan, Sudan, Syria, Venezuela, Yemen,
67
+ or Zimbabwe or any other country to which the United States, the United Kingdom,
68
+ the European Union or any of its member states or the United Nations or any of its member states
69
+ (collectively, the "Major Jurisdictions") embargoes goods or imposes sanctions
70
+ (such embargoed or sanctioned territories, collectively, the "Restricted Territories");
71
+ 4. if you are, or if you directly or indirectly own or control, from any person or entity that is
72
+ listed on any sanctions list or equivalent maintained by any of the Major Jurisdictions
73
+ (collectively, "Sanctions Lists Persons");
74
+ 5. to transact in or with any Restricted Territories or Sanctions List Persons;
75
+ 6. if you are a U.S. Person as defined in 17 CFR § 230.902, or currently or ordinarily located or
76
+ resident in (or incorporated or organized in) the United States of America, Canada, or
77
+ Australia (collectively, "Excluded Jurisdictions"), or to transact in or with Excluded Jurisdictions;
78
+ 7. to defraud, or otherwise materially mislead, any person;
79
+ 8. in violation of applicable laws, rules or regulations in your relevant jurisdiction;
80
+ 9. that circumvents any sanctions or export controls targeting you or the country or territory where
81
+ you are located; or
82
+ 10. in any activity that transmits, exchanges, or is otherwise supported by the direct or indirect
83
+ proceeds of criminal or fraudulent activity.
84
+
85
+ Any production use of the Licensed Work by you confirms your agreement to the foregoing limitations,
86
+ and your understanding and agreement that they are limitations and not restrictions.
87
+
88
+ Change Date: 2027-03-15 (March 15th, 2027)
89
+
90
+ Change License: Apache 2.0
91
+
92
+ -----------------------------------------------------------------------------
93
+
94
+ Terms
95
+
96
+ The Licensor hereby grants you the right to copy, modify, create derivative
97
+ works, redistribute, and make non-production use of the Licensed Work. The
98
+ Licensor may make an Additional Use Grant, above, permitting limited
99
+ production use.
100
+
101
+ Effective on the Change Date, or the fourth anniversary of the first publicly
102
+ available distribution of a specific version of the Licensed Work under this
103
+ License, whichever comes first, the Licensor hereby grants you rights under
104
+ the terms of the Change License, and the rights granted in the paragraph
105
+ above terminate.
106
+
107
+ If your use of the Licensed Work does not comply with the requirements
108
+ currently in effect as described in this License, you must purchase a
109
+ commercial license from the Licensor, its affiliated entities, or authorized
110
+ resellers, or you must refrain from using the Licensed Work.
111
+
112
+ All copies of the original and modified Licensed Work, and derivative works
113
+ of the Licensed Work, are subject to this License. This License applies
114
+ separately for each version of the Licensed Work and the Change Date may vary
115
+ for each version of the Licensed Work released by Licensor.
116
+
117
+ You must conspicuously display this License on each original or modified copy
118
+ of the Licensed Work. If you receive the Licensed Work in original or
119
+ modified form from a third party, the terms and conditions set forth in this
120
+ License apply to your use of that work.
121
+
122
+ Any use of the Licensed Work in violation of this License will automatically
123
+ terminate your rights under this License for the current and all other
124
+ versions of the Licensed Work.
125
+
126
+ This License does not grant you any right in any trademark or logo of
127
+ Licensor or its affiliates (provided that you may use a trademark or logo of
128
+ Licensor as expressly required by this License).
129
+
130
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
131
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
132
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
133
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
134
+ TITLE.
135
+
136
+ MariaDB hereby grants you permission to use this License’s text to license
137
+ your works, and to refer to it using the trademark "Business Source License",
138
+ as long as you comply with the Covenants of Licensor below.
139
+
140
+ -----------------------------------------------------------------------------
141
+
142
+ Covenants of Licensor
143
+
144
+ In consideration of the right to use this License’s text and the "Business
145
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
146
+ other recipients of the licensed work to be provided by Licensor:
147
+
148
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
149
+ or a license that is compatible with GPL Version 2.0 or a later version,
150
+ where "compatible" means that software provided under the Change License can
151
+ be included in a program with software provided under GPL Version 2.0 or a
152
+ later version. Licensor may specify additional Change Licenses without
153
+ limitation.
154
+
155
+ 2. To either: (a) specify an additional grant of rights to use that does not
156
+ impose any additional restriction on the right granted in this License, as
157
+ the Additional Use Grant; or (b) insert the text "None".
158
+
159
+ 3. To specify a Change Date.
160
+
161
+ 4. Not to modify this License in any other way.
162
+
163
+ -----------------------------------------------------------------------------
164
+
165
+ Notice
166
+
167
+ The Business Source License (this document, or the "License") is not an Open
168
+ Source license. However, the Licensed Work will eventually be made available
169
+ under an Open Source License, as stated in this License.
@@ -73,8 +73,8 @@ declare const _default: [
73
73
  "outputs": [
74
74
  {
75
75
  "name": "dynamicConfigKey",
76
- "type": "uint24",
77
- "internalType": "uint24"
76
+ "type": "uint32",
77
+ "internalType": "uint32"
78
78
  }
79
79
  ],
80
80
  "stateMutability": "nonpayable"
@@ -202,8 +202,8 @@ declare const _default: [
202
202
  },
203
203
  {
204
204
  "name": "dynamicConfigKey",
205
- "type": "uint24",
206
- "internalType": "uint24"
205
+ "type": "uint32",
206
+ "internalType": "uint32"
207
207
  }
208
208
  ],
209
209
  "outputs": [
@@ -341,29 +341,19 @@ declare const _default: [
341
341
  "internalType": "uint8"
342
342
  },
343
343
  {
344
- "name": "dynamicConfigKey",
344
+ "name": "collateralRisk",
345
345
  "type": "uint24",
346
346
  "internalType": "uint24"
347
347
  },
348
348
  {
349
- "name": "paused",
350
- "type": "bool",
351
- "internalType": "bool"
352
- },
353
- {
354
- "name": "frozen",
355
- "type": "bool",
356
- "internalType": "bool"
357
- },
358
- {
359
- "name": "borrowable",
360
- "type": "bool",
361
- "internalType": "bool"
349
+ "name": "flags",
350
+ "type": "uint8",
351
+ "internalType": "ReserveFlags"
362
352
  },
363
353
  {
364
- "name": "collateralRisk",
365
- "type": "uint24",
366
- "internalType": "uint24"
354
+ "name": "dynamicConfigKey",
355
+ "type": "uint32",
356
+ "internalType": "uint32"
367
357
  }
368
358
  ]
369
359
  }
@@ -638,8 +628,8 @@ declare const _default: [
638
628
  },
639
629
  {
640
630
  "name": "dynamicConfigKey",
641
- "type": "uint24",
642
- "internalType": "uint24"
631
+ "type": "uint32",
632
+ "internalType": "uint32"
643
633
  }
644
634
  ]
645
635
  }
@@ -1061,8 +1051,8 @@ declare const _default: [
1061
1051
  },
1062
1052
  {
1063
1053
  "name": "dynamicConfigKey",
1064
- "type": "uint24",
1065
- "internalType": "uint24"
1054
+ "type": "uint32",
1055
+ "internalType": "uint32"
1066
1056
  },
1067
1057
  {
1068
1058
  "name": "dynamicConfig",
@@ -1,4 +1,4 @@
1
1
  export { getPosition, getPositionCollateral } from './query.js';
2
- export { getCollateralFactor, getLiquidationBonus, getTargetHealthFactor, getUserAccountData, getUserPosition, getUserTotalDebt, hasCollateral, hasDebt, } from './spoke.js';
2
+ export { getDynamicReserveConfig, getReserve, getTargetHealthFactor, getUserAccountData, getUserPosition, getUserTotalDebt, hasCollateral, hasDebt, } from './spoke.js';
3
3
  export { buildBorrowTx, buildReorderVaultsTx, buildRepayTx, buildWithdrawCollateralsTx, } from './transaction.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/integrations/aave/clients/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGhE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,OAAO,GACR,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/integrations/aave/clients/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGhE,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,OAAO,GACR,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC"}
@@ -119,43 +119,76 @@ export declare function hasCollateral(publicClient: PublicClient, spokeAddress:
119
119
  * - For partial repayment, use any amount less than total debt
120
120
  */
121
121
  export declare function getUserTotalDebt(publicClient: PublicClient, spokeAddress: Address, reserveId: bigint, userAddress: Address): Promise<bigint>;
122
+ /** Result type from the `getReserve` contract call.
123
+ *
124
+ * Matches the on-chain `Reserve` struct defined in `ITBVAaveSpoke.sol`:
125
+ * struct Reserve {
126
+ * address underlying;
127
+ * address hub;
128
+ * uint16 assetId;
129
+ * uint8 decimals;
130
+ * uint24 collateralRisk;
131
+ * ReserveFlags flags; // uint8 bitmap
132
+ * uint32 dynamicConfigKey;
133
+ * }
134
+ *
135
+ * Note: this is the `Reserve` struct, NOT `ReserveConfig` — the contract
136
+ * exposes both as separate functions and they return different shapes.
137
+ */
138
+ type ReserveResult = {
139
+ underlying: Address;
140
+ hub: Address;
141
+ assetId: number;
142
+ decimals: number;
143
+ collateralRisk: number;
144
+ flags: number;
145
+ dynamicConfigKey: number;
146
+ };
122
147
  /**
123
- * Get the target health factor (THF) from the Core Spoke contract.
148
+ * Get reserve data from the Core Spoke contract via the `getReserve` selector.
124
149
  *
125
- * Per-spoke governance parameter. After a liquidation, the protocol targets
126
- * restoring the position to this health factor.
150
+ * Returns static reserve properties including the `dynamicConfigKey` needed
151
+ * for `getDynamicReserveConfig` calls. Use this as a fallback when reserve
152
+ * data is not available from the GraphQL indexer.
127
153
  *
128
- * @param _publicClient - Viem public client (unused in mock, required for API stability)
129
- * @param _spokeAddress - Core Spoke contract address (unused in mock, required for API stability)
130
- * @returns Target health factor in WAD (1e18 = 1.0). Example: 1.10 = 1_100_000_000_000_000_000n
154
+ * Do NOT confuse with the contract's separate `getReserveConfig` function,
155
+ * which returns `{collateralRisk, paused, frozen, borrowable, receiveSharesEnabled}`.
131
156
  *
132
- * TODO: Replace mock with real contract read when Core Spoke ABI is available
157
+ * @param publicClient - Viem public client for reading contracts
158
+ * @param spokeAddress - Core Spoke contract address
159
+ * @param reserveId - Reserve ID
160
+ * @returns Reserve data including `dynamicConfigKey`
133
161
  */
134
- export declare function getTargetHealthFactor(_publicClient: PublicClient, _spokeAddress: Address): Promise<bigint>;
162
+ export declare function getReserve(publicClient: PublicClient, spokeAddress: Address, reserveId: bigint): Promise<ReserveResult>;
163
+ /** Result type from getDynamicReserveConfig contract call */
164
+ type DynamicReserveConfigResult = {
165
+ collateralFactor: bigint;
166
+ maxLiquidationBonus: bigint;
167
+ liquidationFee: bigint;
168
+ };
135
169
  /**
136
- * Get the collateral factor (CF) from the Core Spoke contract.
137
- *
138
- * Determines what fraction of collateral value counts toward borrowing power.
139
- * Default is 75% (7500 BPS), configurable per spoke.
170
+ * Get the target health factor (THF) from the Core Spoke contract.
140
171
  *
141
- * @param _publicClient - Viem public client (unused in mock, required for API stability)
142
- * @param _spokeAddress - Core Spoke contract address (unused in mock, required for API stability)
143
- * @returns Collateral factor in BPS (10000 = 100%). Example: 0.75 = 7500n
172
+ * Per-spoke governance parameter. After a liquidation, the protocol targets
173
+ * restoring the position to this health factor.
144
174
  *
145
- * TODO: Replace mock with real contract read when Core Spoke ABI is available
175
+ * @param publicClient - Viem public client for reading contracts
176
+ * @param spokeAddress - Core Spoke contract address
177
+ * @returns Target health factor in WAD (1e18 = 1.0). Example: 1.10 = 1_100_000_000_000_000_000n
146
178
  */
147
- export declare function getCollateralFactor(_publicClient: PublicClient, _spokeAddress: Address): Promise<bigint>;
179
+ export declare function getTargetHealthFactor(publicClient: PublicClient, spokeAddress: Address): Promise<bigint>;
148
180
  /**
149
- * Get the liquidation bonus (LB) from the Core Spoke contract.
150
- *
151
- * The bonus multiplier awarded to liquidators. Fixed at 1.05 (5% bonus)
152
- * with min = max (no Dutch auction).
181
+ * Get the dynamic reserve config from the Core Spoke contract.
153
182
  *
154
- * @param _publicClient - Viem public client (unused in mock, required for API stability)
155
- * @param _spokeAddress - Core Spoke contract address (unused in mock, required for API stability)
156
- * @returns Liquidation bonus in WAD (1e18 = 1.0). Example: 1.05 = 1_050_000_000_000_000_000n
183
+ * Returns collateral factor, max liquidation bonus, and liquidation fee
184
+ * for a specific reserve and dynamic config key.
157
185
  *
158
- * TODO: Replace mock with real contract read when Core Spoke ABI is available
186
+ * @param publicClient - Viem public client for reading contracts
187
+ * @param spokeAddress - Core Spoke contract address
188
+ * @param reserveId - Reserve ID (e.g., vBTC reserve ID from indexer config)
189
+ * @param dynamicConfigKey - Dynamic config key (from reserve data)
190
+ * @returns Dynamic reserve config with collateralFactor (BPS), maxLiquidationBonus (BPS), liquidationFee (BPS)
159
191
  */
160
- export declare function getLiquidationBonus(_publicClient: PublicClient, _spokeAddress: Address): Promise<bigint>;
192
+ export declare function getDynamicReserveConfig(publicClient: PublicClient, spokeAddress: Address, reserveId: bigint, dynamicConfigKey: number): Promise<DynamicReserveConfigResult>;
193
+ export {};
161
194
  //# sourceMappingURL=spoke.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spoke.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/integrations/aave/clients/spoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAOlD,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAuCrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,wBAAwB,CAAC,CAkBnC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAShC;AAED;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,MAAM,CAAC,CASjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,YAAY,EAC3B,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,YAAY,EAC3B,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,YAAY,EAC3B,aAAa,EAAE,OAAO,GACrB,OAAO,CAAC,MAAM,CAAC,CAEjB"}
1
+ {"version":3,"file":"spoke.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/integrations/aave/clients/spoke.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAuCrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,kBAAkB,CACtC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,wBAAwB,CAAC,CAkBnC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACnC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAShC;AAED;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,MAAM,CAAC,CASjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,KAAK,aAAa,GAAG;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,UAAU,CAC9B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,CAAC,CAQxB;AASD,6DAA6D;AAC7D,KAAK,0BAA0B,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,0BAA0B,CAAC,CAQrC"}
@@ -77,39 +77,4 @@ export declare const MIN_HEALTH_FACTOR_FOR_BORROW = 1.2;
77
77
  * 0.01% buffer (1 basis point) - the contract only takes what's owed.
78
78
  */
79
79
  export declare const FULL_REPAY_BUFFER_DIVISOR = 10000n;
80
- /**
81
- * Mock Core Spoke parameter: Target Health Factor (THF)
82
- * Per-spoke governance parameter. After liquidation, the protocol targets
83
- * restoring the position to this health factor.
84
- *
85
- * Stored in WAD format — Aave's fixed-point encoding where 1e18 = 1.0.
86
- * To convert to a plain number: `Number(value) / 1e18`.
87
- * 1.10 * 1e18 = 1_100_000_000_000_000_000n
88
- *
89
- * TODO: Replace with real contract read when Core Spoke ABI is available
90
- */
91
- export declare const MOCK_TARGET_HEALTH_FACTOR_WAD = 1100000000000000000n;
92
- /**
93
- * Mock Core Spoke parameter: Collateral Factor (CF)
94
- * Determines what fraction of collateral value counts toward borrowing power.
95
- *
96
- * Stored in BPS (basis points) — 1 BPS = 0.01%, so 10000 BPS = 100%.
97
- * To convert to a decimal: `Number(value) / 10000`.
98
- * 0.75 (75%) * 10000 = 7500n
99
- *
100
- * TODO: Replace with real contract read when Core Spoke ABI is available
101
- */
102
- export declare const MOCK_COLLATERAL_FACTOR_BPS = 7500n;
103
- /**
104
- * Mock Core Spoke parameter: Liquidation Bonus (LB)
105
- * Bonus multiplier awarded to liquidators. Fixed at 1.05 (5% bonus),
106
- * min = max (no Dutch auction).
107
- *
108
- * Stored in WAD format — Aave's fixed-point encoding where 1e18 = 1.0.
109
- * To convert to a plain number: `Number(value) / 1e18`.
110
- * 1.05 * 1e18 = 1_050_000_000_000_000_000n
111
- *
112
- * TODO: Replace with real contract read when Core Spoke ABI is available
113
- */
114
- export declare const MOCK_LIQUIDATION_BONUS_WAD = 1050000000000000000n;
115
80
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tbv/integrations/aave/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,kEAAkE;;IAElE,sCAAsC;;IAEtC,wCAAwC;;IAExC,6DAA6D;;CAErD,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,QAAQ,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAAS,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,uBAA6B,CAAC;AAExE;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,uBAA6B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tbv/integrations/aave/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,kEAAkE;;IAElE,sCAAsC;;IAEtC,wCAAwC;;IAExC,6DAA6D;;CAErD,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,QAAQ,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,SAAS,CAAC"}