yDaemon is the next-gen API for Yearn. Based on the one from the exporter, it brings a lot of new features and benefits without breaking the existing system.
Ensure Go is installed on your system. Then, clone the repo and create the
RPC_URI_FOR_1= RPC_URI_FOR_250= RPC_URI_FOR_42161= # Optional WEBHOOK_SECRET= GRAPH_API_URI= SENTRY_DSN= SENTRY_SAMPLE_RATE= LOG_LEVEL= # DEBUG, INFO, WARNING, SUCCESS, ERROR
Then, install, build and run the API:
go mod vendor go build -o yDaemon ./cmd ./yDaemon
After a few seconds, you should see the API running. You can test it by running the following command:
To build this API, data is fetched from various Yearn data sources:
- Yearn Subgraph as the base data source.
- Yearn Meta for some basic data and information updated by the Yearn team.
- Yearn API for the APY computation.
- Yearn Lens Oracle for tokens and vault prices.
To provide a fast and up-to-date experience, a bunch of daemons are summoned with the API, running in the background, forever and ever.
- Prices from the oracle are updated every 30 seconds for every tokens and vaults, as the price may change at every block.
- APY information is updated every 10 minutes, as the underlying API is updated every 30 minutes
- Metadata is updated every day and whenever you deploy yDaemon API.