> For the complete documentation index, see [llms.txt](https://erc20-docs.particle.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://erc20-docs.particle.trade/developer/premium-accounting.md).

# 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`.&#x20;
