Releases: SmarDex-Ecosystem/usdn-contracts
Releases · SmarDex-Ecosystem/usdn-contracts
v1.0.0
v0.24.2
0.24.2 (2025-01-15)
Features
- _triggerRebalancer: add a minimum acceptable value for the accMultiplier (#828) (12d21a4)
- add initial wsteth price on mock middleware (#822) (a8edb49)
- add verification in setLowLatencyDelay (#827) (d158b45)
- deployment: update script to handle early wUSDN deployment (#818) (d5f2663)
- doc: add a script to fix the generated doc (#816) (bd06319)
- protocol: add rewards for the burnSdex() caller (#794) (68a188d)
- protocol: change default SDEX burn ratio to 5% (#782) (6fb341d)
- reduce library sizes (#840) (d88ecb1)
- script: update deployment script to handle safe ownership (#803) (cd865c2)
- script: upgrade script for tenderly v0.24.0 deployment (#776) (30413c5)
- sdex-fees: SDEX fees are now held by the protocol (#790) (95abb9f)
- small fixes (#812) (382a15b)
- wusdn: add redemption rate function (#821) (7e21277)
Bug Fixes
- callback argument (#789) (6c4a956)
- handleNegativeBalances: add check if balances are still negative (#823) (02d59df)
- long: avoid edge case underflow in validateOpenPosition above max leverage (#832) (ebf0e67)
- middleware: relax round ID check (#825) (e270e09)
- open-max-leverage: fix wrong values being used for calculating the new pos value and total expo (#810) (e50a324)
- pause: apply the funding for the period between the last update timestamp and the pause (#811) (2856203)
- rebalancer: add amounts when position is pending and rebalancer liquidated (#809) (378c425)
- rebalancer: set the long balance to 0 if subtracting the pos value would underflow (#784) (9f24ad2)
- remove unused imports throughout the codebase (#813) (9898a54)
- triggerRebalancer: add the bonus when calculating the minimum position amount (#829) (d12cf1e)
- vault asset available with funding, deposit, withdrawal (#826) (dd4308b)
Miscellaneous Chores
- deploy: usdn token mainnet (#798) (15c2e3e)
- remove unused files and fix natspec in utils (#838) (b9a0228)
- update flake and trufflehog commands (#815) (7709b36)
- update licence year (#814) (622b7c5)
- upgrade: upgrade on tenderly from v0.24.0 to v0.24.1 (#788) (d79e83b)
- v2 add version and date on first page only (#808) (a10ad74)
- verify script (#662) (7340e1a)
- verify script handle tuple parameter (#795) (45a3374)
Code Refactoring
v0.24.1
0.24.1 (2024-12-11)
Features
- deployment: v0.24.0 on tenderly (#733) (639b268)
- script: new script to deploy the USDN token (#759) (b665277)
- whitepaper headlines (#745) (7466778)
Bug Fixes
- rebalancer: change condition on block.timestamp when initializing a close position (#764) (bfb991b)
- script: function clashes are now compared to common inheritance (#730) (5491102)
- test: wrong import path (#754) (144a83e)
- validate-open: liquidate the position if start price is below liqPriceWithoutPenaltyNorFunding (#766) (efd3fba)
Performance Improvements
Code Refactoring
- move logic and achieve full coverage for UsdnProtocolLongLibrary (#736) (b6504c9)
- rebalancer: remove unused attribute in the
InitiateCloseData
struct (#763) (a5f4871) - setters: update max limit for SDEX burn ratio (#771) (cc82961)
Build System
v0.24.0
0.24.0 (2024-11-26)
⚠ BREAKING CHANGES
- protocol: No constant is now exposed, but they all are in the constants library
Features
- add more validation on admin functions (#716) (79debf7)
- adding mapping to store an history of Rebalancer (#717) (d8e3725)
- deployement: deploy v0.23.0 (#720) (3b6a201)
- protocol: remove all constants getters (#724) (3dddf21)
- rebalancer: add reentrancy guards to all user functions (#725) (ee3021f)
- remove-blocked-pending-action: add
_onChainValidatorDeadline
to the delay (#719) (d0e3900)
Bug Fixes
- honor CEI pattern in
initiateDeposit
wrttransferCallback
(#702) (7116457) - limit condition when checking imbalance during withdrawal (#709) (880f7da)
- make docker-release compatible with router (#699) (62c23cc)
- oracle middleware interface (#731) (d94433a)
- perform liquidations with
lastPrice
in all cases (#722) (85618b2)
Performance Improvements
v0.23.0
0.23.0 (2024-11-21)
⚠ BREAKING CHANGES
- the
IUsdnProtocol.getActionablePendingActions
function takes two additional parameterslookAhead
andmaxIter
, theMAX_ACTIONABLE_PENDING_ACTIONS
constant has been replaced withMIN_ACTIONABLE_PENDING_ACTIONS_ITER
. IUsdnProtocol.validateOpenPosition
has a new return valueposId_
with the position ID which could have changed during execution.- initiateClose/validateClose/validateOpen now outputs an enum with 3 different values
- the
TimeLimitsUpdated
event now have a newcloseDelay
parameter, theTimeLimits
struct now have a newcloseDelay
parameter, allTimeLimits
struct parameters are now of typeuint64
- the order of arguments for
IUsdnProtocol.transferPositionOwnership
was changed
Features
- add
lookAhead
andmaxIter
parameters togetActionablePendingActions
(#701) (179f31e) - add reentrancy guard on
removeBlockedPendingAction
(#694) (e00de48) - change the return value of the initiateClose/validateClose/validateOpen functions (#692) (3689a02)
- delete pUSDN (#697) (81e23fa)
- protcol: stop fundings during pause period (#678) (dd6fbd7)
- protocol: add a condition on limits setter (#703) (386e67f)
- rebalancer close delay (#677) (b8685f2)
- remove the callbacks in the initialize function (#669) (dee780a)
- return potentially updated posId in
validateOpenPosition
(#706) (cd3a0e1) - validate-close: add remaining collateral to the vault when data.positionValue < 0 (#679) (b70c6ce)
Bug Fixes
- bad debt handling in open (#708) (972a700)
- change typo (#707) (a2691aa)
- getHighestPopulatedTick now always return the highest populated tick (#705) (ceba279)
- refund-security-deposit: add reentrency guard (#689) (a0cea30)
- trigger-rebalancer: clamp the vault balance to 0 when it's added to the pending balance vault (#711) (c4a4635)
Performance Improvements
Code Refactoring
v0.22.0
0.22.0 (2024-11-11)
⚠ BREAKING CHANGES
- delegated transfer position ownership (#661)
- rebalancer delegated initiate close (#640)
- change roles and add script to transfer ownership of the protocol (#650)
- remove the rebase interval (#653)
Features
- add pUSDN token (#668) (bce850b)
- assert limits on setters (#658) (f7c72d6)
- change roles and add script to transfer ownership of the protocol (#650) (b65c6b2)
- delegated transfer position ownership (#661) (7dae4f3)
- protocol: eip7201: Namespaced Storage Layout implementation (#666) (0373c02)
- rebalancer delegated initiate close (#640) (79c93da)
- script: calculate the deposit amount from the long one in the deployment script (#671) (b2e5815)
- script: refactor the protocol's deployment (#673) (8e9125e)
- tenderly deploy (#659) (ecb8bbd)
- version EIP712 doc (#649) (d8180e0)
- wusdn: revert when trying to wrap zero token (#660) (f8cfbb6)
Bug Fixes
- blocked-action: send the value of the blocked action to the to address rather than the vault (#672) (8a7b98c)
- deposit: add the vault fee to the vault balance to calculate the amount of shares to mint (#635) (8db4b48)
- long: calculate leverage using the liquidation price, excluding penalty and funding in validate open position (#665) (aaea6d6)
- pyth-oracle: add a check to revert if the expo of the unsafe price is positive (#652) (a10bdb7)
- rebalancer: notify the rebalancer when its tick has been liquidated (#642) (6d96c8e)
- remove the rebase interval (#653) (e5f0bce)
- remove-blocked-action: reset the tick penalty if the postiion was the last one in the tick (#655) (7212efd)
- remove-blocked-pending-action: account for the vault fees in the pending vault balance (#657) (47d5709)
- validate-open: liquidate the position if the price at T+24 is below the liquidation price (#639) (bb8825b)
- validate-withdrawal: avoid an underflow by sending what remains in the vault (#674) (afc3c2e)
- vault: use current totalShares in validate withdrawal (#638) (776c366)
v0.21.0
0.21.0 (2024-10-22)
⚠ BREAKING CHANGES
Features
- delegated initiate close (#629) (096404c)
- docker build (#614) (59622c1)
- eip712 integration (#624) (33a1e41)
- update build dependencies (#623) (4e2bfcc)
Bug Fixes
- calculate the original liquidation price without penalty and funding from the initiate in validate open position (#628) (7835be6)
- close: extrapolate trading expo to block timestamp (#608) (9a472ba)
- compare slippage against the adjusted price (#613) (b7789f0)
- fee open imbalance check (#616) (1ebcb5a)
- initiate-close: apply the position fee to the price before checking it against the min price (#630) (430a7a6)
- liquidation-rewards: convert the bonus in stEth (#632) (91fdb61)
- long: reset liquidation penalty in tick data on close (#615) (079a405)
- rebalancer: forward liquidator rewards to the msg.sender (#633) (7e28eeb)
- rebalancer: prevent a rebalancer trigger during a rebalancer initiateClosePosition call (#627) (4e541ff)
- runSlither in CI (#626) (aba54db)
- slither error on MockWstETH receive function (#620) (ffb8d5a)
- validate-open: fix the liquidation price check to include the penalty (#631) (4d6d383)
v0.20.0
v0.19.1
v0.19.0
0.19.0 (2024-09-24)
⚠ BREAKING CHANGES
- liquidate: the iterations parameter of the liquidate function has been removed
- add
deadline
variable ininitiateOpenPosition
,initiateClosePosition
,initiateDeposit
, andinitiateWithdrawal
functions. Also, I have added It inside the Rebalancer oninitiateClosePosition
function IBaseLiquidationRewardsManager.getLiquidationRewards
now expects an array of liquidated ticks info and the current asset price for the first two parameters.ILiquidationRewardsManager
has more parameters insetRewardsParameters
and the associatedRewardsParametersUpdated
event.IUsdnProtocolActions.liquidate
now returns an array ofLiqTickInfo
. TheLiquidationsEffects
struct has a new typeLiqTickInfo[]
for theliquidatedTicks
member.- initialize: MIN_INIT_DEPOSIT() is not available anymore
- The external function vaultTradingExpoWithFunding has been removed
- remove
permit2TokenBitfield
variable ininitiateOpenPosition
andinitiateDeposit
functions. initiateDeposit
has a new argument namedamountMinOut
andinitiateWithdrawal
has a new argument namedamountMinOut
. The user can set the minimum accepted stETh or USDN wants to be received- add min price on initiate close (#569)
Features
- add deadline on each initiate actions (#588) (97f4d4b)
- add max price on initiate open (#562) (2a8adb1)
- add min max leverage on initialize position (#579) (853ef63)
- add min price on initiate close (#569) (c977bae)
- add slippage vault side (#581) (4da907d)
- add stETH and wstETH mock contracts (#570) (71e21f5)
- callback on initiates and remove permit2 (#582) (47e5701)
- fix struct (#589) (0461194)
- implementation initialization (#593) (433f1f1)
- initialize: add checks on amounts to make sure positions can be opened (#584) (f8469a6)
- liquidate: removes the iterations parameter for the external function (#586) (51d1a5b)
- withdraw: add callback for router to transfer shares (#592) (03ec9f9)
Bug Fixes
- enforce CEI pattern in validate actions (#598) (41ed217)
- middleware: fix flaky tests (#591) (68ff15e)
- slither: ignore slither arbitrary-send-eth error in permissioned function (#590) (46ce477)
- the trading expo cannot become negative anymore (#573) (a0e9cbc)
- usdn: rounding edge case (#597) (ef17cb8)
Performance Improvements
- delete ActionsVault lib and change functions visibility (#577) (611d162)
- reduce
validateActionablePendingActions
gas usage (#574) (12baa7a) - reduce protocol size (#600) (83515b5)