Skip to content

reservoir-labs/oracle

Repository files navigation

Reservoir Price Oracle

The Reservoir Price Oracle is designed to work with Euler Vault Kit by implementing the IPriceOracle interface.

This oracle provides a geometric mean price between two assets, averaged across a period. The geometric mean has a useful property whereby we can get the inverse price by simply taking the reciprocal. Something that arithmetic mean prices do not provide.

Powered the built-in on-chain price oracle of Reservoir's AMM.

Interfaces

For more information on the IPriceOracle interface, refer to Euler's documentation.

For direct usages of the oracle, refer to IReservoirPriceOracle.sol for methods to obtain raw data from the AMM pairs.

Usage

Install

To install Price Oracles in a Foundry project:

forge install reservoir-labs/oracle

Development

Clone the repo:

git clone https://github.com/reservoir-labs/oracle.git && cd oracle

Install forge dependencies:

forge install

[Optional] Install Node.js dependencies:

npm install

Compile the contracts:

forge build

Testing

The repo contains 3 types of tests: unit, large, and integration.

To run all tests:

npm run test:all

Linting

To run lint on solidity, json, and markdown, run:

npm run lint

Separate .solhint.json files exist for src/ and test/.

Security vulnerability disclosure

Please report suspected security vulnerabilities in private to security@reservoir.fi. Please do NOT create publicly viewable issues for suspected security vulnerabilities.

Audits

These contracts have been audited by TBD and TBD auditing firm.

License

The Euler Price Oracles code is licensed under the GPL-3.0-or-later license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published