1.0.10 • Published 6 months ago

oone-lido-subgraph-reward-history v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Using Lido Subgraph to fetch Daily Rewards History

The repository contains sample code for using Lido Subgraph to retrieve the daily rewards history for a specific address of a stETH-holding user.

In fact, the current code is a minimized and refactored version of the same logic used in the API of the Lido Reward History Backend service

setup

install packages

npm install

configure

Copy the .env.example file to .env and if needed modify SUBGRAPH_URL var to point to mainnet Lido Subgraph query endpoint.

By default, the URL is The Graph-hosted Lido Subgraph mainnet endpoint:

SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/lidofinance/lido

Feel free to change it to a more stable service, e.g. use the decentralized version of Lido Subgraph.

usage

Command to run the script via ts-node:

npm run rewards-dev <address>

or using mode.js (build & run):

npm run build
npm run rewards <address>

where <address> is any stETH holder address. E.g. for Lido Agent:

npm run rewards-dev 0x3e40D73EB977Dc6a537aF587D48316feE66E9C8c

output example

rewards history output example

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago