General post-processing function for plots
AngelaKTE opened this issue · 0 comments
AngelaKTE commented
Write a general function to transform dataframe zero to newdataframe for a specific plots.
Context:
When running the cadCAD we'll produce a dataframe ("dataframe zero") that will always have the same structure:
- per timestep (=rows)
columns: - a) token_a_balance...
- b) token_b_balance ...etc
- c) token_a_weight
- d) token_b_weight...etc
- e) token_a_denorm_weight
- f) token_b_denorm_weight...etc
- g) generated_fees
- h) pool_shares
- i) token_a_value
- j) token_b_value...etc
After this step we'll create various plots, like comparing total TVL with liquidity (total number of tokens in the pool).
So the general procedure is:
take dataframe zero and create a newdataframe (e.g. named "c191) for simulation C1.9.1 in the notebook based on it:
- compute TVL: take token_a_value+token_b_value...etc; and create a new column (TVL) to add TVL for every timestep(row)
- compute liquidity: take token_a_balance+token_b_balance...etc; and create a new column(liq) to add liquidity for every timestep
and then plot a chart using newdataframe values: