Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.89 KB

README.md

File metadata and controls

61 lines (41 loc) · 1.89 KB

juice-accountant

juice-accountant automatically generates accounting CSVs for your Juicebox project.

Retreives and processes token holders, payments, redemptions, and distributions, then generates CSV files with fiat conversions in the currency of your choice.

Powered by Node.js, the Juicebox Subgraph, graph-client, and CoinGecko's v3 API.

Juicebox helps people run programmable and community funded treasuries from startup to scale, openly on Ethereum.

Installation

First, clone with:

git clone https://github.com/filipvvv/juice-accountant.git
cd juice-accountant

Then, create a .graphclientrc.yml file by copying .example.graphclientrc.yml:

cp .example.graphclientrc.yml .graphclientrc.yml

Optionally, you can use the free Juicebox Subgraph endpoint: replace the endpoint URL in your .graphclient.yml with https://api.studio.thegraph.com/query/30654/mainnet-dev/0.5.0. To learn more about configuring Juicebox Subgraph, read the docs.

An example configuration looks like this (be sure to replace <YOUR API KEY> with your Graph API key:

sources:
  - name: juicebox
    handler:
      graphql:
        endpoint: https://gateway.thegraph.com/api/<YOUR API KEY>/subgraphs/id/FVmuv3TndQDNd2BWARV8Y27yuKKukryKXPzvAS5E7htC
    transforms:
      - autoPagination:
          validateSchema: true

documents:
  - ./queries/*.graphql

Once your graphclient.yml is ready, run:

npm install

to install dependencies and build your queries.

Run

npm run start

Your generated CSV files will be added to the output directory.