1. Providing a Price
Interaction with the USDN Protocol
Last updated
Interaction with the USDN Protocol
Last updated
When a user interacts with the USDN Protocol (by minting/redeeming USDN, opening/closing a Long position or liquidating positions), providing a price is mandatory. The Protocol, operating on the blockchain, does not have direct access to external prices and therefore relies on the information provided by the user. To minimize the risk of fraud, only prices from trusted oracles such as Pyth and Chainlink are accepted. A redundancy mechanism is in place between these two oracles to ensure continuity of operations if one becomes unavailable.
To protect the Protocol against attacks or price manipulation, a two-step system has been implemented:
Initiate: The user begins by initiating the action (minting/redeeming USDN or opening/closing a Long position) and provides a Security Deposit of 0.5 ETH. This deposit serves as a guarantee for the subsequent validation of the action.
Validate: After a minimum of 24 seconds, the user must validate their action. The price used for validation is the one from Pyth, recorded at T+24 seconds. If Pyth is unavailable, the Protocol then falls back to Chainlink. This redundancy mechanism ensures that validation is always conducted with reliable data.
Although the initiator of the operation is typically responsible for validation, any other user can also perform this action. However, specific time intervals determine whether the Security Deposit is given to the designated validator or claimed by the actual validator.
Here’s a summary of the validation time intervals and who can claim the Security Deposit at each stage:
From T to T+23s: No validation possible.
From T+24s to T+15m: The designated validator will receive the Security Deposit on validation (using Pyth).
From T+15m to T+20m: Any validator will receive the Security Deposit on validation (using Pyth).
From T+20m to T+85m: The designated validator will receive the Security Deposit (using Chainlink). However, validation must be done using a new Chainlink price available at T+20m. This rule ensures no user can exploit the Protocol financially. Note that Chainlink updates its prices at a maximum interval of 60 minutes, potentially creating a "dead zone" between T+20m and T+80m if no new price is published. However, there is a guaranteed window between T+80m and T+85m where the initiator can validate under any circumstances.
After T+85m: Any validator will receive the Security Deposit on validation (using Chainlink).
The 0.5 ETH deposit ensures that the user completes their operation, preventing actions from remaining indefinitely pending, which could hinder the functionality of the Protocol. Validation delays are designed to encourage timely transaction finalization. By limiting the time available to validate an action, the Protocol ensures that operations are executed efficiently and within timelines that preserve the system’s responsiveness and security. This time structure also helps minimize the risks of manipulation or external interference, thus supporting the overall integrity of transactions on the platform.
When a user interacts with the Protocol, they must provide a price from either Pyth or Chainlink through a redundancy mechanism that ensures continuity in case one of the oracles becomes unavailable. The process occurs in two steps: Initiate and Validate, separated by a mandatory delay of 24 seconds. A Security Deposit of 0.5 ETH is required to ensure the operation is finalized. If the user fails to validate their action in time, another user can validate it and claim the Security Deposit, ensuring actions are validated in reasonable amount of time.
Once a valid price is received, the Protocol performs a series of calculations, starting with adjusting the PNL of Long positions, as explained in the next section.