Skip to content

Commit

Permalink
wip: furnish README
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Jun 14, 2024
1 parent 5a5e0ca commit ea4e7e3
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 2 deletions.
91 changes: 90 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,90 @@
# TODO: Add README
# Reservoir Price Oracle

The Reservoir Price Oracle is designed to work with
[Euler Vault Kit](https://github.com/euler-xyz/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](https://github.com/reservoir-labs/amm-core).

## Interfaces

For more information on the `IPriceOracle` interface, refer to Euler's [documentation](https://github.com/euler-xyz/euler-price-oracle?tab=readme-ov-file#ipriceoracle).

For direct usages of the oracle, refer to
[IReservoirPriceOracle.sol](src/interfaces/IReservoirPriceOracle.sol) for
methods to obtain raw data from the AMM pairs.

## Usage

### Install

To install Price Oracles in a [Foundry](https://github.com/foundry-rs/foundry) project:

```sh
forge install reservoir-labs/oracle
```

### Development

Clone the repo:

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

Install forge dependencies:

```sh
forge install
```

[Optional] Install Node.js dependencies:

```sh
npm install
```

Compile the contracts:

```sh
forge build
```

### Testing

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

To run all tests:

```sh
npm run test:all
```

### Linting

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

```sh
npm run lint
```

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

## Security vulnerability disclosure

Please report suspected security vulnerabilities in private to
[[email protected]]([email protected]). 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) license.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"submodule:check": "cd lib && find . -mindepth 1 -maxdepth 1 -type d -exec bash -c 'cd \"{}\" && pwd && ../../scripts/git-master-diff.sh && echo' \\;",
"submodule:reset": "git submodule update --recursive",
"test": "npm run test:unit",
"test:all": "npm run test:unit && npm run test:integration",
"test:all": "npm run test:unit && npm run test:unit-large && npm run test:integration",
"test:integration": "export FOUNDRY_PROFILE=integration && forge test",
"test:unit": "forge test",
"test:unit-large": "export FOUNDRY_PROFILE=large-test && forge test"
Expand Down

0 comments on commit ea4e7e3

Please sign in to comment.