> For the complete documentation index, see [llms.txt](https://docs.kuma.bond/kuma-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kuma.bond/kuma-protocol/developers/smart-contract-architecture/kumaswap/sellbond.md).

# sellBond

### Requirements

The following conditions must be met to sell a KUMA NFT to the contract:

* The contract must be unpaused
* The maximum amount of unique coupons in reserve must not have be reached
* The sold bond risk category must match the `KUMASwap` risk category
* The sold bond must not have reached maturity
* The sold bond coupon must greater or equal to the current `RateFeed` rate.

<figure><img src="/files/lbvzFdjYJjuItZER2UiI" alt=""><figcaption></figcaption></figure>

### Minted KIBT Calculation

The amount of minted `KIBToken` to the seller is calculated as follow :

$$bondValue = bond.principal \* (bond.coupon^{elapsedTime})$$

$$fee = (bondValue \* variableFee) + fixedFee$$

$$mintedAmount = bondValue - fee$$
