Skip to content

Commit

Permalink
Merge branch 'main' into bjoernek-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernek authored Sep 11, 2023
2 parents 852490f + 0d339e9 commit afb197f
Show file tree
Hide file tree
Showing 6 changed files with 910 additions and 0 deletions.
1 change: 1 addition & 0 deletions sns_tokenomics_analyzer/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
33 changes: 33 additions & 0 deletions sns_tokenomics_analyzer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SNS Tokenomics Analyzer

## Purpose

- **What It Is**: A tool designed to simplify the setup and analysis of tokenomics for Service Nervous Systems (SNS) on the Internet Computer (IC).
- **Key Features**:
- Parses SNS launch parameters given by SNS init file.
- Offers simulation and visualization features
- **Who It's For**: This tool is primarily aimed at SNS project teams and community members who are reviewing NNS proposals for SNS launches.

## Disclaimer

This tool is an initial beta version of the SNS Tokenomics Analyzer. Feedback regarding potential limitations and bugs is highly appreciated.

## Version
Version 0.9.

## Installation

- Copy all files from this repo directory to a local directory, in particular
- `sns_tokenomics_analyzer.py`, which contains the code for the tool.
- `sns_init.yaml` which is an example input file.
- Python installation is required.
- Additional Python libraries are also required and are listed at the beginning of the `sns_tokenomics_analyzer.py` file. In order to install these you have the following options
- **Manual Installation**: Manually install the required Python libraries listed in the `sns_tokenomics_analyzer.py` file.
- **Nix Installation**: Alternatively, install Nix and run `nix develop` in the directory where you plan to execute the code.


## Running the Tool

1. Adjust or replace the input `sns_init.yaml` in current directory.
2. Execute `python ./sns_tokenomics_analyzer.py` in your terminal.
2. Open `http://127.0.0.1:8051/` in your local web browser to use the tool.
60 changes: 60 additions & 0 deletions sns_tokenomics_analyzer/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions sns_tokenomics_analyzer/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
description = "SNS Init Analyzer";

inputs = {
nixpkgs.url = "nixpkgs/release-23.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ] (system:
let
pkgs = import nixpkgs { inherit system; };

pythonEnv = pkgs.python3.withPackages (ps: [
ps.pandas
ps.pyyaml
ps.dash
ps.setuptools
ps.plotly
ps.numpy
]);
in
{
devShells.default = pkgs.mkShell {
packages = [ pythonEnv ];
};
}
);
}
Loading

0 comments on commit afb197f

Please sign in to comment.