Skip to content

Commit

Permalink
fix: cumulative vesting plot
Browse files Browse the repository at this point in the history
  • Loading branch information
achimstruve committed Oct 19, 2023
1 parent 87ac1c1 commit 2f01da3
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 8 deletions.
8 changes: 8 additions & 0 deletions UserInterface/Inputs 🧮.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,18 @@
st.markdown("Use the default input file or upload your own based on the")
st.markdown("[Spreadsheet QTM](https://drive.google.com/drive/folders/1eSgm4NA1Izx9qhXd6sdveUKF5VFHY6py?usp=sharing) ➡️ navigate to radCAD_inputs tab ➡️ save it as .csv and then upload it here ⬇️")
uploaded_file = st.file_uploader("Choose a file")
if uploaded_file is not None:
st.success('File uploaded successfully ✅')
if 'param_id' in st.session_state:
if st.session_state['param_id'] != "":
st.warning(f"Delete the Parameter ID to apply the new input file parameters.", icon="⚠️")

st.markdown("### Basic Token Information")

if uploaded_file is not None:
# reset the parameter id
st.session_state['param_id'] = ""

# Get the file name and construct the full path
input_file_name = uploaded_file.name
input_file_path = os.path.join(input_file_base_path, input_file_name)
Expand Down
21 changes: 20 additions & 1 deletion UserInterface/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def model_ui_inputs(input_file_path, uploaded_file, parameter_list):
equity_investments = 0.0
equity_perc = 0.0



st.markdown("### Fundraising")
col21, col22, col23 = st.columns(3)
with col21:
Expand Down Expand Up @@ -94,6 +96,8 @@ def model_ui_inputs(input_file_path, uploaded_file, parameter_list):
if fundraising_style == 'Custom' or show_full_fund_table:
st.write("Total Raised: "+str(raised_funds)+" $m")



st.markdown("### Token Allocations & Vesting")
col31, col32 = st.columns(2)
with col31:
Expand Down Expand Up @@ -477,7 +481,7 @@ def model_ui_inputs(input_file_path, uploaded_file, parameter_list):
airdrop_date3 = st.date_input("Airdrop Date 3", min_value=datetime.strptime(sys_param['launch_date'][0], "%d.%m.%y"), value=datetime.strptime(sys_param['airdrop_date3'][0], "%d.%m.%y"), help="The date of the third airdrop.")
airdrop_amount3 = st.number_input("Amount 3 / %", min_value=0.0, value=sys_param['airdrop_amount3'][0], help="The share of tokens distributed from the airdrop allocation in the third airdrop.")

if show_full_alloc_table:
if show_full_alloc_table or vesting_style == 'Custom':
col51, col52, col53 = st.columns(3)
with col51:
st.text_input("DEX LP","DEX Liquidity Pool", label_visibility="hidden", disabled=True, key="lp_name")
Expand All @@ -486,6 +490,21 @@ def model_ui_inputs(input_file_path, uploaded_file, parameter_list):
with col53:
st.number_input('DEX Capital / $m', max_value=raised_funds,value=float((lp_allocation/100 )* initial_supply * launch_valuation*1e6 / initial_supply/1e6), disabled=True, key="liquidity_capital_requirements", help="The required capital to seed the liquidity: lp_allocation x total_initial_supply / 100 % * token_launch_price.")


st.markdown("### User Adoption")
adoption_style = st.radio('Adoption Style',('Slow', 'Medium', 'Fast','Custom'), index=0, help='The adoption style determines the scaling velocity for the product revenue and token demand. Moreover it influences the average agent sentiment in terms of selling and utility adoption behavior.')
if adoption_style != 'Custom':
show_full_adoption_table = st.toggle('Show Full Table', value=False, help="Show the full adoption tables")
else:
show_full_adoption_table = False
col61, col62, col63 = st.columns(3)
with col61:
pass
with col62:
pass
with col63:
pass

# Map new parameters to model input parameters
new_params = {
'equity_external_shareholders_perc': equity_perc,
Expand Down
20 changes: 13 additions & 7 deletions UserInterface/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ def plot_results_plotly(x, y_columns, run, param_id, x_title=None, y_title=None,
# example for line plots of different outputs in one figure
line_plot_plotly(df,x, y_columns, run, x_title=x_title, y_title=y_title, info_box=info_box, plot_title=plot_title)

def area_plot_results_plotly(x, y_columns, run, param_id, x_title=None, y_title=None, info_box=None, plot_title=None):
def vesting_cum_plot_results_plotly(x, y_columns, run, param_id, x_title=None, y_title=None, info_box=None, plot_title=None):

df = get_simulation_data('simulationData.db', 'simulation_data_'+param_id)

# example for Monte Carlo plots
#monte_carlo_plot_st(df,'timestep','timestep','seed_a_tokens_vested_cum',3)

# example for line plots of different outputs in one figure
area_plot_plotly(df,x, y_columns, run, x_title=x_title, y_title=y_title, info_box=info_box, plot_title=plot_title)
vesting_cum_plot_plotly(df,x, y_columns, run, param_id, x_title=x_title, y_title=y_title, info_box=info_box, plot_title=plot_title)



Expand Down Expand Up @@ -201,9 +201,9 @@ def line_plot_plotly(df,x,y_series,run, x_title=None, y_title=None, info_box=Non

st.plotly_chart(fig, use_container_width=True)

def area_plot_plotly(df,x,y_series,run, x_title=None, y_title=None, info_box=None, plot_title=None):
def vesting_cum_plot_plotly(df,x,y_series,run, param_id, x_title=None, y_title=None, info_box=None, plot_title=None):
'''
A function that generates a area plot from a series of data series in a frame in streamlit
A function that generates a area plot from vesting series of data series in a frame in streamlit
'''

chart_data = pd.DataFrame(np.asarray(df[df['run'].astype(int)==run][[x]+y_series], float), columns=[x]+y_series)
Expand All @@ -212,7 +212,13 @@ def area_plot_plotly(df,x,y_series,run, x_title=None, y_title=None, info_box=Non
formatted_columns = [format_column_name(col) for col in [x] + y_series]
chart_data.columns = formatted_columns

fig = px.area(chart_data, x=formatted_columns[0], y=formatted_columns[1:])
sys_param_df = get_simulation_data('simulationData.db', 'sys_param')
init_lp_token_alloc = sys_param_df[sys_param_df['id'] == param_id]['initial_lp_token_allocation']

chart_data['Liquidity Pool'] = init_lp_token_alloc.to_list()*len(chart_data)
chart_data['Liquidity Pool'] = chart_data['Liquidity Pool'].astype(float)

fig = px.area(chart_data, x=formatted_columns[0], y=formatted_columns[1:]+['Liquidity Pool'])

customize_plotly_figure(fig, x_title, y_title, info_box, plot_title)

Expand Down Expand Up @@ -263,10 +269,10 @@ def pie_plot_plotly(values_list, param_id, x_title=None, y_title=None, info_box=

def plot_fundraising(param_id):
##FUNDRAISING TAB
area_plot_results_plotly('timestep', ['angle_a_tokens_vested_cum', 'seed_a_tokens_vested_cum','presale_1_a_tokens_vested_cum','presale_2_a_tokens_vested_cum','public_sale_a_tokens_vested_cum'
vesting_cum_plot_results_plotly('timestep', ['angle_a_tokens_vested_cum', 'seed_a_tokens_vested_cum','presale_1_a_tokens_vested_cum','presale_2_a_tokens_vested_cum','public_sale_a_tokens_vested_cum'
,'team_a_tokens_vested_cum', 'advisor_a_tokens_vested_cum', 'strategic_partners_a_tokens_vested_cum'
,'reserve_a_tokens_vested_cum', 'community_a_tokens_vested_cum', 'foundation_a_tokens_vested_cum', 'incentivisation_a_tokens_vested_cum'
,'staking_vesting_a_tokens_vested_cum'], 1, param_id
,'staking_vesting_a_tokens_vested_cum', 'te_airdrop_tokens_cum'], 1, param_id
, plot_title="Cumulative Token Vesting", x_title="Months", y_title="Tokens")
##EFFECTIVE TOKEN PRICE
bar_plot_plotly([
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
Parameter,Parameter Name,Initial Value,Min,Max,Interval Steps,Unit,Comment
Supply Type,supply_type,Fixed,,,,,
Initial Total Supply of Tokens,initial_total_supply,"100,000,000",,,,,
Launch Date / dd.mm.yyyy,launch_date,1.1.24,,,,,
% Public Sale of Supply (up to),public_sale_supply_perc,3.50%,,,,,
Public Sale Valuation / $,public_sale_valuation,"40,000,000",,,,,
Equity Owned by External Shareholders,equity_external_shareholders_perc,0.00%,,,,,
Early Backers / Angels Raised,angle_raised,0,,,,,
Seed Raised,seed_raised,"750,000",,,,,
Pre-Sale 1 Raised,presale_1_raised,"1,200,000",,,,,
Pre-Sale 2 Raised,presale_2_raised,"1,500,000",,,,,
Public Sale Raised,public_sale_raised,"1,800,000",,,,,
Sum of Raised Capital / $ Raised,raised_capital_sum,"5,250,000",,,,,
Early Backers / Angels Valuation,angle_valuation,,,,,,
Seed Valuation,seed_valuation,"15,000,000",,,,,
Pre-Sale 1 Valuation,presale_1_valuation,"25,000,000",,,,,
Pre-Sale 2 Valuation,presale_2_valuation,"50,000,000",,,,,
Early Backers / Angels Bonus Amount / %,angle_bonus,100.00%,,,,,
Seed Bonus Amount / %,seed_bonus,50.00%,,,,,
Pre-Sale 1 Bonus Amount / %,presale_1_bonus,25.00%,,,,,
Pre-Sale 2 Bonus Amount / %,presale_2_bonus,15.00%,,,,,
Founders / Team Token Allocation,team_allocation,25.00%,,,,,
Outlier Ventures Token Allocation,ov_allocation,6.00%,,,,,
Advisors Token Allocation,advisor_allocation,4.00%,,,,,
Strategic Partners Token Allocation,strategic_partners_allocation,0.00%,,,,,
Reserve Token Allocation,reserve_allocation,10.00%,,,,,
Community Token Allocation,community_allocation,0.00%,,,,,
Foundation Token Allocation,foundation_allocation,0.00%,,,,,
Incentivisation Token Allocation,incentivisation_allocation,15.00%,,,,,
Staking Vesting Token Allocation,staking_vesting_allocation,18.00%,,,,,
Liquidity Pool Token Allocation,liquidity_pool_allocation,2.39%,,,,,
Airdrop Allocation,airdrop_allocation,2.00%,,,,,
Airdrop Date 1,airdrop_date1,1.1.24,,,,,
Aidrop Amount 1,airdrop_amount1,35.00%,,,,,
Airdrop Date 2,airdrop_date2,1.5.24,,,,,
Aidrop Amount 2,airdrop_amount2,35.00%,,,,,
Airdrop Date 3,airdrop_date3,1.4.25,,,,,
Aidrop Amount 3,airdrop_amount3,30.00%,,,,,
Early Backers / Angels Initial Vesting,angle_initial_vesting,0,,,,,
Seed Initial Vesting,seed_initial_vesting,0,,,,,
Pre-Sale 1 Initial Vesting,presale_1_initial_vesting,0,,,,,
Pre-Sale 2 Initial Vesting,presale_2_initial_vesting,0,,,,,
Public Sale Initial Vesting,public_sale_initial_vesting,25,,,,,
Founders / Team Initial Vesting,team_initial_vesting,0,,,,,
Outlier Ventures Initial Vesting,ov_initial_vesting,0,,,,,
Advisors Initial Vesting,advisor_initial_vesting,0,,,,,
Strategic Partners Initial Vesting,strategic_partners_initial_vesting,100,,,,,
Reserve Initial Vesting,reserve_initial_vesting,100,,,,,
Community Initial Vesting,community_initial_vesting,0,,,,,
Foundation Initial Vesting,foundation_initial_vesting,0,,,,,
Incentivisation Initial Vesting,incentivisation_initial_vesting,0.5,,,,,
Staking Vesting Initial Vesting,staking_vesting_initial_vesting,5,,,,,
Liquidity Pool Initial Vesting,liquidity_pool_initial_vesting,100,,,,,
Early Backers / Angels Cliff Months,angle_cliff,8,,,,,
Seed Cliff Months,seed_cliff,9,,,,,
Pre-Sale 1 Cliff Months,presale_1_cliff,11,,,,,
Pre-Sale 2 Cliff Months,presale_2_cliff,1,,,,,
Public Sale Cliff Months,public_sale_cliff,0,,,,,
Founders / Team Cliff Months,team_cliff,13,,,,,
Outlier Ventures Cliff Months,ov_cliff,15,,,,,
Advisors Cliff Months,advisor_cliff,17,,,,,
Strategic Partners Cliff Months,strategic_partners_cliff,0,,,,,
Reserve Cliff Months,reserve_cliff,0,,,,,
Community Cliff Months,community_cliff,0,,,,,
Foundation Cliff Months,foundation_cliff,0,,,,,
Incentivisation Cliff Months,incentivisation_cliff,0,,,,,
Staking Vesting Cliff Months,staking_vesting_cliff,0,,,,,
Early Backers / Angels Vesting Duration Months,angle_vesting_duration,24,,,,,
Seed Vesting Duration Months,seed_vesting_duration,24,,,,,
Pre-Sale 1 Vesting Duration Months,presale_1_vesting_duration,18,,,,,
Pre-Sale 2 Vesting Duration Months,presale_2_vesting_duration,9,,,,,
Public Sale Vesting Duration Months,public_sale_vesting_duration,4,,,,,
Founders / Team Vesting Duration Months,team_vesting_duration,36,,,,,
Outlier Ventures Vesting Duration Months,ov_vesting_duration,24,,,,,
Advisors Vesting Duration Months,advisor_vesting_duration,24,,,,,
Strategic Partners Vesting Duration Months,strategic_partner_vesting_duration,0,,,,,
Reserve Vesting Duration Months,reserve_vesting_duration,0,,,,,
Community Vesting Duration Months,community_vesting_duration,0,,,,,
Foundation Vesting Duration Months,foundation_vesting_duration,0,,,,,
Incentivisation Vesting Duration Months,incentivisation_vesting_duration,84,,,,,
Staking Vesting Vesting Duration Months,staking_vesting_vesting_duration,48,,,,,
Initial Product Users,initial_product_users,250,,,,,
Product Users after 10 years,product_users_after_10y,50000,,,,,
Product Adoption Velocity (curve shape),product_adoption_velocity,1,,,,,
One-Time Product Revenue per User / $,one_time_product_revenue_per_user,25,,,,,
Regular Product Revenue per User per Month / $,regular_product_revenue_per_user,10,,,,,
Initial Token Holders,initial_token_holders,250,,,,,
Token Holders after 10 years,token_holders_after_10y,10000,,,,,
Token Adoption Velocity (curve shape),token_adoption_velocity,1,,,,,
One-Time Token Buy per User / $,one_time_token_buy_per_user,100,,,,,
Regular Token Buy per User per Month / $,regular_token_buy_per_user,20,,,,,
Avg. Token Utility Allocation / %,avg_token_utility_allocation,90,,,,,
Avg. Token Holding / %,avg_token_holding_allocation,5,,,,,
Avg. Token Selling / %,avg_token_selling_allocation,5,,,,,
Avg. Token Utility Removal / %,avg_token_utility_removal,3,,,,,
Product Income per Month / $,product_income_per_month,"332,695",,,,,
Royalty Income per Month / $,royalty_income_per_month,"2,500",,,,,
Other Income per Month / $,other_income_per_month,"1,000",,,,,
Treasury Income per Month / $,treasury_income_per_month,500,,,,,
Regular Income Sum per Month / $,regular_income_sum,"336,695",,,,,
One-Time Payments after Pre-Sales / $,one_time_payments_1,"150,000",,,,,
Planned One-Time Investments after Launch / $,one_time_payments_2,"350,000",,,,,
Salaries per Month / $,salaries_per_month,"50,000",,,,,
License Costs per Month / $,license_costs_per_month,350,,,,,
Other Monthly Costs / $,other_monthly_costs,500,,,,,
Buyback fixed/percentage of cash reserve,buyback_type,Percentage,,,,,
Token Buybacks per Month / % of cash reserves,buyback_perc_per_month,5.00,,,,,
Token Buybacks per Month / $,buyback_fixed_per_month,"80,000",,,,$,
Buyback bucket,buyback_bucket,Reserve,,,,,
Buyback start date,buyback_start,1.7.24,,,,,
Buyback end date,buyback_end,1.7.28,,,,,
Burn token supply as percentage of init. total supply / month,burn_per_month,0.02,,,,,
Burn project bucket tokens start date,burn_start,1.1.24,,,,,
Burn project bucket tokens end date,burn_end,1.1.30,,,,,
Burn from project bucket,burn_project_bucket,Reserve,,,,,
Regular Expenditures Sum per Month / $,regular_expenditures_per_month,"176,329",,,,,
Cash Reserve after Launch / $,cash_reserves_after_launch,"3,748,150",,,,,
Monthly Income vs. Expenditures Balance / $,cashflow_balance,"160,366",,,,,
Staking Base APR Utility Share / %,lock_share,0,,,,,
Staking Buyback & Distribute Utility Share / %,lock_buyback_distribute_share,0,,,,,
Staking Vesting Based Rewards Utility Share / %,lock_vesting_share,70,,,,,
Liquidity Mining Utility Share / %,liquidity_mining_share,0,,,,,
Burning Utility Share / %,burning_share,0,,,,,
Holding Utility Share / %,holding_share,0,,,,,
Transfer for Benefit Utility Share / %,transfer_share,30,,,,,
Locking APR/%,lock_APR,4.0,,,,,
Locking Payout Source,lock_payout_source,Reserve,,,,,
Locking Revenue Buyback Share,lock_buyback_from_revenue_share,10.0,,,,,
Liquidity Mining APR/%,liquidity_mining_APR,8.0,,,,,
Liquidity Mining Payout Source,liquidity_mining_payout_source,Reserve,,,,,
Token Holding APR/%,holding_APR,2.0,,,,,
Token Holding Reward Payout Source,holding_payout_source,Reserve,,,,,
Token Transfer Destination,transfer_destination,Reserve,,,,,
Incentivise Through Minting,mint_incentivisation,0.0,,,,,
Incentivisation Payout Source,incentivisation_payout_source,Incentivisation,,,,,
Use Off-Chain Point System,off_chain_point_system_flag,No,,,,,
Avg. point issuance per user / day,avg_point_issuance_per_user,5.0,,,,,
Avg. point issuance per user / month,avg_point_issuance_per_user_per_month,150.0,,,,,
Allow Conversion from Points to Token,allow_point_conversion,No,,,,,
Conversion Rate Token per Point,point_to_token_conversion_rate,0.10,,,,,
Multiplier points per token staked,multiplier_points_per_token_staked,0.000500,,,,,
Multiplier Cap,multiplier_cap,5.0,,,,,
Bucket to use for the conversion to token,conversion_bucket,Reserve,,,,,
cadCAD specific parameters,none,-,,,,,
implied FDV MC multiple after 3 years,implied_fdv_after_3y,2,,,,-,Prescribed multiple of the public sale token valuation after 3 years assuming a linear valuation change
speculation factor,speculation_factor,0.5,,,,-,0 = pure value investing according to the implied FDV MC; 1 = pure speculation including random noise
AAV exponent,aav_exponent,4,,,,-,Exponent that determines the influence of the AAV price divergence with respect to the supply rate change
max vesting rate,max_vesting_rate,0.005,,,,share of total supply / 100%,maximum allowed vesting rate for the AAV controller
min vesting rate,min_vesting_rate,0.0001,,,,share of total supply / 100%,minimum allowed vesting rate for the AAV controller
avg trading fund usage,avg_trading_fund_usage,0.1,,,,1 / 100%,avg. amount of available usd funds to be used by agent when speculating
avg token lock,avg_token_lock,0.3,,,,1 / 100%,avg. amount of available tokens to be used to lock if an agent decides to lock their tokens
avg token remove,avg_token_remove,0.5,,,,1 / 100%,avg. amount of available locked tokens to be removed/unlocked if the agent decides to unlock
avg token incentivisation,avg_token_incentivisation,0.02,,,,share of agents token balance / 100%,avg. amount of available tokens to be used to incentivise the ecosystem
token incentivisation exponent,token_incentivisation_exponent,2,,,,-,exponent on the avg token incentivisation percentage to amplify probability of agents locking their token when incentivised
team vesting weight,team_vesting_weight,0.1,,,,share of vested tokens / 100%,the priority with which the team gets their tokens vested through the AAV controller
foundation vesting weight,foundation_vesting_weight,0.6,,,,share of vested tokens / 100%,the priority with which the foundation gets their tokens vested through the AAV controller
investor vesting weight,investor_vesting_weight,0.3,,,,share of vested tokens / 100%,the priority with which the investors get their tokens vested through the AAV controller
agent behavior,agent_behavior,static,,,,,static = replica of the spreadsheet QTM; stochastic = actions based on probabilities; dynamic = actions based on optimization goals

0 comments on commit 2f01da3

Please sign in to comment.