# Staking Yield Logic

<figure><img src="https://1322525246-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJoe4m5mYyzLWoiO8kJ4F%2Fuploads%2FdfWsHYgm0Ls6Hi9CUGon%2Fimage.png?alt=media&#x26;token=dc97d3a5-d03d-4cb2-97f8-1217a17fdd22" alt=""><figcaption></figcaption></figure>

## Incoming Flow: BNB Stake

When a user begins:

* They **stake BNB** into KeyFi and select a **vesting duration**.
* **100% of the BNB** is **instantly swapped** on-chain via AMM (e.g., PancakeSwap) to purchase KeyFi tokens.

📌 *This creates a constant demand for KeyFi tokens, aligning user actions with price dynamics.*

***

## Midway Storage: Key NFT

If vesting > 0h:

* A **Key NFT** (ERC-721) is minted to the user.
* This NFT holds:
  * The **purchased KeyFi tokens**
  * The **bonus** according to vesting time
  * The **countdown timer**

🔁 The NFT can be traded on the marketplace anytime before maturity. Ownership = reward rights.

***

## Outgoing Flow: Token Reward

After vesting completes, the user can **burn the NFT** to redeem:

* Base KeyFi (from the AMM buy)
* Bonus KeyFi (added based on vesting duration)

Alternatively, a buyer of the NFT can do the same.

📌 *Rewards are not emitted — they are already pre-acquired by the user’s own BNB, and locked in the NFT.*

***

## Summary of Token Flow:

| Token Action        | Result                              |
| ------------------- | ----------------------------------- |
| User deposits BNB   | BNB swapped → KeyFi tokens on AMM   |
| KeyFi tokens stored | Locked inside NFT (with bonus)      |
| Vesting ends        | NFT → claimable KeyFi tokens reward |
| Claim or trade      | Either hold, redeem or sell NFT     |
