LiquidationRewardsManagerWstEth

Git Source

Inherits: LiquidationRewardsManager

This contract calculates rewards for liquidators within the USDN protocol, using wstETH as the underlying asset. Rewards are computed based on gas costs, which are converted to wstETH using the current conversion rate between wstETH and stETH, assuming a one-to-one rate between stETH and ETH. Additionally a fixed reward is added along with a bonus based on the size of the liquidated ticks.

Functions

constructor

constructor(IWstETH wstETH) Ownable(msg.sender);

Parameters

NameTypeDescription
wstETHIWstETHThe address of the wstETH token.

getLiquidationRewards

Computes the amount of assets to reward a liquidator.

function getLiquidationRewards(
    Types.LiqTickInfo[] calldata liquidatedTicks,
    uint256 currentPrice,
    bool rebased,
    Types.RebalancerAction rebalancerAction,
    Types.ProtocolAction,
    bytes calldata,
    bytes calldata
) external view override returns (uint256 wstETHRewards_);

Parameters

NameTypeDescription
liquidatedTicksTypes.LiqTickInfo[]Information about the liquidated ticks.
currentPriceuint256The current price of the asset.
rebasedboolIndicates whether a USDN rebase was performed.
rebalancerActionTypes.RebalancerActionThe action performed by the _triggerRebalancer function.
<none>Types.ProtocolAction
<none>bytes
<none>bytes

Returns

NameTypeDescription
wstETHRewards_uint256assetRewards_ The amount of asset tokens to reward the liquidator.