Sugar comes with contracts to help working with Velodrome Finance data!
The idea is pretty simple, instead of relying on our API for a structured data set of liquidity pairs data, these contracts can be called in an efficient way to directly fetch the same data off-chain.
What normally would require:
- fetching the number of liquidity pairs
- querying every pair address at it's index
- querying pair tokens data
- querying gauge addresses and reward rate
Takes a single call with sugar!
More importantly, the response can be paginated.
Main goals of this little project are:
- to maximize the developers UX of working with our protocol
- simplify complexity
- document and test everything
On-chain data is organized for transaction cost and efficiency. We think
we can hide a lot of the complexity by leveraging structs
to present the data
and normalize it based on it's relevancy.
The list of sugar contracts will be published on docs.velodrome.finance
To setup the environment, build the Docker image first:
docker build ./ -t velodrome/sugar
Next start the container with existing environment variables:
docker run --env-file=env.example --rm -v $(pwd):/app -w /app -it velodrome/sugar sh
The environment has Brownie and Vyper already installed.
To run the tests inside the container, use:
brownie test --network=optimism-test