Simulator
the purpose of 0max1 simulator is to give the most optimized configurations for 0max1 monitor. This recommended configurations is based on historic backtest simulation results.
Steps:
1. Start
2. Read Data
Raw history funding rates data ('df'): fatched by Monitor.
Simulation Configurations Data ('simulations_df'): contains multiple simulations with varying configurations in each simulation.
4. Define Functions
'token_score_func(symbol, simulations_id, model_num)':
It is used to calculate the scores for every token within each simulation.
'simulation_apr_func(Tokens_names, simulations_id, model_num)':
It is used to calculate the APR for each simulation based on the top tokens that are selected by their scores.
5. Model Generation Process
- The model initially selects a 'simulations_id' from 'simulations_df'
- Generates the simulation 10 times over 30 days, utilizing 90 data points at a frequency of every 3 days (yielding 9 data points each)
- Calculates scores for every 40 tokens within each generation by using the function 'token_score_func(symbol, simulations_id, model_num)'
- Selectes the top tokens ('Token_names') based on their scores ('top3_score')
- Calculates the realized APR of the simulation ('cal_apr') by using the function 'simulation_apr_func(Token_names, simulations_id, model_num)'
- Stores all 10 generations realized APRs for this single simulation in 'simulation_total_apr'
- Computes the average APR and stores in 'simulation_avg_apr'
- Repeat the process for every simulation and the results are stored in 'sorted_simulation_avg_apr'
- The whole model generation process will repeat every 30 days (90 data points)
6. Collect and Prepare Final Data
Compile all processed and optimized realized APR into a final DataFrame 'max_realized_apr'
Format and sort each simulation's realized APR score and merge it with Simulation Configurations Data 'simulations_df'
7. Output Results
Display the final DataFrame 'final_output'
Last updated