Identity Oracle

Each oracle has a clearly stated purpose on the architecture. In this case IdentityOracle will solve the case in which someone is quoting the same pair of tokens, while not supporting any other pair of tokens.

This allows us to support quotes where tokenIn = tokenOut without needing to hardcode this special case into each of the oracles.

function quote(
    address _tokenIn,
    uint256 _amountIn,
    address _tokenOut,
    bytes calldata
  ) external pure returns (uint256 _amountOut) {
    if (_tokenIn != _tokenOut) revert PairNotSupportedYet(_tokenIn, _tokenOut);
    return _amountIn;
  }

Last updated