IUsdnProtocolEvents

Git Source

Inherits: IUsdnProtocolTypes

Events for the USDN Protocol

Events

InitiatedDeposit

User initiates a deposit.

event InitiatedDeposit(
    address indexed to, address indexed validator, uint256 amount, uint256 feeBps, uint256 timestamp, uint256 sdexBurned
);

Parameters

NameTypeDescription
toaddressThe address that will receive the USDN tokens.
validatoraddressThe address that will receive the security deposit.
amountuint256The amount of assets that were deposited.
feeBpsuint256The fee in basis points.
timestampuint256The timestamp of the action.
sdexBurneduint256The amount of SDEX tokens burned.

ValidatedDeposit

User validates a deposit.

event ValidatedDeposit(
    address indexed to, address indexed validator, uint256 amountAfterFees, uint256 usdnMinted, uint256 timestamp
);

Parameters

NameTypeDescription
toaddressThe address that received the USDN tokens.
validatoraddressThe address that received the security deposit.
amountAfterFeesuint256The amount of assets that were deposited after fees.
usdnMinteduint256The amount of USDN that was minted.
timestampuint256The timestamp of the InitiatedDeposit action.

InitiatedWithdrawal

User initiates a withdrawal.

event InitiatedWithdrawal(
    address indexed to, address indexed validator, uint256 usdnAmount, uint256 feeBps, uint256 timestamp
);

Parameters

NameTypeDescription
toaddressThe address that will receive the assets.
validatoraddressThe address that will receive the security deposit.
usdnAmountuint256The amount of USDN that will be burned.
feeBpsuint256The fee in basis points.
timestampuint256The timestamp of the action.

ValidatedWithdrawal

User validates a withdrawal.

event ValidatedWithdrawal(
    address indexed to,
    address indexed validator,
    uint256 amountWithdrawnAfterFees,
    uint256 usdnBurned,
    uint256 timestamp
);

Parameters

NameTypeDescription
toaddressThe address that received the assets.
validatoraddressThe address that received the security deposit.
amountWithdrawnAfterFeesuint256The amount of assets that were withdrawn after fees.
usdnBurneduint256The amount of USDN that was burned.
timestampuint256The timestamp of the InitiatedWithdrawal action.

InitiatedOpenPosition

User initiates the opening of a long position.

event InitiatedOpenPosition(
    address indexed owner,
    address indexed validator,
    uint40 timestamp,
    uint128 totalExpo,
    uint128 amount,
    uint128 startPrice,
    PositionId posId
);

Parameters

NameTypeDescription
owneraddressThe address that owns the position.
validatoraddressThe address that will receive the security deposit.
timestampuint40The timestamp of the action.
totalExpouint128The initial total expo of the position (pending validation).
amountuint128The amount of assets that were deposited as collateral.
startPriceuint128The asset price at the moment of the position creation (pending validation).
posIdPositionIdThe unique position identifier.

ValidatedOpenPosition

User validates the opening of a long position.

event ValidatedOpenPosition(
    address indexed owner, address indexed validator, uint128 totalExpo, uint128 newStartPrice, PositionId posId
);

Parameters

NameTypeDescription
owneraddressThe address that owns the position.
validatoraddressThe address that received the security deposit.
totalExpouint128The total expo of the position.
newStartPriceuint128The asset price at the moment of the position creation (final).
posIdPositionIdThe unique position identifier. If changed compared to InitiatedOpenLong, then LiquidationPriceUpdated will be emitted too.

LiquidationPriceUpdated

The position was moved from one tick to another.

event LiquidationPriceUpdated(PositionId oldPosId, PositionId newPosId);

Parameters

NameTypeDescription
oldPosIdPositionIdThe old position identifier.
newPosIdPositionIdThe new position identifier.

InitiatedClosePosition

User initiates the closing of all or part of a long position.

event InitiatedClosePosition(
    address indexed owner,
    address indexed validator,
    address indexed to,
    PositionId posId,
    uint128 originalAmount,
    uint128 amountToClose,
    uint128 totalExpoRemaining
);

Parameters

NameTypeDescription
owneraddressThe owner of this position.
validatoraddressThe address that received the security deposit.
toaddressThe address that will receive the assets.
posIdPositionIdThe unique position identifier.
originalAmountuint128The amount of collateral originally on the position.
amountToCloseuint128The amount of collateral to close from the position. If the entirety of the position is being closed, this value equals originalAmount.
totalExpoRemaininguint128The total expo remaining in the position. If the entirety of the position is being closed, this value is zero.

ValidatedClosePosition

User validates the closing of a long position.

event ValidatedClosePosition(
    address indexed validator, address indexed to, PositionId posId, uint256 amountReceived, int256 profit
);

Parameters

NameTypeDescription
validatoraddressThe address that received the security deposit.
toaddressThe address that received the assets.
posIdPositionIdThe unique position identifier.
amountReceiveduint256The amount of assets that were sent to the user.
profitint256The profit that the user made.

LiquidatedTick

The tick is liquidated.

event LiquidatedTick(
    int24 indexed tick,
    uint256 indexed oldTickVersion,
    uint256 liquidationPrice,
    uint256 effectiveTickPrice,
    int256 remainingCollateral
);

Parameters

NameTypeDescription
tickint24The liquidated tick.
oldTickVersionuint256The liquidated tick version.
liquidationPriceuint256The asset price at the moment of liquidation.
effectiveTickPriceuint256The effective liquidated tick price.
remainingCollateralint256The amount of asset that was left in the tick, which was transferred to the vault if positive, or was taken from the vault if negative.

LiquidatedPosition

The position is individually liquidated.

event LiquidatedPosition(address indexed user, PositionId posId, uint256 liquidationPrice, uint256 effectiveTickPrice);

Parameters

NameTypeDescription
useraddressThe validator of the action, not necessarily the owner of the position.
posIdPositionIdThe unique identifier for the position that was liquidated.
liquidationPriceuint256The asset price at the moment of liquidation.
effectiveTickPriceuint256The effective liquidated tick price.

StalePendingActionRemoved

User's position was liquidated while pending validation and we removed the pending action.

event StalePendingActionRemoved(address indexed validator, PositionId posId);

Parameters

NameTypeDescription
validatoraddressThe validator address.
posIdPositionIdThe unique position identifier.

PositionFeeUpdated

The position fee is updated.

event PositionFeeUpdated(uint256 positionFee);

Parameters

NameTypeDescription
positionFeeuint256The new position fee (in basis points).

VaultFeeUpdated

The vault fee is updated.

event VaultFeeUpdated(uint256 vaultFee);

Parameters

NameTypeDescription
vaultFeeuint256The new vault fee (in basis points).

SdexRewardsRatioUpdated

The SDEX rewards ratio is updated.

event SdexRewardsRatioUpdated(uint16 ratio);

Parameters

NameTypeDescription
ratiouint16The new ratio (in basis points).

RebalancerBonusUpdated

The rebalancer bonus is updated.

event RebalancerBonusUpdated(uint256 bonus);

Parameters

NameTypeDescription
bonusuint256The new bonus (in basis points).

BurnSdexOnDepositRatioUpdated

The ratio of USDN to SDEX tokens to burn on deposit is updated.

event BurnSdexOnDepositRatioUpdated(uint256 newRatio);

Parameters

NameTypeDescription
newRatiouint256The new ratio.

SecurityDepositValueUpdated

The deposit value is updated.

event SecurityDepositValueUpdated(uint256 securityDepositValue);

Parameters

NameTypeDescription
securityDepositValueuint256The new deposit value.

OracleMiddlewareUpdated

The oracle middleware is updated.

event OracleMiddlewareUpdated(address newMiddleware);

Parameters

NameTypeDescription
newMiddlewareaddressThe new oracle middleware address.

RebalancerMinLeverageUpdated

The minimum leverage of the rebalancer is updated.

event RebalancerMinLeverageUpdated(uint256 newMinLeverage);

Parameters

NameTypeDescription
newMinLeverageuint256The new value for the minimum leverage.

MinLeverageUpdated

The minLeverage is updated.

event MinLeverageUpdated(uint256 newMinLeverage);

Parameters

NameTypeDescription
newMinLeverageuint256The new minLeverage.

MaxLeverageUpdated

The maxLeverage is updated.

event MaxLeverageUpdated(uint256 newMaxLeverage);

Parameters

NameTypeDescription
newMaxLeverageuint256The new maxLeverage.

ValidatorDeadlinesUpdated

The lowLatencyValidatorDeadline and onChainValidatorDeadline are updated.

event ValidatorDeadlinesUpdated(uint128 newLowLatencyValidatorDeadline, uint128 newOnChainValidatorDeadline);

Parameters

NameTypeDescription
newLowLatencyValidatorDeadlineuint128The new deadline for low-latency validation (offset from the initiate action timestamp).
newOnChainValidatorDeadlineuint128The new deadline for on-chain validation (offset from the initiate action timestamp + the oracle middleware's low-latency delay).

LiquidationPenaltyUpdated

The liquidationPenalty is updated.

event LiquidationPenaltyUpdated(uint24 newLiquidationPenalty);

Parameters

NameTypeDescription
newLiquidationPenaltyuint24The new liquidationPenalty.

SafetyMarginBpsUpdated

The safetyMargin is updated.

event SafetyMarginBpsUpdated(uint256 newSafetyMargin);

Parameters

NameTypeDescription
newSafetyMarginuint256The new safetyMargin.

LiquidationIterationUpdated

The liquidationIteration is updated.

event LiquidationIterationUpdated(uint16 newLiquidationIteration);

Parameters

NameTypeDescription
newLiquidationIterationuint16The new liquidationIteration.

EMAPeriodUpdated

The EMAPeriod is updated.

event EMAPeriodUpdated(uint128 newEMAPeriod);

Parameters

NameTypeDescription
newEMAPerioduint128The new EMAPeriod.

FundingSFUpdated

The fundingSF is updated.

event FundingSFUpdated(uint256 newFundingSF);

Parameters

NameTypeDescription
newFundingSFuint256The new fundingSF.

LiquidatorRewarded

Emitted when a user (liquidator) successfully liquidated positions.

event LiquidatorRewarded(address indexed liquidator, uint256 rewards);

Parameters

NameTypeDescription
liquidatoraddressThe address that initiated the liquidation.
rewardsuint256The amount of tokens the liquidator received in rewards.

LiquidationRewardsManagerUpdated

The LiquidationRewardsManager contract is updated.

event LiquidationRewardsManagerUpdated(address newAddress);

Parameters

NameTypeDescription
newAddressaddressThe address of the new (current) contract.

RebalancerUpdated

The rebalancer contract is updated.

event RebalancerUpdated(address newAddress);

Parameters

NameTypeDescription
newAddressaddressThe address of the new (current) contract.

ProtocolFeeDistributed

The pending protocol fee is distributed.

event ProtocolFeeDistributed(address feeCollector, uint256 amount);

Parameters

NameTypeDescription
feeCollectoraddressThe collector's address.
amountuint256The amount of fee transferred.

FeeBpsUpdated

The protocol fee is updated.

event FeeBpsUpdated(uint256 feeBps);

Parameters

NameTypeDescription
feeBpsuint256The new fee in basis points.

FeeCollectorUpdated

The fee collector is updated.

event FeeCollectorUpdated(address feeCollector);

Parameters

NameTypeDescription
feeCollectoraddressThe new fee collector address.

FeeThresholdUpdated

The fee threshold is updated.

event FeeThresholdUpdated(uint256 feeThreshold);

Parameters

NameTypeDescription
feeThresholduint256The new fee threshold.

TargetUsdnPriceUpdated

The target USDN price is updated.

event TargetUsdnPriceUpdated(uint128 price);

Parameters

NameTypeDescription
priceuint128The new target USDN price.

UsdnRebaseThresholdUpdated

The USDN rebase threshold is updated.

event UsdnRebaseThresholdUpdated(uint128 threshold);

Parameters

NameTypeDescription
thresholduint128The new target USDN price.

ImbalanceLimitsUpdated

Imbalance limits are updated.

event ImbalanceLimitsUpdated(
    uint256 newOpenLimitBps,
    uint256 newDepositLimitBps,
    uint256 newWithdrawalLimitBps,
    uint256 newCloseLimitBps,
    uint256 newRebalancerCloseLimitBps,
    int256 newLongImbalanceTargetBps
);

Parameters

NameTypeDescription
newOpenLimitBpsuint256The new open limit.
newDepositLimitBpsuint256The new deposit limit.
newWithdrawalLimitBpsuint256The new withdrawal limit.
newCloseLimitBpsuint256The new close limit.
newRebalancerCloseLimitBpsuint256The new close limit for the rebalancer's position.
newLongImbalanceTargetBpsint256The new long imbalance target.

MinLongPositionUpdated

The minimum long position is updated.

event MinLongPositionUpdated(uint256 minLongPosition);

Parameters

NameTypeDescription
minLongPositionuint256The new minimum long position.

HighestPopulatedTickUpdated

The highest populated tick is updated.

event HighestPopulatedTickUpdated(int24 tick);

Parameters

NameTypeDescription
tickint24The new highest populated tick.

SecurityDepositRefunded

Security deposit is refunded.

event SecurityDepositRefunded(address indexed pendingActionValidator, address indexed receivedBy, uint256 amount);

Parameters

NameTypeDescription
pendingActionValidatoraddressAddress of the default validator.
receivedByaddressAddress of the user that received the security deposit.
amountuint256Amount of security deposit refunded.

PositionOwnershipTransferred

Position changes ownership.

event PositionOwnershipTransferred(PositionId posId, address indexed oldOwner, address indexed newOwner);

Parameters

NameTypeDescription
posIdPositionIdThe unique position ID.
oldOwneraddressThe old owner.
newOwneraddressThe new owner.

LastFundingPerDayUpdated

The last funding per day is updated.

event LastFundingPerDayUpdated(int256 lastFundingPerDay, uint256 lastUpdateTimestamp);

Parameters

NameTypeDescription
lastFundingPerDayint256The new funding per day.
lastUpdateTimestampuint256The timestamp for which the funding per day was calculated.

SdexBurned

The protocol balance of SDEX has been burned.

event SdexBurned(uint256 amount, uint256 rewards);

Parameters

NameTypeDescription
amountuint256The amount of SDEX that was burned.
rewardsuint256The amount of rewards that were distributed to the caller.