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.

Last updated