lockdrop-simulation/lockdrop-calculations-simulated.ipynb
Prathamesh Musale 652c69cbee Move lockdrop calculations to a module and add a experimentation notebook (#2)
- Refactor lockdrop calculations and other helper code from the simulation notebook to a python module
- Add a notebook for experimenting with lockdrop calculations
  - Add widget buttons to run calculations and export results
  - Add a script a to setup and run the notebook

Reviewed-on: #2
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2025-08-13 11:56:52 +00:00

134 lines
3.2 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "09975f67",
"metadata": {},
"source": [
"## Z Token Lockdrop Distribution (Simulation)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a98eb34e",
"metadata": {
"execution": {
"iopub.execute_input": "2025-08-13T05:36:31.722589Z",
"iopub.status.busy": "2025-08-13T05:36:31.722261Z",
"iopub.status.idle": "2025-08-13T05:36:32.153901Z",
"shell.execute_reply": "2025-08-13T05:36:32.153359Z"
}
},
"outputs": [],
"source": [
"# Import shared calculation module\n",
"from lockdrop import (\n",
" configure_matplotlib, print_constants_summary,\n",
" run_simulation_analysis, create_visualization\n",
")\n",
"\n",
"# Configure matplotlib\n",
"configure_matplotlib()"
]
},
{
"cell_type": "markdown",
"id": "5aedd1ba",
"metadata": {},
"source": [
"### Constants"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a7e0a069-488c-4138-8e8c-30f7ecdb3eb1",
"metadata": {
"execution": {
"iopub.execute_input": "2025-08-13T05:36:32.155516Z",
"iopub.status.busy": "2025-08-13T05:36:32.155355Z",
"iopub.status.idle": "2025-08-13T05:36:32.158528Z",
"shell.execute_reply": "2025-08-13T05:36:32.158289Z"
},
"scrolled": true
},
"outputs": [],
"source": [
"# Print constants summary using shared module\n",
"print_constants_summary()"
]
},
{
"cell_type": "markdown",
"id": "cba99011",
"metadata": {},
"source": [
"## Simulation"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "26573d6b",
"metadata": {
"execution": {
"iopub.execute_input": "2025-08-13T05:36:32.159961Z",
"iopub.status.busy": "2025-08-13T05:36:32.159857Z",
"iopub.status.idle": "2025-08-13T05:36:32.177205Z",
"shell.execute_reply": "2025-08-13T05:36:32.176753Z"
}
},
"outputs": [],
"source": [
"# Run complete simulation analysis using shared module\n",
"result = run_simulation_analysis()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a400cd54",
"metadata": {
"execution": {
"iopub.execute_input": "2025-08-13T05:36:32.178514Z",
"iopub.status.busy": "2025-08-13T05:36:32.178414Z",
"iopub.status.idle": "2025-08-13T05:36:32.481508Z",
"shell.execute_reply": "2025-08-13T05:36:32.481086Z"
}
},
"outputs": [],
"source": [
"# Create comprehensive visualization if analysis was successful\n",
"if result is not None:\n",
" allocation_data, final_data = result\n",
" print(\"\\n📊 Generating visualization...\")\n",
" create_visualization(allocation_data, final_data)\n",
"else:\n",
" print(\"⚠️ Skipping visualization due to failed analysis\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}