# Buy & Burn

Legacy's Buy & Burn mechanism takes 21% of total ETH fees generated by the protocol through [creating builders](/builders-phase.md) and uses those funds to buy Legacy on Uniswap v3 WETH/LEGACY pool and then automatically burns those tokens removing them from the circulation.&#x20;

The idea of Buy & Burn in Legacy was to replicate the amount of lost Bitcoins. It is said that around 13 - 35% of all Bitcoin tokens are gone through lost keys, thrown out hard drives as well as the ≈5% of Bitcoins that Satoshi Nakamoto owns. The estimations are quite inaccurate, some sources say it is 13%, some say it is closer to 25%. Legacy chose 21% for that matter. \
\
Setting 21% of all Legacy tokens that will ever be created for Buy & Burn should help create a squeeze in the supply of Legacy supporting the price appreciation long-term.&#x20;

10% of total ETH fees generated by Legacy protocol are sent to TitanX's Buy\&Burn.&#x20;

### Smart Contract Methods User Incentive Fee:

Protocol Participants get an incentive fee of 0.66% ETH from collected fees for calling the <mark style="color:purple;">Redistribute Paydays + B\&B</mark> smart contract function which distributes the ETH between paydays for stakers and buy and burn.&#x20;

Similar incentive fee reward of 0.66% is granted for triggering Buy & Burn function thats buys Legacy from the open market via Uniswap v3 WETH/LEGACY pool and burns all the amount of purchased Legacy tokens.&#x20;

Both actions can be done in [Legacy dApp](https://app.legacy.diamonds/).\
\
\
WyvernX Fund Flow Visualization - Path to Buy & Burn

```
High-Level Overview


┌─────────────────────────────────────────────────────────────────────────────────────────┐
│                           WYVERNX ECOSYSTEM FUND FLOW                                   │
│                     How TitanX & ETH Flow to Buy & Burn Contract                        │
└─────────────────────────────────────────────────────────────────────────────────────────┘

                    ┌──────────────────────────┐
                    │    USER ACTIONS          │
                    │  (Entry Points)          │
                    └──────────┬───────────────┘
                               │
         ┌─────────────────────┼─────────────────────┐
         │                     │                     │
         ▼                     ▼                     ▼
┌─────────────────┐   ┌─────────────────┐   ┌─────────────────┐
│  Mint WyvernX   │   │  Stake WyvernX  │   │  Stake TitanX   │
│  (pays TitanX)  │   │  (rewards pool) │   │  (in Vault)     │
└────────┬────────┘   └────────┬────────┘   └────────┬────────┘
         │                     │                     │
         ▼                     │                     ▼
┌─────────────────┐            │            ┌─────────────────┐
│   WyvernX.sol   │◄───────────┘            │ WyvernVault.sol │
│  (Main Token)   │                         │ (TitanX Stakes) │
└────────┬────────┘                         └────────┬────────┘
         │                                           │
         │ TitanX fees                               │ ETH from TitanX
         │ distributed                               │ stake rewards
         ▼                                           ▼
┌─────────────────────────────────────────────────────────────────┐
│                        DISTRIBUTION HUB                          │
│                    (When claim() is called)                      │
└─────────────────────────────────────────────────────────────────┘
         │
         │ ETH Distribution from WyvernVault.claim()
         │
         ├──────────► 80% ──────► TitanBuy.sol ──────► buys TitanX with ETH
         │
         ├──────────►  5% ──────► WyvernBuyAndBurn.sol ◄─── (ETH → WETH)
         │
         ├──────────►  7% ──────► Legacy Protocol
         │
         ├──────────►  5% ──────► Genesis Wallet
         │
         └──────────►  3% ──────► Caller Incentive Fee
```

```
🔄 Complete Lifecycle Flow


                              ┌─────────────────────────┐
                              │    TITANX PROTOCOL      │
                              │  (External Protocol)    │
                              └───────────┬─────────────┘
                                          │
                           Stakes earn ETH rewards
                                          │
                                          ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│                              WYVERN VAULT                                    │
│    ┌─────────────┐                                      ┌─────────────┐     │
│    │ WyvernStake │◄───── TitanX transferred ────────────│   vault     │     │
│    │  Contracts  │       for staking                    │  variable   │     │
│    └──────┬──────┘                                      └─────────────┘     │
│           │                                                    ▲            │
│           │ Stakes mature,                                     │            │
│           │ claim() triggers                               73% TitanX       │
│           ▼                                                    │            │
│    ┌─────────────┐         ┌────────────────┐         ┌───────┴───────┐    │
│    │  ETH Claimed│────────►│  claim()       │────────►│   TitanBuy    │    │
│    │  from TitanX│   80%   │  distributes   │         │  buyTitanX()  │    │
│    │   Protocol  │         │     ETH        │         └───────┬───────┘    │
│    └─────────────┘         └───────┬────────┘                 │            │
│                                    │                          │            │
└────────────────────────────────────┼──────────────────────────┼────────────┘
                                     │                          │
                           5% ETH    │                    TitanX bought
                                     │                          │
                                     ▼                          ▼
                        ┌────────────────────────┐    ┌─────────────────────┐
                        │   WyvernBuyAndBurn     │    │     WyvernX.sol     │
                        │                        │    │                     │
                        │  ETH → WETH (receive)  │    │  Receives TitanX    │
                        │                        │    │  for:               │
                        │  buyAndBurnWyvernX()   │    │  - Staking rewards  │
                        │  WETH→TitanX→WyvernX   │    │  - Cycle payouts    │
                        │         │              │    │                     │
                        │         ▼              │    └─────────────────────┘
                        │      BURN 🔥           │
                        │  (burnLPTokens())      │
                        └────────────────────────┘
```

```
Path 3: LP Fee Collection → Liquidity or Distribution


┌────────────────────────────────────────────────────────────────────────────────┐
│           UNISWAP V3 POOL (WyvernX/TitanX)                                      │
│                   Accrues trading fees                                          │
└────────────────────────────────────────────────────────────────────────────────┘
                                    │
                                    │ collectFees() called
                                    ▼
                        ┌───────────────────────┐
                        │  WyvernBuyAndBurn.sol │
                        │     _collectFees()    │
                        └───────────┬───────────┘
                                    │
              ┌─────────────────────┴─────────────────────┐
              │                                           │
              ▼                                           ▼
    ┌───────────────────┐                     ┌───────────────────┐
    │  If _addLiquidity │                     │ If !_addLiquidity │
    │     == true       │                     │                   │
    └─────────┬─────────┘                     └─────────┬─────────┘
              │                                         │
              ▼                                         ▼
    ┌───────────────────┐                     ┌───────────────────┐
    │ Add both WyvernX  │                     │ WyvernX fees →    │
    │ and TitanX back   │                     │ Liquidity Bonding │
    │ to LP as liquidity│                     │                   │
    └───────────────────┘                     │ TitanX fees →     │
                                              │ WyvernX contract  │
                                              │ (staking rewards) │
                                              └───────────────────┘
```

```
Path 2: Mint Protocol Fees → TitanX Distribution


┌────────────────────────────────────────────────────────────────────────────────┐
│                        USER MINTS WYVERNX                                       │
└────────────────────────────────────────────────────────────────────────────────┘
                                    │
                                    │ User pays TitanX as mint fee
                                    ▼
                         ┌─────────────────────┐
                         │    WyvernX.sol      │
                         │  s_undistributedFees│◄──── TitanX accumulates here
                         └──────────┬──────────┘
                                    │
                                    │ distributeFees() or triggerPayouts()
                                    ▼
                         ┌─────────────────────┐
                         │  _distributeTitanX()│
                         └──────────┬──────────┘
                                    │
         ┌──────────────────────────┼──────────────────────────┐
         │                          │                          │
         ▼                          ▼                          ▼
┌─────────────────┐      ┌─────────────────┐      ┌─────────────────────┐
│   3% Incentive  │      │   73% Vault     │      │    7% Genesis       │
│   (to caller)   │      │  (if minting    │      │    Wallet           │
│                 │      │   phase active) │      │                     │
└─────────────────┘      └─────────────────┘      └─────────────────────┘
                                    │
         ┌──────────────────────────┼──────────────────────────┐
         │                          │                          │
         ▼                          ▼                          ▼
┌─────────────────┐      ┌─────────────────┐      ┌─────────────────────┐
│  5% Liquidity   │      │   15% Cycle     │      │                     │
│    Bonding      │      │  Payouts Pool   │      │  WyvernVault        │
│                 │      │  (8/28/90/369/  │      │  (compounds into    │
└─────────────────┘      │   888 day)      │      │   TitanX stakes)    │
                         └─────────────────┘      └─────────────────────┘
```

```
Path 1: Direct ETH Flow (Main Source)


                     WyvernVault.claim()
                            │
                            │ Claims ETH from TitanX stake rewards
                            ▼
               ┌────────────────────────────┐
               │  ETH Distribution (100%)   │
               │                            │
               │  ┌──────────────────────┐  │
               │  │ 5% → BuyAndBurn      │──┼──────────────────────────┐
               │  └──────────────────────┘  │                         │
               │  ┌──────────────────────┐  │                         │
               │  │ 80% → TitanBuy       │──┼────────┐                │
               │  └──────────────────────┘  │        │                │
               │  ┌──────────────────────┐  │        │                │
               │  │ 7% → Legacy          │  │        │                │
               │  └──────────────────────┘  │        │                │
               │  ┌──────────────────────┐  │        │                │
               │  │ 5% → Genesis         │  │        │                │
               │  └──────────────────────┘  │        │                │
               │  ┌──────────────────────┐  │        │                │
               │  │ 3% → Caller          │  │        │                │
               │  └──────────────────────┘  │        │                │
               └────────────────────────────┘        │                │
                                                     │                │
                                                     ▼                ▼
                                            ┌──────────────┐  ┌───────────────────┐
                                            │  TitanBuy    │  │ WyvernBuyAndBurn  │
                                            │  receives    │  │   receives ETH    │
                                            │    ETH       │  │                   │
                                            └──────┬───────┘  └─────────┬─────────┘
                                                   │                    │
                                                   ▼                    │ Auto-wraps
                                           ┌───────────────┐            │ to WETH
                                           │ Swap ETH→WETH │            │
                                           │ then WETH→    │            ▼
                                           │ TitanX        │    ┌───────────────────┐
                                           └───────┬───────┘    │  receive() wraps  │
                                                   │            │   ETH → WETH      │
                                                   ▼            └─────────┬─────────┘
                                           ┌───────────────┐              │
                                           │   TitanX      │              │
                                           │  Distribution │              │
                                           └───────┬───────┘              │
                                                   │                      │
                  ┌────────────────────────────────┼──────────────────────┘
                  │                                │
    ┌─────────────┴───────────────────┐            │
    │  When activeSharesPercentage    │            │
    │  >= 50% (LOWER_BUFFER)          │            │
    │                                 │            │
    │  Combined 95% → WyvernX.sol     │            │
    │  (for staking rewards)          │            │
    │                                 │            │
    │  When < 50%:                    │            │
    │  - 22% → WyvernX (stakers)      │            │
    │  - 73% → WyvernVault (compound) │            │
    │                                 │            │
    │  Always:                        │            │
    │  - 5% → TINC (TitanFarms)       │            │
    └─────────────────────────────────┘            │
                                                   │
                                                   ▼
                                    ┌─────────────────────────────────┐
                                    │    buyAndBurnWyvernX()          │
                                    │                                 │
                                    │  WETH → swap → TitanX → swap →  │
                                    │         WyvernX → BURN 🔥       │
                                    └─────────────────────────────────┘
```


---

# 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://lore.wyvernx.win/buy-and-burn.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.
