Skip to content

ryanjshaw/moxie-dune-ft-earnings-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Moxie Fan Token Earnings Offchain -> Dune Data Pipeline

This is a Dagster project for retrieving Moxie lifetime earnings data for all Fan Tokens, and uploading that dataset to Dune.

Global Asset Lineage

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.

Useful Links

Getting started

  1. Copy .env-example to .env and populate your Airstack and Dune API keys

  2. 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]"
  1. Then, start the Dagster UI web server:
dagster dev
  1. Open http://localhost:3000 with your browser to see the project.

  2. Click "Materialize All" to run the pipeline

Development

Adding new Python dependencies

You can specify new Python dependencies in setup.py.

Unit testing

Tests are in the moxie_dune_tests directory and you can run tests using pytest:

pytest moxie_dune_tests

Schedules and sensors

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.

Deploy on Dagster Cloud

The easiest way to deploy your Dagster project is to use Dagster Cloud.

Check out the Dagster Cloud Documentation to learn more.

About

Moxie Fan Token Earnings Offchain -> Dune Data Pipeline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages