# 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;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://erc20-docs.particle.trade/developer/premium-accounting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
