Created
October 13, 2021 14:04
-
-
Save hustlestar/cda521c7486e7effbe11d808ffebd660 to your computer and use it in GitHub Desktop.
Calculating allocation and estimated gain from Kucoin Burning Drop event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
full_allocation_size = 1400000 | |
allocated_asset_price_usdt = 0.2 | |
staking_period_days = 20 | |
max_stake_usdt = 3000 | |
max_stake_eth = 1 | |
max_stake_kcs = 270 | |
usdt_pool = 2500000 | |
usdt_pool_coef = 1 | |
eth_pool = 860 | |
eth_price_usdt = 3500 | |
eth_pool_usdt = eth_pool * eth_price_usdt | |
eth_pool_coef = 1.2 | |
kcs_pool = 305000 | |
kcs_price_usdt = 11.5 | |
kcs_pool_usdt = kcs_pool * kcs_price_usdt | |
kcs_pool_coef = 1.5 | |
full_pools_size_usdt = usdt_pool * usdt_pool_coef + eth_pool_usdt * eth_pool_coef + kcs_pool_usdt * kcs_pool_coef | |
print(f"FULL SIZE OF POOLS USDT WITH COEF {full_pools_size_usdt}") | |
usdt_allocation_part = (usdt_pool * usdt_pool_coef) / full_pools_size_usdt | |
usdt_stakers = usdt_pool / max_stake_usdt | |
print(f"USDT part of pool {usdt_allocation_part * 100} %, max stakers {usdt_stakers}") | |
eth_allocation_part = (eth_pool_usdt * eth_pool_coef) / full_pools_size_usdt | |
eth_stakers = eth_pool / max_stake_eth | |
print(f"ETH part of pool {eth_allocation_part * 100} %, max stakers {eth_stakers}") | |
kcs_allocation_part = (kcs_pool_usdt * kcs_pool_coef) / full_pools_size_usdt | |
kcs_stakers = kcs_pool / max_stake_kcs | |
print(f"KCS part of pool {kcs_allocation_part * 100} %, max stakers {kcs_stakers}") | |
allocation_table = [ | |
('USDT', max_stake_usdt, 1, usdt_pool_coef, usdt_stakers), | |
('ETH', max_stake_eth, eth_price_usdt, eth_pool_coef, eth_stakers), | |
('KCS', max_stake_kcs, kcs_price_usdt, kcs_pool_coef, kcs_stakers) | |
] | |
allocated_assets_total_price_usdt = full_allocation_size * allocated_asset_price_usdt | |
print(f"USDT value of Burning Drop assets {allocated_assets_total_price_usdt}") | |
print(f"For 100 USDT staked at least {allocated_assets_total_price_usdt / full_pools_size_usdt * 100}") | |
def estimate_allocation(pol_to_burn, symbol, amount_to_stake, price_usdt, coef, stakers): | |
staked_usdt = amount_to_stake * price_usdt | |
staked_usdt_with_coef = staked_usdt * coef | |
eps = pol_to_burn / staked_usdt_with_coef | |
acceleratin_coef = 0.18452 * math.atan(60 * eps - 2.08) + 0.207166085 | |
final_allocation = (acceleratin_coef + 1) * staked_usdt_with_coef | |
print("-" * 100) | |
print(f"Staked asset {symbol} - {amount_to_stake}") | |
print(f"Staked in asset USDT {amount_to_stake * price_usdt}") | |
print(f"Acceleration coef {acceleratin_coef} when {pol_to_burn} POL is burnt") | |
print(f"Final allocation is {final_allocation} when {pol_to_burn} POL is burnt") | |
usdt_gain = final_allocation * allocated_assets_total_price_usdt / full_pools_size_usdt | |
daily_apr = usdt_gain / (staking_period_days * staked_usdt) * 100 | |
print(f"Estimated gain USDT {usdt_gain}, APR for {staking_period_days} days is yearly {daily_apr * 365} %, daily {daily_apr} %") | |
print("-" * 100) | |
return final_allocation, stakers | |
estimated_allocations = [estimate_allocation(1, *row) for row in allocation_table] | |
result = sum([x * y for x, y in estimated_allocations]) | |
print(result / full_pools_size_usdt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment