This is a Dagster project for retrieving Moxie lifetime earnings data for all Fan Tokens, and uploading that dataset to Dune.
Demonstrates:
- how to query multiple pages* of Fan Token Auction data from the Airstack GraphQL API
- I limited the number of results to 100 to ensure that the paging function works, but Airstack supports going up to 200 items per page
- how to lookup associated Moxie Lifetime Earnings data in batches for efficiency
- produce a CSV file suitable for upload into Dune from the above data
- using the DuneClient to upload the CSV data as a table
See Moxie Fan Token Rate of Return for an example of how to use the uploaded data.
- Airstack API Studio
- Get a free plan for your API usage
- Moxie Protocol Subgraph API
- Fan Token Auction Subgraph API
- Fan Token Auction Clearing Price API
- Vesting API
-
Copy
.env-example
to.env
and populate your Airstack and Dune API keys -
Install your Dagster code location as a Python package. By using the --editable flag, pip will install your Python package in "editable mode" so that as you develop, local code changes will automatically apply.
pip install -e ".[dev]"
- Then, start the Dagster UI web server:
dagster dev
-
Open http://localhost:3000 with your browser to see the project.
-
Click "Materialize All" to run the pipeline
You can specify new Python dependencies in setup.py
.
Tests are in the moxie_dune_tests
directory and you can run tests using pytest
:
pytest moxie_dune_tests
If you want to enable Dagster Schedules or Sensors for your jobs, the Dagster Daemon process must be running. This is done automatically when you run dagster dev
.
Once your Dagster Daemon is running, you can start turning on schedules and sensors for your jobs.
The easiest way to deploy your Dagster project is to use Dagster Cloud.
Check out the Dagster Cloud Documentation to learn more.