@evaafi/sdk 0.6.3-a → 0.6.3-b
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/CHANGELOG.md +280 -0
- package/dist/constants/assets.d.ts +4 -0
- package/dist/constants/assets.js +15 -1
- package/dist/constants/general.d.ts +2 -0
- package/dist/constants/general.js +3 -1
- package/dist/constants/pools.d.ts +1 -0
- package/dist/constants/pools.js +16 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/prices/utils.js +1 -1
- package/dist/utils/userJettonWallet.js +10 -0
- package/package.json +1 -1
- package/src/constants/assets.ts +26 -0
- package/src/constants/general.ts +3 -0
- package/src/constants/pools.ts +20 -1
- package/src/index.ts +1 -0
- package/src/prices/PricesCollector.ts +1 -1
- package/src/prices/utils.ts +1 -1
- package/src/utils/userJettonWallet.ts +10 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/)
|
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## 0.6.3-b — 2025-04-30
|
|
8
|
+
### Added
|
|
9
|
+
- ```USDe and tsUSDe``` new tokens in Main ```PoolConfig```
|
|
10
|
+
- Minor bug fixes
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## 0.6.3 — 2025-04-01
|
|
14
|
+
### Added
|
|
15
|
+
- ```EvaaRewards``` wrapper of RewardUser contract with ```PoolAssetConfig```
|
|
16
|
+
- ```RewardUser``` wrapper of reward user contract
|
|
17
|
+
- ```RewardMaster``` wrapper of reward master contract
|
|
18
|
+
- ```JettonMinget``` wrapper of jetton master contract
|
|
19
|
+
- ```JettonWallet``` wrapper of jetton wallet contract
|
|
20
|
+
- ```EVAA_REWARDS_MASTER_CODE_MAINNET``` and ```EVAA_REWARDS_MASTER_CODE_TESTNET``` is constants for reward master code
|
|
21
|
+
- ```EVAA_REWARDS_USER_CODE_TESTNET``` and ```EVAA_REWARDS_USER_CODE_MAINNET``` is constants for reward user code
|
|
22
|
+
- ```TESTNET_MASTER_REWARD_CONFIG``` testnet TON config of reward
|
|
23
|
+
- ```TESTNET_MASTER_EUSDT_REWARD_CONFIG``` testnet EUSDT config of reward
|
|
24
|
+
- ```MAINNET_MASTER_TON_REWARD_CONFIG``` mainnet TON config of reward
|
|
25
|
+
- ```MAINNET_MASTER_USDT_REWARD_CONFIG``` mainnet USDT config of reward
|
|
26
|
+
|
|
27
|
+
## 0.6.2-c — 2025-01-07
|
|
28
|
+
### Added
|
|
29
|
+
- ```getAssetLiquidityMinusReserves``` function needed to count the amount of free amount for withdrawal
|
|
30
|
+
### Fixed
|
|
31
|
+
- ```borrowLimits``` function now take into account the amount available for withdrawal
|
|
32
|
+
|
|
33
|
+
## 0.6.2-b — 2024-12-17
|
|
34
|
+
### Added
|
|
35
|
+
- new field in ```UserLiteData``` . ```fullyParsed``` and ```havePrincipalWithoutPrice```
|
|
36
|
+
true if all prices for user parsing were provided or true if have a principal without price
|
|
37
|
+
now user.getSync and parseUserData can work without some prices
|
|
38
|
+
- ```predictAPY``` - function that predicts a change in apy after supply or withdraw
|
|
39
|
+
|
|
40
|
+
## 0.6.2-a — 2024-12-13
|
|
41
|
+
### Added
|
|
42
|
+
- new field in UserLiteData ```user.data.realPrincipals``` -
|
|
43
|
+
principals before applying dusts
|
|
44
|
+
### Fixed
|
|
45
|
+
- getPricesForWithdraw/getPricesForLiquidate they should now be called with a different argument
|
|
46
|
+
|
|
47
|
+
## 0.6.2 — 2024-11-21
|
|
48
|
+
### Added
|
|
49
|
+
- ALTS Pool
|
|
50
|
+
- PricesCollector class
|
|
51
|
+
- Supports multiple prices sources [iota nft, evaa backend, internetcomputer (icp) http backend] (sources can be configured)
|
|
52
|
+
- Updates prices only when needed, prices may expire no earlier than a minute later
|
|
53
|
+
- Ability to cut prices and resign it and send only the necessary ones in order to reduce fee
|
|
54
|
+
- ```typescript
|
|
55
|
+
async getPricesForWithdraw(userPrincipals: Dictionary<bigint, bigint>, withdrawAsset: PoolAssetConfig, collateralToDebt = false, ....)
|
|
56
|
+
```
|
|
57
|
+
collateralToDebt param responsible for the fact that supply can go to borrow (there is no such case at the front end)
|
|
58
|
+
- ```typescript
|
|
59
|
+
async getPricesForLiquidate(userPrincipals: Dictionary<bigint, bigint> ...)
|
|
60
|
+
```
|
|
61
|
+
- Price Signature Vrification
|
|
62
|
+
- Minimal Oracles Number Verification
|
|
63
|
+
- Independent and parallel loading of prices (now the fastest but invalid response won't break anything)
|
|
64
|
+
- Support for partial number of assets from price sources
|
|
65
|
+
- Updated examples in docs/examples
|
|
66
|
+
- PricesCollector test coverage
|
|
67
|
+
- If the price is missing (for example, for security reasons), then there will be no error, it will simply NOT be added to the result dict
|
|
68
|
+
|
|
69
|
+
### Changed
|
|
70
|
+
- getPrices is deprecated use PricesCollector instead
|
|
71
|
+
|
|
72
|
+
## 0.6.1-a — 2024-10-29
|
|
73
|
+
### Changed
|
|
74
|
+
- updated `EVAA_LP_MAINNET_VERSION` to `3`
|
|
75
|
+
- `awaitedSupply` is always defined
|
|
76
|
+
### Fixed
|
|
77
|
+
- `applyDust` is `false` by default in `parseUserLiteData` and `parseUserData`
|
|
78
|
+
- `minimalOracles` is `3` in all pools
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## 0.6.1 — 2024-10-22
|
|
82
|
+
### Changed
|
|
83
|
+
- added liquidation.ts with ```findAssetById```, ```calculateAssetsValues```, ```selectGreatestAssets```, ```calculateMinCollateralByTransferredAmount```, ```calculateLiquidationAmounts```, ```isLiquidatable```, ```isBadDebt```, ```addReserve```, ```deductReserve```, ```toAssetAmount```, ```toAssetWorth```, ```addLiquidationBonus```, ```deductLiquidationBonus```, ```PreparedAssetInfo```, ```prepareAssetInfo``` functions required or flexible liquidations calculation.
|
|
84
|
+
- user. ```getSync``` and ```getSyncLite``` new argument ```applyDust``` by default is ```false```;
|
|
85
|
+
- updated sdk usage example
|
|
86
|
+
### Fixed
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## 0.6.0a — 2024-10-14
|
|
90
|
+
### Changed
|
|
91
|
+
- user. ```getSync``` and ```getSyncLite``` new argument ```applyDust``` by default is ```false```
|
|
92
|
+
### Fixed
|
|
93
|
+
- Healthfactor calculation minor bug
|
|
94
|
+
- createLiquidationMessage fix new field payloadForwardAmount
|
|
95
|
+
|
|
96
|
+
## 0.6.0 — 2024-10-10
|
|
97
|
+
### Added
|
|
98
|
+
- SDK Supports Evaa v6 smart contracts
|
|
99
|
+
### Fixed
|
|
100
|
+
- Updated documentation and examples for v6 interactions
|
|
101
|
+
- User Withdrawal and Borrow limits
|
|
102
|
+
## 0.5.6a - 2024-10-09
|
|
103
|
+
### Fixed
|
|
104
|
+
- Fix typo in ```calculateMaximumWithdrawAmount```
|
|
105
|
+
|
|
106
|
+
## 0.5.6 — 2024-09-28
|
|
107
|
+
|
|
108
|
+
### Added
|
|
109
|
+
- ```isTonAsset(PoolAssetConfig)``` function
|
|
110
|
+
### Fixed
|
|
111
|
+
Dust is a small amount of principal that is ignored
|
|
112
|
+
- ```parseUserLiteData``` (dust) & ```parseUserData``` (dust and withdrawLimits) calculations problem
|
|
113
|
+
- ```user.data.withdrawalLimits```, ```user.data.balance```, ```user.data.principals``` calculation for LP pool contract and main pool contract
|
|
114
|
+
### Changed
|
|
115
|
+
- ```parseUserLiteData``` (without prices), ```parseUserData``` applyDust argument default value changed to ```True```
|
|
116
|
+
- Many composite types were removed from sdk
|
|
117
|
+
- ```PoolTonAssetConfig, PoolJettonAssetConfig``` -> ```PoolAssetConfig```,
|
|
118
|
+
- ```JettonMessageParameters, SupplyBaseParameters, TonSupplyParameters, JettonSupplyParameters``` -> ```SupplyParameters```,
|
|
119
|
+
- ```LiquidationBasePrameters, TonLiquidationParameters, JettonLiquidationParameters``` -> ```LiquidationParameters```
|
|
120
|
+
|
|
121
|
+
## 0.5.5
|
|
122
|
+
|
|
123
|
+
### Added
|
|
124
|
+
- calculateMaximumWithdrawAmount function
|
|
125
|
+
### Fixed
|
|
126
|
+
- parseUserLiteData (dust) & parseUserData (dust and withdrawLimits) calculations problem
|
|
127
|
+
|
|
128
|
+
## 0.5.4 — 2024-09-09
|
|
129
|
+
|
|
130
|
+
check ```tests\supply_withdraw_test.ts``` for new examples
|
|
131
|
+
|
|
132
|
+
### Added
|
|
133
|
+
|
|
134
|
+
- Pools supports (new argument for Evaa master contract) + LP_POOL constants, default is MAINNET_POOL_CONFIG, default pool is MAINNET_POOL_CONFIG
|
|
135
|
+
```typescript
|
|
136
|
+
const evaa = client.open(new Evaa({poolConfig: TESTNET_LP_POOL_CONFIG}));
|
|
137
|
+
|
|
138
|
+
const evaaMainNet = clientMainNet.open(new Evaa({poolConfig: MAINNET_LP_POOL_CONFIG}));
|
|
139
|
+
```
|
|
140
|
+
- New types for pools initializtion, for assets
|
|
141
|
+
check ```constants\assets.ts``` for new examples
|
|
142
|
+
|
|
143
|
+
- getPrices - a new function inside Evaa, returns prices of current pool
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
await evaaMainNet.getPrices()
|
|
147
|
+
```
|
|
148
|
+
### Changed
|
|
149
|
+
- New argument nftId (depends on pool) for getPrices
|
|
150
|
+
```typescript
|
|
151
|
+
export async function getPrices(endpoints: string[] = ["api.stardust-mainnet.iotaledger.net"], nftId: string = MAIN_POOL_NFT_ID) {
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
- Everything about working with assets, new assets list
|
|
155
|
+
```typescript
|
|
156
|
+
import { JUSDC_MAINNET, JUSDC_TESTNET, JUSDT_MAINNET, JUSDT_TESTNET, STTON_MAINNET, STTON_TESTNET, TON_MAINNET, TON_STORM_MAINNET, TONUSDT_DEDUST_MAINNET, TSTON_MAINNET, USDT_MAINNET, USDT_STORM_MAINNET } from "@evaafi/sdk";
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
await evaaMainNet.sendSupply(sender_mainnet, toNano(1), {
|
|
161
|
+
queryID: 0n,
|
|
162
|
+
includeUserCode: true,
|
|
163
|
+
amount: 500_000_000n,
|
|
164
|
+
userAddress: address_mainnet,
|
|
165
|
+
asset: TON_MAINNET
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
### Fixed
|
|
169
|
+
- predictHealthFactor minor fixes
|
|
170
|
+
- getUserJettonWallet all currencies support
|
|
171
|
+
|
|
172
|
+
## 0.5.3 — 2024-08-20
|
|
173
|
+
|
|
174
|
+
### Fixed
|
|
175
|
+
- getPrices now supports several endpoints (works on the principle of which one will answer faster, whose answer is used) and throws an exception if prices are not loaded
|
|
176
|
+
|
|
177
|
+
## 0.5.2 — 2024-08-19
|
|
178
|
+
|
|
179
|
+
### Fixed
|
|
180
|
+
- predictHealthFactor argument processing improving
|
|
181
|
+
- getSync fixed parsing contract state, base64url was replaced to base64 encoding which has much higher support
|
|
182
|
+
|
|
183
|
+
## 0.5.1 — 2024-07-05
|
|
184
|
+
|
|
185
|
+
### Added
|
|
186
|
+
- predictHealthFactor function to predict a change in a health factor after repay, borrow, supply, withdraw
|
|
187
|
+
|
|
188
|
+
## 0.5.0 — 2024-06-29
|
|
189
|
+
This release contains breaking changes.
|
|
190
|
+
|
|
191
|
+
### Added
|
|
192
|
+
- Reserve variables parsing on user & master sc
|
|
193
|
+
- Added endpoint argument for getPrices, default api.stardust-mainnet.iotaledger.net
|
|
194
|
+
- Added applyDust (default false) option in parseUserLiteData and parseUserData
|
|
195
|
+
|
|
196
|
+
### Changed
|
|
197
|
+
- Master contracts' version
|
|
198
|
+
- Testnet master contract address
|
|
199
|
+
- Parsers on master sc
|
|
200
|
+
- Parsers on user sc
|
|
201
|
+
- Liquidation calculations now counts with reserve factor from master config
|
|
202
|
+
|
|
203
|
+
### Fixed
|
|
204
|
+
- UserBalance calculation was fixed
|
|
205
|
+
|
|
206
|
+
## 0.4.0 — 2024-06-01
|
|
207
|
+
This release contains breaking changes.
|
|
208
|
+
|
|
209
|
+
### Added
|
|
210
|
+
- Master storage onchain getter
|
|
211
|
+
- User storage onchain getter
|
|
212
|
+
- Testnet flag for `parseMasterData`, `parseUserData` and `parseUserLiteData` functions
|
|
213
|
+
- `maxTotalSupply` field to Assets Config
|
|
214
|
+
- Seperate Assets ID for Mainnet and Testnet
|
|
215
|
+
|
|
216
|
+
### Changed
|
|
217
|
+
- Master contracts' version
|
|
218
|
+
- Testnet master contract address
|
|
219
|
+
|
|
220
|
+
### Removed
|
|
221
|
+
- `ASSET_ID` constant
|
|
222
|
+
|
|
223
|
+
### Fixed
|
|
224
|
+
- Jetton wallets address calculation
|
|
225
|
+
- Field names in Assets Config and Assets Data serialization functions
|
|
226
|
+
|
|
227
|
+
## 0.3.2 — 2024-04-20
|
|
228
|
+
### Added
|
|
229
|
+
- New asset - Tether USD
|
|
230
|
+
|
|
231
|
+
## 0.3.1 — 2024-04-19
|
|
232
|
+
### Added
|
|
233
|
+
- New asset - tsTON
|
|
234
|
+
|
|
235
|
+
## 0.3.0 — 2024-04-04
|
|
236
|
+
### Added
|
|
237
|
+
- New asset - stTON
|
|
238
|
+
|
|
239
|
+
### Changed
|
|
240
|
+
- Price fetching from another source
|
|
241
|
+
- Testnet master contract address
|
|
242
|
+
- Master contracts' version
|
|
243
|
+
|
|
244
|
+
### Removed
|
|
245
|
+
- Ethereum dependencies
|
|
246
|
+
|
|
247
|
+
## 0.2.0 — 2024-03-13
|
|
248
|
+
This release contains breaking changes.
|
|
249
|
+
|
|
250
|
+
### Added
|
|
251
|
+
- BOC of last sent message via TonConnect. Can be obtained by `getLastSentBoc` function
|
|
252
|
+
- Calculation of user's health factor
|
|
253
|
+
|
|
254
|
+
### Changed
|
|
255
|
+
- Testnet master contract address and version
|
|
256
|
+
- Supply fee from 0.5 TON to 0.3 TON
|
|
257
|
+
- APY moved from user data to master data
|
|
258
|
+
|
|
259
|
+
### Removed
|
|
260
|
+
- Description of some methods in `UserContract` and `MasterContract`
|
|
261
|
+
|
|
262
|
+
### Fixed
|
|
263
|
+
- Calculation of borrow limits
|
|
264
|
+
|
|
265
|
+
## 0.1.0 — 2024-03-11
|
|
266
|
+
### Added
|
|
267
|
+
- Parsing user lite data, which does not require prices
|
|
268
|
+
- Assets reserves to `MasterData`
|
|
269
|
+
- Types and methods descriptions in `MasterContract` and `UserContract`
|
|
270
|
+
|
|
271
|
+
### Changed
|
|
272
|
+
- Added parallel price fetching
|
|
273
|
+
- Crypto library to 'crypto-js' for compatibility with browser
|
|
274
|
+
- Testnet Master version to 2
|
|
275
|
+
|
|
276
|
+
### Removed
|
|
277
|
+
- `sort-deep-object-arrays` dependency
|
|
278
|
+
|
|
279
|
+
### Fixed
|
|
280
|
+
- Getting user's jetton wallet
|
|
@@ -8,6 +8,8 @@ export declare const ASSET_ID: {
|
|
|
8
8
|
tsTON: bigint;
|
|
9
9
|
uTON: bigint;
|
|
10
10
|
tgBTC: bigint;
|
|
11
|
+
USDe: bigint;
|
|
12
|
+
tsUSDe: bigint;
|
|
11
13
|
TONUSDT_DEDUST: bigint;
|
|
12
14
|
TONUSDT_STONFI: bigint;
|
|
13
15
|
TON_STORM: bigint;
|
|
@@ -37,3 +39,5 @@ export declare const NOT_MAINNET: PoolAssetConfig;
|
|
|
37
39
|
export declare const UTON_MAINNET: PoolAssetConfig;
|
|
38
40
|
export declare const TGBTC_TESTNET: PoolAssetConfig;
|
|
39
41
|
export declare const EUSDT_TESTNET: PoolAssetConfig;
|
|
42
|
+
export declare const USDE_MAINNET: PoolAssetConfig;
|
|
43
|
+
export declare const TSUSDE_MAINNET: PoolAssetConfig;
|
package/dist/constants/assets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EUSDT_TESTNET = exports.TGBTC_TESTNET = exports.UTON_MAINNET = exports.NOT_MAINNET = exports.DOGS_MAINNET = exports.CATI_MAINNET = exports.USDT_STORM_MAINNET = exports.TON_STORM_MAINNET = exports.TONUSDT_DEDUST_MAINNET = exports.STTON_TESTNET = exports.JUSDC_TESTNET = exports.JUSDT_TESTNET = exports.USDT_MAINNET = exports.TSTON_MAINNET = exports.STTON_MAINNET = exports.JUSDC_MAINNET = exports.JUSDT_MAINNET = exports.TON_TESTNET = exports.TON_MAINNET = exports.UNDEFINED_ASSET = exports.ASSET_ID = void 0;
|
|
3
|
+
exports.TSUSDE_MAINNET = exports.USDE_MAINNET = exports.EUSDT_TESTNET = exports.TGBTC_TESTNET = exports.UTON_MAINNET = exports.NOT_MAINNET = exports.DOGS_MAINNET = exports.CATI_MAINNET = exports.USDT_STORM_MAINNET = exports.TON_STORM_MAINNET = exports.TONUSDT_DEDUST_MAINNET = exports.STTON_TESTNET = exports.JUSDC_TESTNET = exports.JUSDT_TESTNET = exports.USDT_MAINNET = exports.TSTON_MAINNET = exports.STTON_MAINNET = exports.JUSDC_MAINNET = exports.JUSDT_MAINNET = exports.TON_TESTNET = exports.TON_MAINNET = exports.UNDEFINED_ASSET = exports.ASSET_ID = void 0;
|
|
4
4
|
const core_1 = require("@ton/core");
|
|
5
5
|
const sha256BigInt_1 = require("../utils/sha256BigInt");
|
|
6
6
|
const general_1 = require("./general");
|
|
@@ -13,6 +13,8 @@ exports.ASSET_ID = {
|
|
|
13
13
|
tsTON: (0, sha256BigInt_1.sha256Hash)('tsTON'),
|
|
14
14
|
uTON: (0, sha256BigInt_1.sha256Hash)('uTON'),
|
|
15
15
|
tgBTC: (0, sha256BigInt_1.sha256Hash)('tgBTC'),
|
|
16
|
+
USDe: (0, sha256BigInt_1.sha256Hash)('USDe'),
|
|
17
|
+
tsUSDe: (0, sha256BigInt_1.sha256Hash)('tsUSDe'),
|
|
16
18
|
// LP
|
|
17
19
|
TONUSDT_DEDUST: (0, sha256BigInt_1.sha256Hash)('TONUSDT_DEDUST'),
|
|
18
20
|
TONUSDT_STONFI: (0, sha256BigInt_1.sha256Hash)('TONUSDT_STONFI'),
|
|
@@ -140,3 +142,15 @@ exports.EUSDT_TESTNET = {
|
|
|
140
142
|
jettonMasterAddress: core_1.Address.parse('kQBe4gtSQMxM5RpMYLr4ydNY72F8JkY-icZXG1NJcsju8XM7'),
|
|
141
143
|
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201021101000323000114ff00f4a413f4bcf2c80b0102016202030202cc0405001ba0f605da89a1f401f481f481a8610201d40607020120080900c30831c02497c138007434c0c05c6c2544d7c0fc03383e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7e08403e29fa954882ea54c4d167c0278208405e3514654882ea58c511100fc02b80d60841657c1ef2ea4d67c02f817c12103fcbc2000113e910c1c2ebcb853600201200a0b0083d40106b90f6a2687d007d207d206a1802698fc1080bc6a28ca9105d41083deecbef09dd0958f97162e99f98fd001809d02811e428027d012c678b00e78b6664f6aa401f1503d33ffa00fa4021f001ed44d0fa00fa40fa40d4305136a1522ac705f2e2c128c2fff2e2c254344270542013541403c85004fa0258cf1601cf16ccc922c8cb0112f400f400cb00c920f9007074c8cb02ca07cbffc9d004fa40f40431fa0020d749c200f2e2c4778018c8cb055008cf1670fa0217cb6b13cc80c0201200d0e009e8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08209c9c380a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5402f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a019ad822860822625a028062849e5c412440e0dd7c138c34975c2c0600f1000d73b51343e803e903e90350c01f4cffe803e900c145468549271c17cb8b049f0bffcb8b08160824c4b402805af3cb8b0e0841ef765f7b232c7c572cfd400fe8088b3c58073c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b552000705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023007cc30023c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed54', 'hex'))[0],
|
|
142
144
|
};
|
|
145
|
+
exports.USDE_MAINNET = {
|
|
146
|
+
name: 'USDe',
|
|
147
|
+
assetId: exports.ASSET_ID.USDe,
|
|
148
|
+
jettonMasterAddress: core_1.Address.parse('EQAIb6KmdfdDR7CN1GBqVJuP25iCnLKCvBlJ07Evuu2dzP5f'),
|
|
149
|
+
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c7201020f010003f0000114ff00f4a413f4bcf2c80b01020162020302f8d001d0d3030171b08e48135f038020d721ed44d0d303fa00fa40fa40d104d31f01840f218210178d4519ba0282107bdd97deba12b1f2f48040d721fa003012a0401303c8cb0358fa0201cf1601cf16c9ed54e0fa40fa4031fa0031f401fa0031fa00013170f83a02d31f012082100f8a7ea5ba8e85303459db3ce03304050201200d0e01f603d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40d15305c705531ac7052571b0c00021b1f2ad523cc705500bb1f2e0495126a120c2fff2af04fa40f401fa002020d70b009ad74bc00101c001b0f2b19130e2c88210178d451901cb1f500a01cb3f5008fa0222cf1601cf1626fa025007cf160602d0228210178d4519ba8e84325adb3ce034218210595f07bcba8e843101db3ce032208210eed236d3ba8e2f30018040d721d303d1ed44d0d303fa00fa40fa40d1335142c705f2e04a403303c8cb0358fa0201cf1601cf16c9ed54e06c218210d372158cbadc840ff2f0080901d0c9088e1533c8801801cb0523cf1670fa0250077158cb6accc98e4af82a54244070546004131503c8cb0358fa0201cf1601cf16c921c8cb0113f40012f400cb00c920f9007074c8cb02ca07cbffc9d0c8801801cb0501cf1670fa024018775003cb6bccccc9e245370700b62191729171e2f839206e938124b89120e2216e94318128739101e25023a813a0738103a370f83ca00270f83612a00170f836a07381040982100966018070f837a0bcf2b0048050fb00430003c8cb0358fa0201cf1601cf16c9ed5403f4ed44d0d303fa00fa40fa40d12372b0c002f26d07d33f0101fa005141a004fa40fa4053bac705f82a5464e070546004131503c8cb0358fa0201cf1601cf16c921c8cb0113f40012f400cb00c9f9007074c8cb02ca07cbffc9d0500cc7051bb1f2e04a09fa0021925f04e30d26d70b01c000b393306c33e30d55020a0b0c01f2ed44d0d303fa00fa40fa40d106d33f0101fa00fa40f401d15141a15288c705f2e04926c2fff2afc882107bdd97de01cb1f5801cb3f01fa0221cf1658cf16c9c8801801cb0526cf1670fa02017158cb6accc903f839206e943081180fde718102f270f8380170f836a0811ba470f836a0bcf2b0028050fb00030c0060c882107362d09c01cb1f2501cb3f5004fa0258cf1658cf16c9c8801001cb0524cf1658fa02017158cb6accc98011fb00007a5054a1f82fa07381040982100966018070f837b60972fb02c8801001cb055005cf1670fa027001cb6a8210d53276db01cb1f5801cb3fc9810082fb0059002003c8cb0358fa0201cf1601cf16c9ed540027bfd8176a2686981fd007d207d206899fc15209840021bc508f6a2686981fd007d207d2068af81c', 'hex'))[0],
|
|
150
|
+
};
|
|
151
|
+
exports.TSUSDE_MAINNET = {
|
|
152
|
+
name: 'tsUSDe',
|
|
153
|
+
assetId: exports.ASSET_ID.tsUSDe,
|
|
154
|
+
jettonMasterAddress: core_1.Address.parse('EQDQ5UUyPHrLcQJlPAczd_fjxn8SLrlNQwolBznxCdSlfQwr'),
|
|
155
|
+
jettonWalletCode: core_1.Cell.fromBoc(Buffer.from('b5ee9c72010219010006bf000114ff00f4a413f4bcf2c80b01020162020302f6d001d0d3030171b08ef0135f038020d721ed44d0d303fa00fa40fa40fa00d33fd106d31f01840f218210178d4519ba228210b2583ed5bab12282107bdd97debab1f2f4018040d721fa0030218210178d4519ba0282107bdd97deba12b18e19a0550405c8cb035004fa0258cf1601cf1601fa02cb3fc9ed54e30de004050201201516003614a004413505c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5404a0fa40fa4031fa0031f401fa0031fa00013170f83a02d31f012082100f8a7ea5ba8e85303459db3ce0208210d750cec9ba8e85303459db3ce033228210178d4519ba8e84325adb3ce0228210b2583ed5ba0607080901ec03d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40fa00d33fd15327c705533cc7052771b0c00021b1f2ad525ec705500db1f2e0495148a120c2fff2af06fa40f401fa002020d70b009ad74bc00101c001b0f2b19130e22d8e1170c80101ca0001cf16c971c8cb00ccc9d0de70c80a01f603d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40fa00d33fd15228c705532bc7052671b0c00021b1f2ad524dc705500cb1f2e049f82327bcf2e14e0af2e04b5196a120c2fff2af04fa40f401fa002020d70b009ad74bc00101c001b0f2b19130e27fc80101ca0001cf16c971c8cb00ccc9d00d01f4ed44d0d303fa00fa40fa40fa00d33fd12572b0c002f26d09d33f0101fa005161a006d33f31fa40fa40536cc705f82a5464907054700020103510241037102605c8cb035004fa0258cf1601cf1601fa02cb3fc921c8cb0113f40012f400cb00c9f9007074c8cb02ca07cbffc9d0500ec7051db1f2e04a0bfa00210f02d88e84325adb3ce034218210595f07bcba8e843101db3ce032208210eed236d3ba8e3b30018040d721d303d1ed44d0d303fa00fa40fa40fa00d33fd1355161c705f2e04a1045551205c8cb035004fa0258cf1601cf1601fa02cb3fc9ed54e06c218210d372158cbadc840ff2f0111202fe8210178d451901cb1f500d01cb3f500bfa021bcb3f24cf1601cf1629fa025008cf16c90a8e57f82a5426607054700020103510241037102605c8cb035004fa0258cf1601cf1601fa02cb3fc921c8cb0113f40012f400cb00c920f9007074c8cb02ca07cbffc9d0c8801801cb0501cf1670fa02401a775003cb6bccccc9e30d0b0c002a35c8801801cb0525cf1670fa0250097158cb6accc900cc47692191729171e2f839206e938126e29120e2216e9431812a169101e25023a813a0738103e770f83ca00270f83612a00170f836a07381044d82100966018070f837a0bcf2b0068050fb00103510340205c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5401fe70c88210b2583ed501cb1f500b01cb3f5009fa0219cb3f22cf1601cf1627fa025006cf16c9c8801801cb0529cf1670fa02017158cb6accc947692191729171e2f839206e938126e29120e2216e9431812a169101e25023a813a0738103e770f83ca00270f83612a00170f836a07381044d82100966018070f837a0bcf2b0060e003c8050fb001035443005c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5401be8e30c882107362d09c01cb1f2501cb3f5004fa0258cf1658cf16c9c8801001cb0526cf1658fa02017158cb6accc98011fb00925f04e228d70b01c000b396301027353530e30d55300505c8cb035004fa0258cf1601cf1601fa02cb3fc9ed541000825076a1f82fa07381044d82100966018070f837b60972fb02c8801001cb055007cf1670fa027001cb6a8210d53276db01cb1f500401cb3fc9810082fb001024102301b8ed44d0d303fa00fa40fa40fa00d33fd1302472b0c002f26d08d33f0101fa00d33f50b2a001fa4031fa4030523ac705f2e04a28d70b01c000b39710381027365f03e30d55300505c8cb035004fa0258cf1601cf1601fa02cb3fc9ed541301f6ed44d0d303fa00fa40fa40fa00d33fd108d33f0101fa00fa40f401d15161a1524ac705f2e04928c2fff2afc882107bdd97de01cb1f5801cb3f01fa0223cf165004cf16c9c8801801cb0522cf1670fa02017158cb6accc905f839206e943081187fde718102f270f8380170f836a081203770f836a0bcf2b004805014007e5076a1f82fa07381044d82100966018070f837b60972fb02c8801001cb055007cf1670fa027001cb6a8210d53276db01cb1f500501cb3fc9810082fb0010340036fb0045130205c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5402015817180029bc508f6a2686981fd007d207d207d00699fe8af82c0029b74e5da89a1a607f401f481f481f401a67fa2d88500031b7605da89a1a607f401f481f481f401a67fa2b667f05482610', 'hex'))[0],
|
|
156
|
+
};
|
|
@@ -22,6 +22,8 @@ export declare const EVAA_LP_MAINNET: Address;
|
|
|
22
22
|
export declare const EVAA_LP_MAINNET_VERSION = 3;
|
|
23
23
|
export declare const EVAA_ALTS_MAINNET: Address;
|
|
24
24
|
export declare const EVAA_ALTS_MAINNET_VERSION = 0;
|
|
25
|
+
export declare const EVAA_ETHENA_MAINNET: Address;
|
|
26
|
+
export declare const EVAA_ETHENA_VERSION = 0;
|
|
25
27
|
export declare const EVAA_REWARDS_MASTER_TESTNET: Address;
|
|
26
28
|
export declare const EVAA_USDT_REWARDS_MASTER_MAINNET: Address;
|
|
27
29
|
export declare const EVAA_TON_REWARDS_MASTER_MAINNET: Address;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FEES = exports.OPCODES = exports.EVAA_REWARDS_USER_CODE_MAINNET = exports.EVAA_REWARDS_USER_CODE_TESTNET = exports.EVAA_REWARDS_MASTER_CODE_MAINNET = exports.EVAA_REWARDS_MASTER_CODE_TESTNET = exports.JETTON_WALLET_STANDART_CODE_TESTNET = exports.JETTON_WALLET_STANDART_CODE = exports.LENDING_CODE = exports.ORACLES_ALTS = exports.ORACLES_LP = exports.ORACLES_TESTNET = exports.ORACLES_MAINNET = exports.EVAA_TON_REWARDS_MASTER_MAINNET = exports.EVAA_USDT_REWARDS_MASTER_MAINNET = exports.EVAA_REWARDS_MASTER_TESTNET = exports.EVAA_ALTS_MAINNET_VERSION = exports.EVAA_ALTS_MAINNET = exports.EVAA_LP_MAINNET_VERSION = exports.EVAA_LP_MAINNET = exports.TESTNET_VERSION = exports.EVAA_MASTER_TESTNET = exports.MAINNET_VERSION = exports.EVAA_MASTER_MAINNET = exports.NULL_ADDRESS = exports.MASTER_CONSTANTS = void 0;
|
|
3
|
+
exports.FEES = exports.OPCODES = exports.EVAA_REWARDS_USER_CODE_MAINNET = exports.EVAA_REWARDS_USER_CODE_TESTNET = exports.EVAA_REWARDS_MASTER_CODE_MAINNET = exports.EVAA_REWARDS_MASTER_CODE_TESTNET = exports.JETTON_WALLET_STANDART_CODE_TESTNET = exports.JETTON_WALLET_STANDART_CODE = exports.LENDING_CODE = exports.ORACLES_ALTS = exports.ORACLES_LP = exports.ORACLES_TESTNET = exports.ORACLES_MAINNET = exports.EVAA_TON_REWARDS_MASTER_MAINNET = exports.EVAA_USDT_REWARDS_MASTER_MAINNET = exports.EVAA_REWARDS_MASTER_TESTNET = exports.EVAA_ETHENA_VERSION = exports.EVAA_ETHENA_MAINNET = exports.EVAA_ALTS_MAINNET_VERSION = exports.EVAA_ALTS_MAINNET = exports.EVAA_LP_MAINNET_VERSION = exports.EVAA_LP_MAINNET = exports.TESTNET_VERSION = exports.EVAA_MASTER_TESTNET = exports.MAINNET_VERSION = exports.EVAA_MASTER_MAINNET = exports.NULL_ADDRESS = exports.MASTER_CONSTANTS = void 0;
|
|
4
4
|
const core_1 = require("@ton/core");
|
|
5
5
|
const ASSET_PRICE_SCALE = BigInt(1e9);
|
|
6
6
|
exports.MASTER_CONSTANTS = {
|
|
@@ -25,6 +25,8 @@ exports.EVAA_LP_MAINNET = core_1.Address.parse('EQBIlZX2URWkXCSg3QF2MJZU-wC5XkBo
|
|
|
25
25
|
exports.EVAA_LP_MAINNET_VERSION = 3;
|
|
26
26
|
exports.EVAA_ALTS_MAINNET = core_1.Address.parse('EQANURVS3fhBO9bivig34iyJQi97FhMbpivo1aUEAS2GYSu-');
|
|
27
27
|
exports.EVAA_ALTS_MAINNET_VERSION = 0;
|
|
28
|
+
exports.EVAA_ETHENA_MAINNET = core_1.Address.parse('EQCn95X_qLJa5VUXfyIQkWDH2iq3PTatsO4esunMaIsnyyeW');
|
|
29
|
+
exports.EVAA_ETHENA_VERSION = 0;
|
|
28
30
|
exports.EVAA_REWARDS_MASTER_TESTNET = core_1.Address.parse('EQCnp0iRGcfDJAvnKhAEN9sB-nPYSPuc83Ff4y75s8AtoSW1');
|
|
29
31
|
exports.EVAA_USDT_REWARDS_MASTER_MAINNET = core_1.Address.parse('EQD22Fhylp1tX-xoVX81aMTSJNPV8j9klwApTLgjGmofISVD');
|
|
30
32
|
exports.EVAA_TON_REWARDS_MASTER_MAINNET = core_1.Address.parse('EQDM_gdrntBg4fy5Rg9DgDF0AUu3FYoqxHEOsHNIC4_DTDuC');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PoolConfig } from '../types/Master';
|
|
2
2
|
import { EvaaRewardsConfig } from '../types/MasterRewards';
|
|
3
3
|
export declare const MAINNET_POOL_CONFIG: PoolConfig;
|
|
4
|
+
export declare const MAINNET_TEST_ETHENA_POOL_CONFIG: PoolConfig;
|
|
4
5
|
export declare const TESTNET_POOL_CONFIG: PoolConfig;
|
|
5
6
|
export declare const MAINNET_LP_POOL_CONFIG: PoolConfig;
|
|
6
7
|
export declare const MAINNET_ALTS_POOL_CONFIG: PoolConfig;
|
package/dist/constants/pools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAINNET_MASTER_USDT_REWARD_CONFIG = exports.MAINNET_MASTER_TON_REWARD_CONFIG = exports.TESTNET_MASTER_EUSDT_REWARD_CONFIG = exports.TESTNET_MASTER_REWARD_CONFIG = exports.MAINNET_ALTS_POOL_CONFIG = exports.MAINNET_LP_POOL_CONFIG = exports.TESTNET_POOL_CONFIG = exports.MAINNET_POOL_CONFIG = void 0;
|
|
3
|
+
exports.MAINNET_MASTER_USDT_REWARD_CONFIG = exports.MAINNET_MASTER_TON_REWARD_CONFIG = exports.TESTNET_MASTER_EUSDT_REWARD_CONFIG = exports.TESTNET_MASTER_REWARD_CONFIG = exports.MAINNET_ALTS_POOL_CONFIG = exports.MAINNET_LP_POOL_CONFIG = exports.TESTNET_POOL_CONFIG = exports.MAINNET_TEST_ETHENA_POOL_CONFIG = exports.MAINNET_POOL_CONFIG = void 0;
|
|
4
4
|
const core_1 = require("@ton/core");
|
|
5
5
|
const assets_1 = require("./assets");
|
|
6
6
|
const general_1 = require("./general");
|
|
@@ -17,7 +17,21 @@ exports.MAINNET_POOL_CONFIG = {
|
|
|
17
17
|
assets_1.STTON_MAINNET,
|
|
18
18
|
assets_1.TSTON_MAINNET,
|
|
19
19
|
assets_1.USDT_MAINNET,
|
|
20
|
-
|
|
20
|
+
assets_1.USDE_MAINNET,
|
|
21
|
+
assets_1.TSUSDE_MAINNET,
|
|
22
|
+
// UTON_MAINNET // announce xdddd fake announce
|
|
23
|
+
],
|
|
24
|
+
lendingCode: general_1.LENDING_CODE,
|
|
25
|
+
};
|
|
26
|
+
exports.MAINNET_TEST_ETHENA_POOL_CONFIG = {
|
|
27
|
+
masterAddress: general_1.EVAA_ETHENA_MAINNET,
|
|
28
|
+
masterVersion: general_1.EVAA_ETHENA_VERSION,
|
|
29
|
+
masterConstants: general_1.MASTER_CONSTANTS,
|
|
30
|
+
oracles: general_1.ORACLES_MAINNET,
|
|
31
|
+
minimalOracles: 3,
|
|
32
|
+
poolAssetsConfig: [
|
|
33
|
+
assets_1.TON_MAINNET,
|
|
34
|
+
assets_1.USDE_MAINNET,
|
|
21
35
|
],
|
|
22
36
|
lendingCode: general_1.LENDING_CODE,
|
|
23
37
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { EvaaUserRewards } from './rewards/EvaaRewards';
|
|
|
15
15
|
export { UpgradeConfig, AssetConfig, MasterConfig, AssetData, AssetInterest, AssetApy, ExtendedAssetData, MasterData, PoolConfig, ExtendedAssetsData, ExtendedAssetsConfig, PoolAssetConfig, PoolAssetsConfig, MasterConstants } from './types/Master';
|
|
16
16
|
export { BalanceType, UserBalance, UserLiqudationData, LiquidableData, NonLiquidableData, LiquidationData, UserDataInactive, UserDataActive, UserData, BalanceChangeType } from './types/User';
|
|
17
17
|
export { EVAA_MASTER_MAINNET, MAINNET_VERSION, EVAA_MASTER_TESTNET, TESTNET_VERSION, LENDING_CODE, OPCODES, FEES, MASTER_CONSTANTS, EVAA_REWARDS_MASTER_TESTNET, EVAA_REWARDS_MASTER_CODE_TESTNET, EVAA_REWARDS_USER_CODE_TESTNET, EVAA_REWARDS_MASTER_CODE_MAINNET, EVAA_REWARDS_USER_CODE_MAINNET, } from './constants/general';
|
|
18
|
-
export { MAINNET_POOL_CONFIG, TESTNET_POOL_CONFIG, MAINNET_LP_POOL_CONFIG, MAINNET_ALTS_POOL_CONFIG, TESTNET_MASTER_REWARD_CONFIG, MAINNET_MASTER_TON_REWARD_CONFIG, MAINNET_MASTER_USDT_REWARD_CONFIG, } from './constants/pools';
|
|
18
|
+
export { MAINNET_POOL_CONFIG, TESTNET_POOL_CONFIG, MAINNET_LP_POOL_CONFIG, MAINNET_ALTS_POOL_CONFIG, MAINNET_TEST_ETHENA_POOL_CONFIG, TESTNET_MASTER_REWARD_CONFIG, MAINNET_MASTER_TON_REWARD_CONFIG, MAINNET_MASTER_USDT_REWARD_CONFIG, } from './constants/pools';
|
|
19
19
|
export { ASSET_ID, UNDEFINED_ASSET, TON_MAINNET, USDT_MAINNET, TONUSDT_DEDUST_MAINNET, TON_STORM_MAINNET, USDT_STORM_MAINNET, DOGS_MAINNET, CATI_MAINNET, UTON_MAINNET, NOT_MAINNET, JUSDT_MAINNET, JUSDC_MAINNET, STTON_MAINNET, TSTON_MAINNET, JUSDT_TESTNET, JUSDC_TESTNET, STTON_TESTNET } from './constants/assets';
|
|
20
20
|
export * from './constants/assets';
|
|
21
21
|
export * from './utils/utils';
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.MAINNET_VERSION = exports.EVAA_MASTER_MAINNET = exports.BalanceChangeType = exports.BalanceType = exports.EvaaUserRewards = exports.RewardJettonWallet = exports.RewardJettonMinter = exports.RewardUser = exports.RewardMaster = exports.EvaaUser = exports.Evaa = exports.JettonWallet = exports.getPrices = exports.parseUserLiteData = exports.parseUserData = exports.parseMasterData = exports.createAssetConfig = exports.createAssetData = exports.calculateAssetsValues = exports.selectGreatestAssets = exports.findAssetById = exports.prepareAssetInfo = exports.toAssetWorth = exports.toAssetAmount = exports.deductLiquidationBonus = exports.addLiquidationBonus = exports.deductReserve = exports.addReserve = exports.isBadDebt = exports.isLiquidatable = exports.calculateMinCollateralByTransferredAmount = exports.calculateLiquidationAmounts = exports.getAssetLiquidityMinusReserves = exports.BigMath = exports.predictAPY = exports.calculateInterestWithSupplyBorrow = exports.calculateHealthParams = exports.predictHealthFactor = exports.calculateLiquidationData = exports.presentValue = exports.calculateMaximumWithdrawAmount = exports.getAvailableToBorrow = exports.calculateAssetInterest = exports.calculateAssetData = exports.calculateCurrentRates = exports.calculatePresentValue = exports.bigIntMax = exports.bigIntMin = exports.mulDiv = exports.mulFactor = void 0;
|
|
18
|
-
exports.getUserJettonWallet = exports.getTonConnectSender = exports.getLastSentBoc = exports.STTON_TESTNET = exports.JUSDC_TESTNET = exports.JUSDT_TESTNET = exports.TSTON_MAINNET = exports.STTON_MAINNET = exports.JUSDC_MAINNET = exports.JUSDT_MAINNET = exports.NOT_MAINNET = exports.UTON_MAINNET = exports.CATI_MAINNET = exports.DOGS_MAINNET = exports.USDT_STORM_MAINNET = exports.TON_STORM_MAINNET = exports.TONUSDT_DEDUST_MAINNET = exports.USDT_MAINNET = exports.TON_MAINNET = exports.UNDEFINED_ASSET = exports.ASSET_ID = exports.MAINNET_MASTER_USDT_REWARD_CONFIG = exports.MAINNET_MASTER_TON_REWARD_CONFIG = exports.TESTNET_MASTER_REWARD_CONFIG = exports.MAINNET_ALTS_POOL_CONFIG = exports.MAINNET_LP_POOL_CONFIG = exports.TESTNET_POOL_CONFIG = exports.MAINNET_POOL_CONFIG = exports.EVAA_REWARDS_USER_CODE_MAINNET = exports.EVAA_REWARDS_MASTER_CODE_MAINNET = exports.EVAA_REWARDS_USER_CODE_TESTNET = exports.EVAA_REWARDS_MASTER_CODE_TESTNET = exports.EVAA_REWARDS_MASTER_TESTNET = exports.MASTER_CONSTANTS = exports.FEES = exports.OPCODES = exports.LENDING_CODE = exports.TESTNET_VERSION = exports.EVAA_MASTER_TESTNET = void 0;
|
|
18
|
+
exports.getUserJettonWallet = exports.getTonConnectSender = exports.getLastSentBoc = exports.STTON_TESTNET = exports.JUSDC_TESTNET = exports.JUSDT_TESTNET = exports.TSTON_MAINNET = exports.STTON_MAINNET = exports.JUSDC_MAINNET = exports.JUSDT_MAINNET = exports.NOT_MAINNET = exports.UTON_MAINNET = exports.CATI_MAINNET = exports.DOGS_MAINNET = exports.USDT_STORM_MAINNET = exports.TON_STORM_MAINNET = exports.TONUSDT_DEDUST_MAINNET = exports.USDT_MAINNET = exports.TON_MAINNET = exports.UNDEFINED_ASSET = exports.ASSET_ID = exports.MAINNET_MASTER_USDT_REWARD_CONFIG = exports.MAINNET_MASTER_TON_REWARD_CONFIG = exports.TESTNET_MASTER_REWARD_CONFIG = exports.MAINNET_TEST_ETHENA_POOL_CONFIG = exports.MAINNET_ALTS_POOL_CONFIG = exports.MAINNET_LP_POOL_CONFIG = exports.TESTNET_POOL_CONFIG = exports.MAINNET_POOL_CONFIG = exports.EVAA_REWARDS_USER_CODE_MAINNET = exports.EVAA_REWARDS_MASTER_CODE_MAINNET = exports.EVAA_REWARDS_USER_CODE_TESTNET = exports.EVAA_REWARDS_MASTER_CODE_TESTNET = exports.EVAA_REWARDS_MASTER_TESTNET = exports.MASTER_CONSTANTS = exports.FEES = exports.OPCODES = exports.LENDING_CODE = exports.TESTNET_VERSION = exports.EVAA_MASTER_TESTNET = void 0;
|
|
19
19
|
// Math
|
|
20
20
|
var math_1 = require("./api/math");
|
|
21
21
|
Object.defineProperty(exports, "mulFactor", { enumerable: true, get: function () { return math_1.mulFactor; } });
|
|
@@ -102,6 +102,7 @@ Object.defineProperty(exports, "MAINNET_POOL_CONFIG", { enumerable: true, get: f
|
|
|
102
102
|
Object.defineProperty(exports, "TESTNET_POOL_CONFIG", { enumerable: true, get: function () { return pools_1.TESTNET_POOL_CONFIG; } });
|
|
103
103
|
Object.defineProperty(exports, "MAINNET_LP_POOL_CONFIG", { enumerable: true, get: function () { return pools_1.MAINNET_LP_POOL_CONFIG; } });
|
|
104
104
|
Object.defineProperty(exports, "MAINNET_ALTS_POOL_CONFIG", { enumerable: true, get: function () { return pools_1.MAINNET_ALTS_POOL_CONFIG; } });
|
|
105
|
+
Object.defineProperty(exports, "MAINNET_TEST_ETHENA_POOL_CONFIG", { enumerable: true, get: function () { return pools_1.MAINNET_TEST_ETHENA_POOL_CONFIG; } });
|
|
105
106
|
// Reward Pools
|
|
106
107
|
Object.defineProperty(exports, "TESTNET_MASTER_REWARD_CONFIG", { enumerable: true, get: function () { return pools_1.TESTNET_MASTER_REWARD_CONFIG; } });
|
|
107
108
|
Object.defineProperty(exports, "MAINNET_MASTER_TON_REWARD_CONFIG", { enumerable: true, get: function () { return pools_1.MAINNET_MASTER_TON_REWARD_CONFIG; } });
|
package/dist/prices/utils.js
CHANGED
|
@@ -111,7 +111,7 @@ exports.generatePriceSources = generatePriceSources;
|
|
|
111
111
|
async function collectAndFilterPrices(priceSource, poolConfig) {
|
|
112
112
|
const prices = await priceSource.getPrices();
|
|
113
113
|
//console.debug('[FILTERING] before filtering prices len ', priceSource.sourceName, prices.length);
|
|
114
|
-
return
|
|
114
|
+
return (async () => {
|
|
115
115
|
const acceptedPrices = prices.filter(price => verifyPricesTimestamp()(price) && verifyPricesSign(poolConfig.oracles)(price));
|
|
116
116
|
//console.debug('[FILTERING] after filtering prices len ', priceSource.sourceName, acceptedPrices.length);
|
|
117
117
|
if (acceptedPrices.length < poolConfig.minimalOracles) {
|
|
@@ -16,12 +16,22 @@ function getUserJettonData(ownerAddress, assetName, jettonWalletCode, jettonMast
|
|
|
16
16
|
case 'DOGS':
|
|
17
17
|
case 'NOT':
|
|
18
18
|
case 'USDT':
|
|
19
|
+
case 'USDe':
|
|
19
20
|
return (0, core_1.beginCell)()
|
|
20
21
|
.storeUint(0, 4)
|
|
21
22
|
.storeCoins(0)
|
|
22
23
|
.storeAddress(ownerAddress)
|
|
23
24
|
.storeAddress(jettonMasterAddress)
|
|
24
25
|
.endCell();
|
|
26
|
+
case 'tsUSDe':
|
|
27
|
+
return (0, core_1.beginCell)()
|
|
28
|
+
.storeUint(0, 4)
|
|
29
|
+
.storeCoins(0)
|
|
30
|
+
.storeAddress(ownerAddress)
|
|
31
|
+
.storeAddress(jettonMasterAddress)
|
|
32
|
+
.storeCoins(0)
|
|
33
|
+
.storeUint(0, 64)
|
|
34
|
+
.endCell();
|
|
25
35
|
case 'tsTON':
|
|
26
36
|
return (0, core_1.beginCell)()
|
|
27
37
|
.storeCoins(0)
|
package/package.json
CHANGED
package/src/constants/assets.ts
CHANGED
|
@@ -12,6 +12,8 @@ export const ASSET_ID = {
|
|
|
12
12
|
tsTON: sha256Hash('tsTON'),
|
|
13
13
|
uTON: sha256Hash('uTON'),
|
|
14
14
|
tgBTC: sha256Hash('tgBTC'),
|
|
15
|
+
USDe: sha256Hash('USDe'),
|
|
16
|
+
tsUSDe: sha256Hash('tsUSDe'),
|
|
15
17
|
|
|
16
18
|
// LP
|
|
17
19
|
TONUSDT_DEDUST: sha256Hash('TONUSDT_DEDUST'),
|
|
@@ -220,3 +222,27 @@ export const EUSDT_TESTNET: PoolAssetConfig = {
|
|
|
220
222
|
),
|
|
221
223
|
)[0],
|
|
222
224
|
};
|
|
225
|
+
|
|
226
|
+
export const USDE_MAINNET: PoolAssetConfig = {
|
|
227
|
+
name: 'USDe',
|
|
228
|
+
assetId: ASSET_ID.USDe,
|
|
229
|
+
jettonMasterAddress: Address.parse('EQAIb6KmdfdDR7CN1GBqVJuP25iCnLKCvBlJ07Evuu2dzP5f'),
|
|
230
|
+
jettonWalletCode: Cell.fromBoc(
|
|
231
|
+
Buffer.from(
|
|
232
|
+
'b5ee9c7201020f010003f0000114ff00f4a413f4bcf2c80b01020162020302f8d001d0d3030171b08e48135f038020d721ed44d0d303fa00fa40fa40d104d31f01840f218210178d4519ba0282107bdd97deba12b1f2f48040d721fa003012a0401303c8cb0358fa0201cf1601cf16c9ed54e0fa40fa4031fa0031f401fa0031fa00013170f83a02d31f012082100f8a7ea5ba8e85303459db3ce03304050201200d0e01f603d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40d15305c705531ac7052571b0c00021b1f2ad523cc705500bb1f2e0495126a120c2fff2af04fa40f401fa002020d70b009ad74bc00101c001b0f2b19130e2c88210178d451901cb1f500a01cb3f5008fa0222cf1601cf1626fa025007cf160602d0228210178d4519ba8e84325adb3ce034218210595f07bcba8e843101db3ce032208210eed236d3ba8e2f30018040d721d303d1ed44d0d303fa00fa40fa40d1335142c705f2e04a403303c8cb0358fa0201cf1601cf16c9ed54e06c218210d372158cbadc840ff2f0080901d0c9088e1533c8801801cb0523cf1670fa0250077158cb6accc98e4af82a54244070546004131503c8cb0358fa0201cf1601cf16c921c8cb0113f40012f400cb00c920f9007074c8cb02ca07cbffc9d0c8801801cb0501cf1670fa024018775003cb6bccccc9e245370700b62191729171e2f839206e938124b89120e2216e94318128739101e25023a813a0738103a370f83ca00270f83612a00170f836a07381040982100966018070f837a0bcf2b0048050fb00430003c8cb0358fa0201cf1601cf16c9ed5403f4ed44d0d303fa00fa40fa40d12372b0c002f26d07d33f0101fa005141a004fa40fa4053bac705f82a5464e070546004131503c8cb0358fa0201cf1601cf16c921c8cb0113f40012f400cb00c9f9007074c8cb02ca07cbffc9d0500cc7051bb1f2e04a09fa0021925f04e30d26d70b01c000b393306c33e30d55020a0b0c01f2ed44d0d303fa00fa40fa40d106d33f0101fa00fa40f401d15141a15288c705f2e04926c2fff2afc882107bdd97de01cb1f5801cb3f01fa0221cf1658cf16c9c8801801cb0526cf1670fa02017158cb6accc903f839206e943081180fde718102f270f8380170f836a0811ba470f836a0bcf2b0028050fb00030c0060c882107362d09c01cb1f2501cb3f5004fa0258cf1658cf16c9c8801001cb0524cf1658fa02017158cb6accc98011fb00007a5054a1f82fa07381040982100966018070f837b60972fb02c8801001cb055005cf1670fa027001cb6a8210d53276db01cb1f5801cb3fc9810082fb0059002003c8cb0358fa0201cf1601cf16c9ed540027bfd8176a2686981fd007d207d206899fc15209840021bc508f6a2686981fd007d207d2068af81c',
|
|
233
|
+
'hex',
|
|
234
|
+
),
|
|
235
|
+
)[0],
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export const TSUSDE_MAINNET: PoolAssetConfig = {
|
|
239
|
+
name: 'tsUSDe',
|
|
240
|
+
assetId: ASSET_ID.tsUSDe,
|
|
241
|
+
jettonMasterAddress: Address.parse('EQDQ5UUyPHrLcQJlPAczd_fjxn8SLrlNQwolBznxCdSlfQwr'),
|
|
242
|
+
jettonWalletCode: Cell.fromBoc(
|
|
243
|
+
Buffer.from(
|
|
244
|
+
'b5ee9c72010219010006bf000114ff00f4a413f4bcf2c80b01020162020302f6d001d0d3030171b08ef0135f038020d721ed44d0d303fa00fa40fa40fa00d33fd106d31f01840f218210178d4519ba228210b2583ed5bab12282107bdd97debab1f2f4018040d721fa0030218210178d4519ba0282107bdd97deba12b18e19a0550405c8cb035004fa0258cf1601cf1601fa02cb3fc9ed54e30de004050201201516003614a004413505c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5404a0fa40fa4031fa0031f401fa0031fa00013170f83a02d31f012082100f8a7ea5ba8e85303459db3ce0208210d750cec9ba8e85303459db3ce033228210178d4519ba8e84325adb3ce0228210b2583ed5ba0607080901ec03d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40fa00d33fd15327c705533cc7052771b0c00021b1f2ad525ec705500db1f2e0495148a120c2fff2af06fa40f401fa002020d70b009ad74bc00101c001b0f2b19130e22d8e1170c80101ca0001cf16c971c8cb00ccc9d0de70c80a01f603d33f0101fa00fa4021fa4430c000f2e14ded44d0d303fa00fa40fa40fa00d33fd15228c705532bc7052671b0c00021b1f2ad524dc705500cb1f2e049f82327bcf2e14e0af2e04b5196a120c2fff2af04fa40f401fa002020d70b009ad74bc00101c001b0f2b19130e27fc80101ca0001cf16c971c8cb00ccc9d00d01f4ed44d0d303fa00fa40fa40fa00d33fd12572b0c002f26d09d33f0101fa005161a006d33f31fa40fa40536cc705f82a5464907054700020103510241037102605c8cb035004fa0258cf1601cf1601fa02cb3fc921c8cb0113f40012f400cb00c9f9007074c8cb02ca07cbffc9d0500ec7051db1f2e04a0bfa00210f02d88e84325adb3ce034218210595f07bcba8e843101db3ce032208210eed236d3ba8e3b30018040d721d303d1ed44d0d303fa00fa40fa40fa00d33fd1355161c705f2e04a1045551205c8cb035004fa0258cf1601cf1601fa02cb3fc9ed54e06c218210d372158cbadc840ff2f0111202fe8210178d451901cb1f500d01cb3f500bfa021bcb3f24cf1601cf1629fa025008cf16c90a8e57f82a5426607054700020103510241037102605c8cb035004fa0258cf1601cf1601fa02cb3fc921c8cb0113f40012f400cb00c920f9007074c8cb02ca07cbffc9d0c8801801cb0501cf1670fa02401a775003cb6bccccc9e30d0b0c002a35c8801801cb0525cf1670fa0250097158cb6accc900cc47692191729171e2f839206e938126e29120e2216e9431812a169101e25023a813a0738103e770f83ca00270f83612a00170f836a07381044d82100966018070f837a0bcf2b0068050fb00103510340205c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5401fe70c88210b2583ed501cb1f500b01cb3f5009fa0219cb3f22cf1601cf1627fa025006cf16c9c8801801cb0529cf1670fa02017158cb6accc947692191729171e2f839206e938126e29120e2216e9431812a169101e25023a813a0738103e770f83ca00270f83612a00170f836a07381044d82100966018070f837a0bcf2b0060e003c8050fb001035443005c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5401be8e30c882107362d09c01cb1f2501cb3f5004fa0258cf1658cf16c9c8801001cb0526cf1658fa02017158cb6accc98011fb00925f04e228d70b01c000b396301027353530e30d55300505c8cb035004fa0258cf1601cf1601fa02cb3fc9ed541000825076a1f82fa07381044d82100966018070f837b60972fb02c8801001cb055007cf1670fa027001cb6a8210d53276db01cb1f500401cb3fc9810082fb001024102301b8ed44d0d303fa00fa40fa40fa00d33fd1302472b0c002f26d08d33f0101fa00d33f50b2a001fa4031fa4030523ac705f2e04a28d70b01c000b39710381027365f03e30d55300505c8cb035004fa0258cf1601cf1601fa02cb3fc9ed541301f6ed44d0d303fa00fa40fa40fa00d33fd108d33f0101fa00fa40f401d15161a1524ac705f2e04928c2fff2afc882107bdd97de01cb1f5801cb3f01fa0223cf165004cf16c9c8801801cb0522cf1670fa02017158cb6accc905f839206e943081187fde718102f270f8380170f836a081203770f836a0bcf2b004805014007e5076a1f82fa07381044d82100966018070f837b60972fb02c8801001cb055007cf1670fa027001cb6a8210d53276db01cb1f500501cb3fc9810082fb0010340036fb0045130205c8cb035004fa0258cf1601cf1601fa02cb3fc9ed5402015817180029bc508f6a2686981fd007d207d207d00699fe8af82c0029b74e5da89a1a607f401f481f481f401a67fa2d88500031b7605da89a1a607f401f481f481f401a67fa2b667f05482610',
|
|
245
|
+
'hex',
|
|
246
|
+
),
|
|
247
|
+
)[0],
|
|
248
|
+
};
|
package/src/constants/general.ts
CHANGED
|
@@ -28,6 +28,9 @@ export const EVAA_LP_MAINNET_VERSION = 3;
|
|
|
28
28
|
export const EVAA_ALTS_MAINNET = Address.parse('EQANURVS3fhBO9bivig34iyJQi97FhMbpivo1aUEAS2GYSu-');
|
|
29
29
|
export const EVAA_ALTS_MAINNET_VERSION = 0;
|
|
30
30
|
|
|
31
|
+
export const EVAA_ETHENA_MAINNET = Address.parse('EQCn95X_qLJa5VUXfyIQkWDH2iq3PTatsO4esunMaIsnyyeW');
|
|
32
|
+
export const EVAA_ETHENA_VERSION = 0;
|
|
33
|
+
|
|
31
34
|
export const EVAA_REWARDS_MASTER_TESTNET = Address.parse('EQCnp0iRGcfDJAvnKhAEN9sB-nPYSPuc83Ff4y75s8AtoSW1');
|
|
32
35
|
export const EVAA_USDT_REWARDS_MASTER_MAINNET = Address.parse('EQD22Fhylp1tX-xoVX81aMTSJNPV8j9klwApTLgjGmofISVD');
|
|
33
36
|
export const EVAA_TON_REWARDS_MASTER_MAINNET = Address.parse('EQDM_gdrntBg4fy5Rg9DgDF0AUu3FYoqxHEOsHNIC4_DTDuC');
|
package/src/constants/pools.ts
CHANGED
|
@@ -15,12 +15,16 @@ import {
|
|
|
15
15
|
TON_TESTNET,
|
|
16
16
|
TONUSDT_DEDUST_MAINNET,
|
|
17
17
|
TSTON_MAINNET,
|
|
18
|
+
TSUSDE_MAINNET,
|
|
19
|
+
USDE_MAINNET,
|
|
18
20
|
USDT_MAINNET,
|
|
19
21
|
USDT_STORM_MAINNET,
|
|
20
22
|
} from './assets';
|
|
21
23
|
import {
|
|
22
24
|
EVAA_ALTS_MAINNET,
|
|
23
25
|
EVAA_ALTS_MAINNET_VERSION,
|
|
26
|
+
EVAA_ETHENA_MAINNET,
|
|
27
|
+
EVAA_ETHENA_VERSION,
|
|
24
28
|
EVAA_LP_MAINNET,
|
|
25
29
|
EVAA_LP_MAINNET_VERSION,
|
|
26
30
|
EVAA_MASTER_MAINNET,
|
|
@@ -55,7 +59,22 @@ export const MAINNET_POOL_CONFIG: PoolConfig = {
|
|
|
55
59
|
STTON_MAINNET,
|
|
56
60
|
TSTON_MAINNET,
|
|
57
61
|
USDT_MAINNET,
|
|
58
|
-
|
|
62
|
+
USDE_MAINNET,
|
|
63
|
+
TSUSDE_MAINNET,
|
|
64
|
+
// UTON_MAINNET // announce xdddd fake announce
|
|
65
|
+
],
|
|
66
|
+
lendingCode: LENDING_CODE,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const MAINNET_TEST_ETHENA_POOL_CONFIG: PoolConfig = {
|
|
70
|
+
masterAddress: EVAA_ETHENA_MAINNET,
|
|
71
|
+
masterVersion: EVAA_ETHENA_VERSION,
|
|
72
|
+
masterConstants: MASTER_CONSTANTS,
|
|
73
|
+
oracles: ORACLES_MAINNET,
|
|
74
|
+
minimalOracles: 3,
|
|
75
|
+
poolAssetsConfig: [
|
|
76
|
+
TON_MAINNET,
|
|
77
|
+
USDE_MAINNET,
|
|
59
78
|
],
|
|
60
79
|
lendingCode: LENDING_CODE,
|
|
61
80
|
};
|
package/src/index.ts
CHANGED
|
@@ -100,7 +100,7 @@ export class PricesCollector {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
const medianData = assets.map(asset => ({ assetId: asset.assetId, medianPrice: getMedianPrice(this.#prices, asset.assetId)}));
|
|
103
|
-
|
|
103
|
+
|
|
104
104
|
const nonEmptymedianData = medianData.filter(x => x.medianPrice != null) as { assetId: bigint, medianPrice: bigint }[];
|
|
105
105
|
|
|
106
106
|
const packedMedianData = packAssetsData(nonEmptymedianData);
|
package/src/prices/utils.ts
CHANGED
|
@@ -128,7 +128,7 @@ export async function collectAndFilterPrices(priceSource: PriceSource, poolConfi
|
|
|
128
128
|
const prices = await priceSource.getPrices();
|
|
129
129
|
|
|
130
130
|
//console.debug('[FILTERING] before filtering prices len ', priceSource.sourceName, prices.length);
|
|
131
|
-
return
|
|
131
|
+
return (async () => {
|
|
132
132
|
const acceptedPrices: RawPriceData[] = prices.filter(
|
|
133
133
|
price => verifyPricesTimestamp()(price) && verifyPricesSign(poolConfig.oracles)(price)
|
|
134
134
|
);
|
|
@@ -15,12 +15,22 @@ function getUserJettonData(ownerAddress: Address, assetName: string, jettonWalle
|
|
|
15
15
|
case 'DOGS':
|
|
16
16
|
case 'NOT':
|
|
17
17
|
case 'USDT':
|
|
18
|
+
case 'USDe':
|
|
18
19
|
return beginCell()
|
|
19
20
|
.storeUint(0, 4)
|
|
20
21
|
.storeCoins(0)
|
|
21
22
|
.storeAddress(ownerAddress)
|
|
22
23
|
.storeAddress(jettonMasterAddress)
|
|
23
24
|
.endCell();
|
|
25
|
+
case 'tsUSDe':
|
|
26
|
+
return beginCell()
|
|
27
|
+
.storeUint(0, 4)
|
|
28
|
+
.storeCoins(0)
|
|
29
|
+
.storeAddress(ownerAddress)
|
|
30
|
+
.storeAddress(jettonMasterAddress)
|
|
31
|
+
.storeCoins(0)
|
|
32
|
+
.storeUint(0, 64)
|
|
33
|
+
.endCell();
|
|
24
34
|
case 'tsTON':
|
|
25
35
|
return beginCell()
|
|
26
36
|
.storeCoins(0)
|