IUsdnProtocolEvents
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
Name | Type | Description |
---|---|---|
to | address | The address that will receive the USDN tokens. |
validator | address | The address that will receive the security deposit. |
amount | uint256 | The amount of assets that were deposited. |
feeBps | uint256 | The fee in basis points. |
timestamp | uint256 | The timestamp of the action. |
sdexBurned | uint256 | The 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
Name | Type | Description |
---|---|---|
to | address | The address that received the USDN tokens. |
validator | address | The address that received the security deposit. |
amountAfterFees | uint256 | The amount of assets that were deposited after fees. |
usdnMinted | uint256 | The amount of USDN that was minted. |
timestamp | uint256 | The 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
Name | Type | Description |
---|---|---|
to | address | The address that will receive the assets. |
validator | address | The address that will receive the security deposit. |
usdnAmount | uint256 | The amount of USDN that will be burned. |
feeBps | uint256 | The fee in basis points. |
timestamp | uint256 | The timestamp of the action. |
ValidatedWithdrawal
User validates a withdrawal.
event ValidatedWithdrawal(
address indexed to,
address indexed validator,
uint256 amountWithdrawnAfterFees,
uint256 usdnBurned,
uint256 timestamp
);
Parameters
Name | Type | Description |
---|---|---|
to | address | The address that received the assets. |
validator | address | The address that received the security deposit. |
amountWithdrawnAfterFees | uint256 | The amount of assets that were withdrawn after fees. |
usdnBurned | uint256 | The amount of USDN that was burned. |
timestamp | uint256 | The 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
Name | Type | Description |
---|---|---|
owner | address | The address that owns the position. |
validator | address | The address that will receive the security deposit. |
timestamp | uint40 | The timestamp of the action. |
totalExpo | uint128 | The initial total expo of the position (pending validation). |
amount | uint128 | The amount of assets that were deposited as collateral. |
startPrice | uint128 | The asset price at the moment of the position creation (pending validation). |
posId | PositionId | The 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
Name | Type | Description |
---|---|---|
owner | address | The address that owns the position. |
validator | address | The address that received the security deposit. |
totalExpo | uint128 | The total expo of the position. |
newStartPrice | uint128 | The asset price at the moment of the position creation (final). |
posId | PositionId | The 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
Name | Type | Description |
---|---|---|
oldPosId | PositionId | The old position identifier. |
newPosId | PositionId | The 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
Name | Type | Description |
---|---|---|
owner | address | The owner of this position. |
validator | address | The address that received the security deposit. |
to | address | The address that will receive the assets. |
posId | PositionId | The unique position identifier. |
originalAmount | uint128 | The amount of collateral originally on the position. |
amountToClose | uint128 | The amount of collateral to close from the position. If the entirety of the position is being closed, this value equals originalAmount . |
totalExpoRemaining | uint128 | The 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
Name | Type | Description |
---|---|---|
validator | address | The address that received the security deposit. |
to | address | The address that received the assets. |
posId | PositionId | The unique position identifier. |
amountReceived | uint256 | The amount of assets that were sent to the user. |
profit | int256 | The 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
Name | Type | Description |
---|---|---|
tick | int24 | The liquidated tick. |
oldTickVersion | uint256 | The liquidated tick version. |
liquidationPrice | uint256 | The asset price at the moment of liquidation. |
effectiveTickPrice | uint256 | The effective liquidated tick price. |
remainingCollateral | int256 | The 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
Name | Type | Description |
---|---|---|
user | address | The validator of the action, not necessarily the owner of the position. |
posId | PositionId | The unique identifier for the position that was liquidated. |
liquidationPrice | uint256 | The asset price at the moment of liquidation. |
effectiveTickPrice | uint256 | The 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
Name | Type | Description |
---|---|---|
validator | address | The validator address. |
posId | PositionId | The unique position identifier. |
PositionFeeUpdated
The position fee is updated.
event PositionFeeUpdated(uint256 positionFee);
Parameters
Name | Type | Description |
---|---|---|
positionFee | uint256 | The new position fee (in basis points). |
VaultFeeUpdated
The vault fee is updated.
event VaultFeeUpdated(uint256 vaultFee);
Parameters
Name | Type | Description |
---|---|---|
vaultFee | uint256 | The new vault fee (in basis points). |
SdexRewardsRatioUpdated
The SDEX rewards ratio is updated.
event SdexRewardsRatioUpdated(uint16 ratio);
Parameters
Name | Type | Description |
---|---|---|
ratio | uint16 | The new ratio (in basis points). |
RebalancerBonusUpdated
The rebalancer bonus is updated.
event RebalancerBonusUpdated(uint256 bonus);
Parameters
Name | Type | Description |
---|---|---|
bonus | uint256 | The new bonus (in basis points). |
BurnSdexOnDepositRatioUpdated
The ratio of USDN to SDEX tokens to burn on deposit is updated.
event BurnSdexOnDepositRatioUpdated(uint256 newRatio);
Parameters
Name | Type | Description |
---|---|---|
newRatio | uint256 | The new ratio. |
SecurityDepositValueUpdated
The deposit value is updated.
event SecurityDepositValueUpdated(uint256 securityDepositValue);
Parameters
Name | Type | Description |
---|---|---|
securityDepositValue | uint256 | The new deposit value. |
OracleMiddlewareUpdated
The oracle middleware is updated.
event OracleMiddlewareUpdated(address newMiddleware);
Parameters
Name | Type | Description |
---|---|---|
newMiddleware | address | The new oracle middleware address. |
RebalancerMinLeverageUpdated
The minimum leverage of the rebalancer is updated.
event RebalancerMinLeverageUpdated(uint256 newMinLeverage);
Parameters
Name | Type | Description |
---|---|---|
newMinLeverage | uint256 | The new value for the minimum leverage. |
MinLeverageUpdated
The minLeverage
is updated.
event MinLeverageUpdated(uint256 newMinLeverage);
Parameters
Name | Type | Description |
---|---|---|
newMinLeverage | uint256 | The new minLeverage . |
MaxLeverageUpdated
The maxLeverage
is updated.
event MaxLeverageUpdated(uint256 newMaxLeverage);
Parameters
Name | Type | Description |
---|---|---|
newMaxLeverage | uint256 | The new maxLeverage . |
ValidatorDeadlinesUpdated
The lowLatencyValidatorDeadline
and onChainValidatorDeadline
are updated.
event ValidatorDeadlinesUpdated(uint128 newLowLatencyValidatorDeadline, uint128 newOnChainValidatorDeadline);
Parameters
Name | Type | Description |
---|---|---|
newLowLatencyValidatorDeadline | uint128 | The new deadline for low-latency validation (offset from the initiate action timestamp). |
newOnChainValidatorDeadline | uint128 | The 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
Name | Type | Description |
---|---|---|
newLiquidationPenalty | uint24 | The new liquidationPenalty . |
SafetyMarginBpsUpdated
The safetyMargin
is updated.
event SafetyMarginBpsUpdated(uint256 newSafetyMargin);
Parameters
Name | Type | Description |
---|---|---|
newSafetyMargin | uint256 | The new safetyMargin . |
LiquidationIterationUpdated
The liquidationIteration
is updated.
event LiquidationIterationUpdated(uint16 newLiquidationIteration);
Parameters
Name | Type | Description |
---|---|---|
newLiquidationIteration | uint16 | The new liquidationIteration . |
EMAPeriodUpdated
The EMAPeriod is updated.
event EMAPeriodUpdated(uint128 newEMAPeriod);
Parameters
Name | Type | Description |
---|---|---|
newEMAPeriod | uint128 | The new EMAPeriod. |
FundingSFUpdated
The fundingSF
is updated.
event FundingSFUpdated(uint256 newFundingSF);
Parameters
Name | Type | Description |
---|---|---|
newFundingSF | uint256 | The new fundingSF . |
LiquidatorRewarded
Emitted when a user (liquidator) successfully liquidated positions.
event LiquidatorRewarded(address indexed liquidator, uint256 rewards);
Parameters
Name | Type | Description |
---|---|---|
liquidator | address | The address that initiated the liquidation. |
rewards | uint256 | The amount of tokens the liquidator received in rewards. |
LiquidationRewardsManagerUpdated
The LiquidationRewardsManager
contract is updated.
event LiquidationRewardsManagerUpdated(address newAddress);
Parameters
Name | Type | Description |
---|---|---|
newAddress | address | The address of the new (current) contract. |
RebalancerUpdated
The rebalancer contract is updated.
event RebalancerUpdated(address newAddress);
Parameters
Name | Type | Description |
---|---|---|
newAddress | address | The address of the new (current) contract. |
ProtocolFeeDistributed
The pending protocol fee is distributed.
event ProtocolFeeDistributed(address feeCollector, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
feeCollector | address | The collector's address. |
amount | uint256 | The amount of fee transferred. |
FeeBpsUpdated
The protocol fee is updated.
event FeeBpsUpdated(uint256 feeBps);
Parameters
Name | Type | Description |
---|---|---|
feeBps | uint256 | The new fee in basis points. |
FeeCollectorUpdated
The fee collector is updated.
event FeeCollectorUpdated(address feeCollector);
Parameters
Name | Type | Description |
---|---|---|
feeCollector | address | The new fee collector address. |
FeeThresholdUpdated
The fee threshold is updated.
event FeeThresholdUpdated(uint256 feeThreshold);
Parameters
Name | Type | Description |
---|---|---|
feeThreshold | uint256 | The new fee threshold. |
TargetUsdnPriceUpdated
The target USDN price is updated.
event TargetUsdnPriceUpdated(uint128 price);
Parameters
Name | Type | Description |
---|---|---|
price | uint128 | The new target USDN price. |
UsdnRebaseThresholdUpdated
The USDN rebase threshold is updated.
event UsdnRebaseThresholdUpdated(uint128 threshold);
Parameters
Name | Type | Description |
---|---|---|
threshold | uint128 | The new target USDN price. |
ImbalanceLimitsUpdated
Imbalance limits are updated.
event ImbalanceLimitsUpdated(
uint256 newOpenLimitBps,
uint256 newDepositLimitBps,
uint256 newWithdrawalLimitBps,
uint256 newCloseLimitBps,
uint256 newRebalancerCloseLimitBps,
int256 newLongImbalanceTargetBps
);
Parameters
Name | Type | Description |
---|---|---|
newOpenLimitBps | uint256 | The new open limit. |
newDepositLimitBps | uint256 | The new deposit limit. |
newWithdrawalLimitBps | uint256 | The new withdrawal limit. |
newCloseLimitBps | uint256 | The new close limit. |
newRebalancerCloseLimitBps | uint256 | The new close limit for the rebalancer's position. |
newLongImbalanceTargetBps | int256 | The new long imbalance target. |
MinLongPositionUpdated
The minimum long position is updated.
event MinLongPositionUpdated(uint256 minLongPosition);
Parameters
Name | Type | Description |
---|---|---|
minLongPosition | uint256 | The new minimum long position. |
HighestPopulatedTickUpdated
The highest populated tick is updated.
event HighestPopulatedTickUpdated(int24 tick);
Parameters
Name | Type | Description |
---|---|---|
tick | int24 | The new highest populated tick. |
SecurityDepositRefunded
Security deposit is refunded.
event SecurityDepositRefunded(address indexed pendingActionValidator, address indexed receivedBy, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
pendingActionValidator | address | Address of the default validator. |
receivedBy | address | Address of the user that received the security deposit. |
amount | uint256 | Amount of security deposit refunded. |
PositionOwnershipTransferred
Position changes ownership.
event PositionOwnershipTransferred(PositionId posId, address indexed oldOwner, address indexed newOwner);
Parameters
Name | Type | Description |
---|---|---|
posId | PositionId | The unique position ID. |
oldOwner | address | The old owner. |
newOwner | address | The new owner. |
LastFundingPerDayUpdated
The last funding per day is updated.
event LastFundingPerDayUpdated(int256 lastFundingPerDay, uint256 lastUpdateTimestamp);
Parameters
Name | Type | Description |
---|---|---|
lastFundingPerDay | int256 | The new funding per day. |
lastUpdateTimestamp | uint256 | The 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
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of SDEX that was burned. |
rewards | uint256 | The amount of rewards that were distributed to the caller. |