LiquidationRewardsManagerWusdn

Git Source

Inherits: LiquidationRewardsManager

This contract calculates rewards for liquidators within the USDN protocol, using wUSDN as the underlying asset. Rewards are computed based on gas costs which are converted to wUSDN using the current price. Additionally a fixed reward is added along with a bonus based on the size of the liquidated ticks.

State Variables

PRICE_PRECISION

The precision used for the price.

uint256 internal constant PRICE_PRECISION = 1e18;

Functions

constructor

constructor(IWusdn wusdn) Ownable(msg.sender);

Parameters

NameTypeDescription
wusdnIWusdnThe address of the wUSDN token.

getLiquidationRewards

Computes the amount of assets to reward a liquidator.

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

Parameters

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

Returns

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