All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
getAssetLiquidityMinusReserves
function needed to count the amount of free amount for withdrawal
borrowLimits
function now take into account the amount available for withdrawal
- new field in
UserLiteData
.fullyParsed
andhavePrincipalWithoutPrice
true if all prices for user parsing were provided or true if have a principal without price now user.getSync and parseUserData can work without some prices predictAPY
- function that predicts a change in apy after supply or withdraw
- new field in UserLiteData
user.data.realPrincipals
- principals before applying dusts
- getPricesForWithdraw/getPricesForLiquidate they should now be called with a different argument
- ALTS Pool
- PricesCollector class
- Supports multiple prices sources [iota nft, evaa backend, internetcomputer (icp) http backend] (sources can be configured)
- Updates prices only when needed, prices may expire no earlier than a minute later
- Ability to cut prices and resign it and send only the necessary ones in order to reduce fee
-
collateralToDebt param responsible for the fact that supply can go to borrow (there is no such case at the front end)
async getPricesForWithdraw(userPrincipals: Dictionary<bigint, bigint>, withdrawAsset: PoolAssetConfig, collateralToDebt = false, ....)
-
async getPricesForLiquidate(userPrincipals: Dictionary<bigint, bigint> ...)
-
- Price Signature Vrification
- Minimal Oracles Number Verification
- Independent and parallel loading of prices (now the fastest but invalid response won't break anything)
- Support for partial number of assets from price sources
- Updated examples in docs/examples
- PricesCollector test coverage
- 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
- getPrices is deprecated use PricesCollector instead
- updated
EVAA_LP_MAINNET_VERSION
to3
awaitedSupply
is always defined
applyDust
isfalse
by default inparseUserLiteData
andparseUserData
minimalOracles
is3
in all pools
- 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. - user.
getSync
andgetSyncLite
new argumentapplyDust
by default isfalse
; - updated sdk usage example
- user.
getSync
andgetSyncLite
new argumentapplyDust
by default isfalse
- Healthfactor calculation minor bug
- createLiquidationMessage fix new field payloadForwardAmount
- SDK Supports Evaa v6 smart contracts
- Updated documentation and examples for v6 interactions
- User Withdrawal and Borrow limits
- Fix typo in
calculateMaximumWithdrawAmount
isTonAsset(PoolAssetConfig)
function
Dust is a small amount of principal that is ignored
parseUserLiteData
(dust) &parseUserData
(dust and withdrawLimits) calculations problemuser.data.withdrawalLimits
,user.data.balance
,user.data.principals
calculation for LP pool contract and main pool contract
parseUserLiteData
(without prices),parseUserData
applyDust argument default value changed toTrue
- Many composite types were removed from sdk
PoolTonAssetConfig, PoolJettonAssetConfig
->PoolAssetConfig
,JettonMessageParameters, SupplyBaseParameters, TonSupplyParameters, JettonSupplyParameters
->SupplyParameters
,LiquidationBasePrameters, TonLiquidationParameters, JettonLiquidationParameters
->LiquidationParameters
- calculateMaximumWithdrawAmount function
- parseUserLiteData (dust) & parseUserData (dust and withdrawLimits) calculations problem
check tests\supply_withdraw_test.ts
for new examples
- Pools supports (new argument for Evaa master contract) + LP_POOL constants, default is MAINNET_POOL_CONFIG, default pool is MAINNET_POOL_CONFIG
const evaa = client.open(new Evaa({poolConfig: TESTNET_LP_POOL_CONFIG}));
const evaaMainNet = clientMainNet.open(new Evaa({poolConfig: MAINNET_LP_POOL_CONFIG}));
-
New types for pools initializtion, for assets check
constants\assets.ts
for new examples -
getPrices - a new function inside Evaa, returns prices of current pool
await evaaMainNet.getPrices()
- New argument nftId (depends on pool) for getPrices
export async function getPrices(endpoints: string[] = ["api.stardust-mainnet.iotaledger.net"], nftId: string = MAIN_POOL_NFT_ID) {
- Everything about working with assets, new assets list
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";
await evaaMainNet.sendSupply(sender_mainnet, toNano(1), {
queryID: 0n,
includeUserCode: true,
amount: 500_000_000n,
userAddress: address_mainnet,
asset: TON_MAINNET
});
- predictHealthFactor minor fixes
- getUserJettonWallet all currencies support
- 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
- predictHealthFactor argument processing improving
- getSync fixed parsing contract state, base64url was replaced to base64 encoding which has much higher support
- predictHealthFactor function to predict a change in a health factor after repay, borrow, supply, withdraw
This release contains breaking changes.
- Reserve variables parsing on user & master sc
- Added endpoint argument for getPrices, default api.stardust-mainnet.iotaledger.net
- Added applyDust (default false) option in parseUserLiteData and parseUserData
- Master contracts' version
- Testnet master contract address
- Parsers on master sc
- Parsers on user sc
- Liquidation calculations now counts with reserve factor from master config
- UserBalance calculation was fixed
This release contains breaking changes.
- Master storage onchain getter
- User storage onchain getter
- Testnet flag for
parseMasterData
,parseUserData
andparseUserLiteData
functions maxTotalSupply
field to Assets Config- Seperate Assets ID for Mainnet and Testnet
- Master contracts' version
- Testnet master contract address
ASSET_ID
constant
- Jetton wallets address calculation
- Field names in Assets Config and Assets Data serialization functions
- New asset - Tether USD
- New asset - tsTON
- New asset - stTON
- Price fetching from another source
- Testnet master contract address
- Master contracts' version
- Ethereum dependencies
This release contains breaking changes.
- BOC of last sent message via TonConnect. Can be obtained by
getLastSentBoc
function - Calculation of user's health factor
- Testnet master contract address and version
- Supply fee from 0.5 TON to 0.3 TON
- APY moved from user data to master data
- Description of some methods in
UserContract
andMasterContract
- Calculation of borrow limits
- Parsing user lite data, which does not require prices
- Assets reserves to
MasterData
- Types and methods descriptions in
MasterContract
andUserContract
- Added parallel price fetching
- Crypto library to 'crypto-js' for compatibility with browser
- Testnet Master version to 2
sort-deep-object-arrays
dependency
- Getting user's jetton wallet