SmarDex Ecosystem
Github
USDN Protocol
USDN Protocol
  • Introduction
    • Quick Overview
  • THE USDN Protocol
    • Protocol USDN Overview
      • Simplified Examples
    • Protocol Balance
      • Imbalance Protections
      • Equilibrium: The Role of the Funding Rate
    • Vault Side
      • Vault Overview
      • Rebase Mechanism
      • Yields
        • Funding Rates
        • Yield-bearing asset
    • Long Side
      • Long Perpetual
      • Long Overview
      • Dip Accumulator
      • wstETH Collateralization
      • Liquidations and Minimum Position
    • Inside the Protocol
      • Protocol vs Market Fluctuations
      • 1. Providing a Price
      • 2. Calculating Long PnLs
      • 3. Applying the Funding Rate
      • 4. Liquidating Positions
    • Integration
      • WUSDN
    • Fees
      • Protocol Fees
      • Liquidation Fee
    • Protocol parameters
    • Oracles
    • Governance
    • Risks
    • SDEX
    • Addresses
    • FAQ
    • Glossary
  • PERIPHERY
    • Long farming
  • Whitepaper
  • Github
  • Audits
Powered by GitBook
On this page
  1. THE USDN Protocol
  2. Inside the Protocol

2. Calculating Long PnLs

Once the protocol receives the price of the asset, it calculates the PnLs (profits and losses) for long positions. Longs, as the name suggests, bet on the rise of the asset's price. Therefore, if the price has increased since the last protocol update, longs make a profit. The protocol then transfers this profit from the vault side to the long positions, specifically to their collateral, which represents the portion of the position that the user can withdraw.

Conversely, if the price of the asset decreases, longs incur a loss. The protocol then transfers this loss from the long positions to the vault side, reducing the longs' collateral. This mechanism automatically adjusts positions based on market movements, ensuring a fair distribution of gains and losses.

The next step is to apply the funding rate, which we will detail in the following section.

Previous1. Providing a PriceNext3. Applying the Funding Rate

Last updated 2 months ago