<template>
  <div>
    <h1>Staking</h1>
    <p>
      Staking means you're betting the price goes up. You lock your KRK and choose a tax rate — think of it as your conviction level.
      Higher conviction means it's harder for someone to take your position, but it costs more to maintain. If the price rises,
      your staked share applies to the expanded supply — that's your leverage.
    </p>
    <p>Below are the technical details of how this works.</p>
    <hr />
    <p>Staking has two important benefits:</p>
    <p>1. It helps the AI Agent with market sentiment analysis.</p>
    <p>
      2. It allows token holders to take a <strong>leveraged position</strong> on $KRK's market performance without backdoor deals or insider
      allocation.
    </p>
    <h2>1. Staking Slots</h2>
    <p>
      As a token holder you can stake your $KRK tokens to claim staking slots and become a Staker of the KrAIken Protocol. Staking creates
      a <strong>leveraged position</strong> on $KRK's price movement. When the token supply expands, your staked percentage applies to the new total supply,
      amplifying your exposure to market price changes (see Tokenomics).
    </p>
    <p>
      In exchange for that benefit stakers have to pay a self-assessed tax. At any time, another token holder who agrees to pay a higher tax
      can buyout lower-tax staking slots. This creates a fair and dynamic market for staking slots.
    </p>

    <ul>
      <li>
        <strong>Owner Slots:</strong> How many slots you can claim depends on the percentage of tokens you own compared to the total supply.
        Staking 0.001% of $KRK total supply gives 1 owner slot.
      </li>
      <li>
        <strong>Dynamic Value:</strong> As new tokens are minted (see supply expansion in Tokenomics), your claim automatically applies to
        the new total supply
      </li>
      <li><strong>Limited Capacity:</strong> There are only 20,000 staking slots that represent 20% of all $KRK at any time.</li>
    </ul>
    <p class="warning">
      Example: Alice stakes 10,000 $KRK. The current total supply sits at 1M. As she holds 1% of the current total supply she gets 1,000
      owner slots. When the supply increases to 2M, the 1% (1,000 slots) are worth now 20,000 $KRK after expansion.
    </p>
  </div>

  <br />
  <pre>
                   *** ### ### ***                   
              *##       ++        ##*              
          *##           ++            ##*          
       *##              ++               ##*       
      *#                ++                ##*      
    *##                 ++     20%          ##*    
   *##                  ++   Staking     +++ ##*   
  *##                   ++             +++    ##*  
 *##                    ++           ++       ##*  
 *##                    ++        ++++         ##* 
 *##                    ++     ++++            ##* 
*##                     ++  ++++                ##*
*##                     +++++                   ##*
*##                                             ##*
 *##                                           ##* 
 *##         80% Open Market                   ##* 
 *##                                           ##* 
  *##                                         ##*  
   *##                                       ##*   
    *##                                     ##*    
     *##                                   ##*     
       *#                                ##*       
          *##                         ##*          
              *##                 ##*              
                  *** ### ### ***                  
</pre
  >
  <div class="concept-block">
    <h2>2. Harberger Tax Mechanism</h2>
    <p>
      To keep things fair and transparent, stakers need to pay a self-assessed tax on their position. Inspired by the
      <a href="https://en.wikipedia.org/wiki/Harberger_tax" target="_blank">Harberger tax concept</a> but adapted for crypto:
    </p>

    <ul>
      <li><strong>Traditional Model:</strong> Owners self-assess property value and pay tax accordingly</li>
      <li>
        <strong>KrAIken Adaptation:</strong> Stakers choose tax <em>rates</em> instead of values, creating a competitive market for
        positions
      </li>
    </ul>

    <p>This system achieves three key goals:</p>
    <ol>
      <li><strong>Market Efficiency:</strong> Positions flow to those willing to pay highest maintenance costs (tax)</li>
      <li>
        <strong>Anti-Squating:</strong> Staking positions can get replaced anytime someone is willing to pay a higher tax, preventing
        permanent control
      </li>
      <li><strong>Protocol Funding:</strong> Collected taxes finance ongoing development</li>
    </ol>
  </div>

  <div class="concept-block">
    <h2>3. Leveraged Market Exposure</h2>
    <p>Staking creates a leveraged position on $KRK's market price through supply expansion mechanics:</p>

    <h3>A. Supply Expansion Amplification</h3>
    <p>When the protocol's AI liquidity manager mints new tokens to maintain exchange liquidity and respond to market demand,
    your staked percentage automatically applies to the new larger supply.</p>

    <p>
      <strong>Key insight:</strong> Your returns depend entirely on $KRK's market price movement. If the price rises, your percentage of the expanded
      supply becomes worth more. If the price falls, the additional tokens don't help. Regular holders track price 1:1 - stakers get amplified
      exposure to price movements, both up <em>and</em> down.
    </p>

    <h3>B. Tax as Leverage Cost</h3>
    <p>The tax rate you choose determines both your position security and your net returns:</p>
    <ul>
      <li><strong>Higher tax (15-50% yearly):</strong> Harder to snatch, but tax significantly reduces your returns</li>
      <li><strong>Lower tax (5-10% yearly):</strong> Maximizes returns when price appreciates, but easier to lose position</li>
      <li>Think of tax as the "cost of leverage" - it directly reduces your gains from market appreciation</li>
    </ul>
  </div>

  <div class="concept-block">
    <h2>4. Position Security</h2>
    <p>While others can buyout your position at any time, crucial protections exist:</p>

    <ul>
      <li><strong>Full Principal Return:</strong> If replaced, you receive all untaxed $KRK and potential profit immediately</li>
      <li><strong>Three-Day Grace Period:</strong> New positions must pay minimum 3 days' tax upfront</li>
      <li><strong>Rate Transparency:</strong> All positions display current tax rates for informed decisions</li>
    </ul>

    <p class="warning">
      Key Insight: Losing a position due to a buyout means losing <em>future</em> leveraged exposure from that stake. You get your tokens back,
      but lose the amplified market position.
    </p>
  </div>

  <div class="concept-block">
    <h2>5. Strategic Considerations</h2>
    <p>Successful staking requires balancing:</p>

    <ul>
      <li><strong>Tax Rate Selection:</strong> Higher rates protect positions but eat into your gains from market appreciation</li>
      <li><strong>Market Monitoring:</strong> Track competing stakers' tax rates</li>
      <li><strong>Price Forecasts:</strong> Your returns depend entirely on $KRK market price movement, not protocol rewards</li>
    </ul>

    <h3>Choosing Your Tax Rate</h3>
    <p>
      Your tax rate choice is critical because staking creates a <strong>leveraged position</strong> on $KRK's market performance. 
      Your returns depend on:
    </p>
    <ul>
      <li><strong>Market Price Movement:</strong> This is the ONLY source of returns - price up = you profit, price down = you lose</li>
      <li><strong>Tax Rate Impact:</strong> The yearly tax rate directly reduces whatever gains (or losses) the market delivers</li>
      <li><strong>Position Security vs. Upside:</strong> The fundamental trade-off you must manage</li>
    </ul>

    <p class="warning">
      <strong>The Tax Rate Trade-off:</strong><br />
      • <strong>Higher Tax (15-50% yearly):</strong> Your position is much harder to snatch, giving you longer-term 
      leveraged exposure to price movements. However, the tax significantly eats into your gains from market appreciation - if $KRK goes up 30% but you pay 20% tax, your net gain is reduced.<br />
      • <strong>Lower Tax (5-10% yearly):</strong> Maximizes your upside when $KRK price appreciates, as less of your position value goes to 
      tax payments. However, anyone willing to pay a higher tax can take your position at any time, forcing you to re-stake.<br />
      • <strong>For Beginners:</strong> Start with 10-15% to get comfortable with the mechanics while maintaining reasonable security.
    </p>

    <p>
      Think of staking as a <em>leveraged bet</em> on $KRK's price. The tax rate is your "leverage cost" – lower rates mean more 
      upside when price rises, but less position stability. Monitor the floor tax (minimum tax currently being paid) to stay competitive.
    </p>

    <p>Example Strategy: Use medium tax rates (10-15% yearly) during bullish market conditions to balance protection and upside</p>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';

interface StakingDocsEmits {
  (event: 'onmounted'): void;
}

const emit = defineEmits<StakingDocsEmits>();

onMounted(() => {
  emit('onmounted');
});
</script>
