IRebalancerEvents

Git Source

Defines all custom events emitted by the Rebalancer contract.

Events

InitiatedAssetsDeposit

A user initiates a deposit into the Rebalancer.

event InitiatedAssetsDeposit(address indexed payer, address indexed to, uint256 amount, uint256 timestamp);

Parameters

NameTypeDescription
payeraddressThe address of the user initiating the deposit.
toaddressThe address the assets will be assigned to.
amountuint256The amount of assets deposited.
timestampuint256The timestamp of the action.

AssetsDeposited

Assets are successfully deposited into the contract.

event AssetsDeposited(address indexed user, uint256 amount, uint256 positionVersion);

Parameters

NameTypeDescription
useraddressThe address of the user.
amountuint256The amount of assets deposited.
positionVersionuint256The version of the position in which the assets will be used.

DepositRefunded

A deposit is refunded after failing to meet the validation deadline.

event DepositRefunded(address indexed user, uint256 amount);

Parameters

NameTypeDescription
useraddressThe address of the user.
amountuint256The amount of assets refunded.

InitiatedAssetsWithdrawal

A user initiates the withdrawal of their pending assets.

event InitiatedAssetsWithdrawal(address indexed user);

Parameters

NameTypeDescription
useraddressThe address of the user.

AssetsWithdrawn

Pending assets are withdrawn from the contract.

event AssetsWithdrawn(address indexed user, address indexed to, uint256 amount);

Parameters

NameTypeDescription
useraddressThe original owner of the position.
toaddressThe address the assets are sent to.
amountuint256The amount of assets withdrawn.

ClosePositionInitiated

A user initiates a close position action through the rebalancer.

event ClosePositionInitiated(
    address indexed user, uint256 rebalancerAmountToClose, uint256 amountToClose, uint256 rebalancerAmountRemaining
);

Parameters

NameTypeDescription
useraddressThe address of the rebalancer user.
rebalancerAmountToCloseuint256The amount of rebalancer assets to close.
amountToCloseuint256The amount to close, taking into account the previous versions PnL.
rebalancerAmountRemaininguint256The remaining rebalancer assets of the user.

PositionMaxLeverageUpdated

The maximum leverage is updated.

event PositionMaxLeverageUpdated(uint256 newMaxLeverage);

Parameters

NameTypeDescription
newMaxLeverageuint256The updated value for the maximum leverage.

MinAssetDepositUpdated

The minimum asset deposit requirement is updated.

event MinAssetDepositUpdated(uint256 minAssetDeposit);

Parameters

NameTypeDescription
minAssetDeposituint256The updated minimum amount of assets to be deposited by a user.

PositionVersionUpdated

The position version is updated.

event PositionVersionUpdated(
    uint128 newPositionVersion, uint256 entryAccMultiplier, uint128 amount, Types.PositionId positionId
);

Parameters

NameTypeDescription
newPositionVersionuint128The updated version of the position.
entryAccMultiplieruint256The accumulated multiplier at the opening of the new version.
amountuint128The amount of assets injected into the position as collateral by the rebalancer.
positionIdTypes.PositionIdThe ID of the new position in the USDN protocol.

TimeLimitsUpdated

Time limits are updated.

event TimeLimitsUpdated(
    uint256 validationDelay, uint256 validationDeadline, uint256 actionCooldown, uint256 closeDelay
);

Parameters

NameTypeDescription
validationDelayuint256The updated validation delay.
validationDeadlineuint256The updated validation deadline.
actionCooldownuint256The updated action cooldown.
closeDelayuint256The updated close delay.