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
) insideLien.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 inBase.getRequiredCollateral
).The premium can be calculated via
Base.getPremium
. Also,ParticleInfoReader
implements agetpremium
fromborrower
andlienid
.Premium can be added via function
addPremium
.
Last updated