Particle LAMM Dev Handbook
  • Introduction
  • Logic
    • Overview
    • Open Long
    • Close Long
    • Open Short
    • Close Short
  • Developer
    • Liquidity Provision
    • Open Position
    • Close Position
    • Liquidate Position
    • Long/Short Symmetry
    • Trading Fees
    • Premium Accounting
    • Reclaim Liquidity
Powered by GitBook
On this page
  1. Developer

Premium Accounting

  • After swapping, any leftover amounts are stored as premium. The frontend can deliberately deposit more margin and demand to swap more target tokens than the borrowed liquidity amount, in order to top up the initial premium.

  • To save space in storage, it’s worth nothing that we only store tokenPremiumPortion (uint24) inside Lien.Info. The portion is calculated as premiumAmount / collateralAmount, where the collateralAmount is the corresponding token amount concentrated on the liquidity boundary (which is determined by tickLower, tickUpper, borrowedLiquidity in Base.getRequiredCollateral).

  • The premium can be calculated via Base.getPremium. Also, ParticleInfoReader implements a getpremium from borrower and lienid.

  • Premium can be added via function addPremium.

PreviousTrading FeesNextReclaim Liquidity

Last updated 1 year ago