# Staking Yield Logic

<figure><img src="/files/4zRqOUTMrOQRb6AfUvEu" 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     |


---

# 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://docs.keyfi.finance/staking-yield-logic.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.
