git clone https://github.com/xujiahuayz/dao-governance.git
cd dao-governance
chmod +x setup_repo.sh
./setup_repo.sh
. venv/bin/activate
or follow the step-by-step instructions below between the two horizontal rules:
- MacOS / Linux
python3 -m venv venv
- Windows
python -m venv venv
- MacOS / Linux
. venv/bin/activate
- Windows (in Command Prompt, NOT Powershell)
venv\Scripts\activate.bat
pip install toml
pip install -e ".[dev]"
put your APIs in .env
:
COINGLASS_SECRET="abc123"
KAIKO_API_KEY="abc123"
TALLY_API_KEY="xxx"
SNAPSHOT_API_KEY="aaa"
OPENAI_API_KEY="sk-xxx"
HEADERS="{xxxxx}"
export $(cat .env | xargs)
python scripts/fetch_spaces.py
- Filter ENS links (with discussion link) from snapshot:
python scripts/ens_snapshot_filter.py
- For each post in the discussion forum URLs, find the author and their associated discussions:
python scripts/ens_authors.py
- Calculate the HHI for each url to evaluate the concentration of activity:
python scripts/ens_hhi.py
- Create two folders named "html_200" and "idf" under "data" folder, then fetch the http response of the discussion links
mkdir data/html_200
mkdir data/idf
python scripts/ens_fetch_html.py
- For each ENS link (with discussion link) from snapshot, filter out the html formatting code
python scripts/ens_process_html.py
- Check whether the discussion thread have at least one discussion
python scripts/ens_process_identify_html.py
- Calculate the sentiment of the discussion thread
python scripts/ens_process_sentiment.py
- Calculate the statistics of HHI and sentiments and put it in a .tex table
python scripts/ens_hhi_senti_stats.py
- Calculate the total number of votes; the number of voters when it reached 50% of the total voting power for each proposal; and the timestamp when it reached 50% of the total voting power for each proposal.
python scripts/ens_votes.py
- Put it in a csv table (together with HHI and sentiments for each proposal)
python scripts/ens_votes_HHI_senti.py