Skip to content

Instantly share code, notes, and snippets.

@alex-drocks
Created September 3, 2024 17:26
Show Gist options
  • Save alex-drocks/588d9e6ab3908a4d839ed27eccca2f5e to your computer and use it in GitHub Desktop.
Save alex-drocks/588d9e6ab3908a4d839ed27eccca2f5e to your computer and use it in GitHub Desktop.
muv-apy
import matplotlib.pyplot as plt
# Constants
total_stake = 24958 # TAO
voted_stake = 22626 # TAO (including the whale)
total_daily_return = 4.97 # TAO tokens
validator_earnings_per_day = total_daily_return * 0.09 # 9% of total daily return
whale_stake = 10018 # TAO
new_voted_stake = voted_stake - whale_stake # Voted stake after excluding the whale
# Current Voter APY (including whale)
current_earnings_per_TAO = (total_daily_return * 0.91 / total_stake) + (validator_earnings_per_day / voted_stake)
current_APY = current_earnings_per_TAO * 100 * 365
# Voter APY excluding the big whale
new_earnings_per_TAO = (total_daily_return * 0.91 / total_stake) + (validator_earnings_per_day / new_voted_stake)
new_APY = new_earnings_per_TAO * 100 * 365
# Voter APY with 4 TAO per day injected, excluding the whale
extra_TAO_injected_per_day = 4.0 # TAO
extra_earnings_per_TAO_excluding_whale = (extra_TAO_injected_per_day / new_voted_stake)
boosted_earnings_per_TAO_excluding_whale = new_earnings_per_TAO + extra_earnings_per_TAO_excluding_whale
boosted_APY_excluding_whale = boosted_earnings_per_TAO_excluding_whale * 100 * 365
# Voter APY with 4 TAO per day injected, including the whale
extra_earnings_per_TAO_including_whale = (7 / voted_stake)
boosted_earnings_per_TAO_including_whale = current_earnings_per_TAO + extra_earnings_per_TAO_including_whale
boosted_APY_including_whale = boosted_earnings_per_TAO_including_whale * 100 * 365
# Prepare data for plotting
labels = [
'Current Voter APY',
'Voter APY Excluding BET',
'4T/day (exclude BET in rakeback)',
'7T/day (include BET in rakeback)',
]
APYs = [
current_APY,
new_APY,
boosted_APY_excluding_whale,
boosted_APY_including_whale
]
# Plotting
plt.figure(figsize=(12, 8))
colors = ['blue', 'orange', 'green', 'red']
plt.bar(labels, APYs, color=colors)
# Adding titles and labels
plt.title('Comparison of Voter APY Options')
plt.ylabel('APY (%)')
# Display exact values on the bars
for i, apy in enumerate(APYs):
plt.text(i, apy + 0.1, f'{apy:.2f}%', ha='center', va='bottom')
# Show the plot
plt.tight_layout()
plt.savefig("apy.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment