Open tieubao opened 1 month ago
import numpy as np
import matplotlib.pyplot as plt
# Time period for analysis (in years or arbitrary units)
time = np.arange(0, 20, 0.1)
# 1. Fixed Supply with Halving (Bitcoin-style)
initial_supply_bitcoin = 50
halving_period = 4
emission_bitcoin = initial_supply_bitcoin / (2 ** (time // halving_period))
# 2. Exponential Decay Emission
initial_rate_exponential = 50
lambda_decay = 0.3
emission_exponential = initial_rate_exponential * np.exp(-lambda_decay * time)
# 3. Linear Decay Emission
initial_rate_linear = 50
alpha = 2 # Linear decrease per unit time
emission_linear = np.maximum(0, initial_rate_linear - alpha * time)
# 4. Fixed Supply with No Emission After Initial Distribution
emission_fixed = np.zeros_like(time)
# 5. Constant Emission (Flat Rate)
fixed_rate = 10
emission_flat = np.full_like(time, fixed_rate)
# 6. Bonding Curve (Price varies with supply, a simplified model)
A = 1
B = 0.5
supply_bonding = np.arange(1, len(time)+1) # assuming supply grows over time
price_bonding = A * np.power(supply_bonding, B)
# Plot the results
fig, ax = plt.subplots(3, 2, figsize=(12, 10))
# 1. Fixed Supply with Halving
ax[0, 0].plot(time, emission_bitcoin, label="Bitcoin-style Halving")
ax[0, 0].set_title("Fixed Supply with Halving")
ax[0, 0].set_xlabel("Time")
ax[0, 0].set_ylabel("Emission")
# 2. Exponential Decay Emission
ax[0, 1].plot(time, emission_exponential, label="Exponential Decay", color='orange')
ax[0, 1].set_title("Exponential Decay Emission")
ax[0, 1].set_xlabel("Time")
ax[0, 1].set_ylabel("Emission")
# 3. Linear Decay Emission
ax[1, 0].plot(time, emission_linear, label="Linear Decay", color='green')
ax[1, 0].set_title("Linear Decay Emission")
ax[1, 0].set_xlabel("Time")
ax[1, 0].set_ylabel("Emission")
# 4. Fixed Supply with No Emission After Initial Distribution
ax[1, 1].plot(time, emission_fixed, label="No Emission After Distribution", color='red')
ax[1, 1].set_title("Fixed Supply (No Emission After Initial)")
ax[1, 1].set_xlabel("Time")
ax[1, 1].set_ylabel("Emission")
# 5. Constant Emission (Flat Rate)
ax[2, 0].plot(time, emission_flat, label="Flat Emission", color='purple')
ax[2, 0].set_title("Constant Emission (Flat Rate)")
ax[2, 0].set_xlabel("Time")
ax[2, 0].set_ylabel("Emission")
# 6. Bonding Curve Emission
ax[2, 1].plot(time, price_bonding, label="Bonding Curve", color='brown')
ax[2, 1].set_title("Bonding Curve (Supply-Price Relationship)")
ax[2, 1].set_xlabel("Time")
ax[2, 1].set_ylabel("Price")
# Adjust layout
plt.tight_layout()
# Show the plots
plt.show()
$$ \text{Emission} = \frac{\text{Initial Supply}}{2^{\text{Halving Period}}} $$
$$ \text{Emission}(t) = \text{Initial Rate} \times e^{-\lambda t} $$
Where:
This model gradually reduces the emission rate over time. It's typically used to ensure that the supply growth decreases as the network matures.
$$ \text{Emission}(t) = \text{Initial Rate} - \alpha t $$
Where:
The emission decreases at a constant rate until it reaches a minimum or predetermined supply.
$$ \text{Emission} = 0 $$
In this case, the entire token supply is pre-mined or distributed at launch, and there are no further emissions.
$$ \text{Emission} = \text{Fixed Rate} $$
A fixed number of tokens are emitted per block or time interval. This is typically seen in inflationary models where the supply grows indefinitely at a constant rate.
$$ \text{Price} = \text{A} \times \text{Supply}^B $$
Where:
Bonding curves are used in some protocols to dynamically adjust token prices based on demand and supply, effectively managing token emission.
Some protocols like DeFi projects use liquidity mining programs with complex reward structures that combine different elements:
Common token emission models are based on a few key factors, such as time, initial supply, emission rate, and decay over time.