Inside the Protocol
What really happens inside the USDN Protocol? This is what we will detail in this section, so you can gain a clear understanding of its operation.
Last updated
What really happens inside the USDN Protocol? This is what we will detail in this section, so you can gain a clear understanding of its operation.
Last updated
When you perform one of the four main actions (minting or redeeming USDN, opening or closing a Long position), several steps take place behind the scenes. The first of these steps is to obtain a price, as the Protocol, operating on the blockchain, does not inherently know market prices. This is why, for every action, the user must provide a price.
Once the price is submitted, the Protocol can carry out the necessary calculations to update each position. Here is an overview of the steps the Protocol executes:
Calculate Long PNLs: The Protocol begins by calculating the profit or loss (PNL) of Long positions. The Collaterals of these positions are adjusted accordingly: if a Long bet succeeds, its Collateral increases.
Apply Fundings: The Protocol calculates the amount owed based on the Funding Rate and transfer assets between the Long Side and the Vault Side, determining who owes and who receives.
Liquidate Positions: The Protocol checks if there are any positions to liquidate. Insolvent positions are automatically liquidated to ensure the system's stability and security.
Trigger the Dip Accumulator: If the protocol is heavily imbalanced, the dip accumulator will be triggered to safeguard the protocol. Learn more about it here.
Rebasing USDN: If all of the above pushed the price of the USDN higher than necessary, it will inflate the holders' balance to compensate. Learn more about it here.
In the following sections, we will detail each of these steps to give you a deeper understanding of the Protocol's inner workings.
To avoid duplicating information, only the first 3 steps will be explained in the following sections.