IChainlinkAdapter
Inherits: IOracleAdapter, IFeedRegistry, IPriceRepository
Functions
pricingPath
Returns the pricing path that will be used when quoting the given pair
tokenA and tokenB may be passed in either tokenA/tokenB or tokenB/tokenA order
function pricingPath(address tokenA, address tokenB) external view returns (PricingPath);
Parameters
Name | Type | Description |
---|---|---|
tokenA | address | One of the pair's tokens |
tokenB | address | The other of the pair's tokens |
Returns
Name | Type | Description |
---|---|---|
<none> | PricingPath | The pricing path that will be used |
Events
UpdatedPathForPair
Emitted when the adapter updates the pricing path for a pair
event UpdatedPathForPair(address tokenA, address tokenB, PricingPath path);
Parameters
Name | Type | Description |
---|---|---|
tokenA | address | One of the pair's tokens |
tokenB | address | The other of the pair's tokens |
path | PricingPath | The new path |
Errors
ChainlinkAdapter__GetRoundDataCallReverted
Thrown when the getRoundData call reverts without a reason
error ChainlinkAdapter__GetRoundDataCallReverted(bytes data);
ChainlinkAdapter__InvalidDenomination
Thrown when the denomination is invalid
error ChainlinkAdapter__InvalidDenomination(address denomination);
ChainlinkAdapter__LatestRoundDataCallReverted
Thrown when the lastRoundData call reverts without a reason
error ChainlinkAdapter__LatestRoundDataCallReverted(bytes data);
ChainlinkAdapter__PriceAtOrLeftOfTargetNotFound
Thrown when a price at or to the left of target is not found
error ChainlinkAdapter__PriceAtOrLeftOfTargetNotFound(address token, address denomination, uint256 target);
ChainlinkAdapter__PriceLeftOfTargetStale
Thrown when price left of target is stale
error ChainlinkAdapter__PriceLeftOfTargetStale(uint256 updatedAt, uint256 target);
Structs
BinarySearchDataInternal
struct BinarySearchDataInternal {
int256 leftPrice;
uint256 leftUpdatedAt;
int256 rightPrice;
uint256 rightUpdatedAt;
}
Enums
PricingPath
The path that will be used to calculate quotes for a given pair
enum PricingPath {
NONE,
ETH_USD,
TOKEN_USD,
TOKEN_ETH,
TOKEN_USD_TOKEN,
TOKEN_ETH_TOKEN,
A_USD_ETH_B,
A_ETH_USD_B,
TOKEN_USD_BTC_WBTC
}
ConversionType
The conversion type used when determining the token pair pricing path
enum ConversionType {
TO_BTC,
TO_USD,
TO_ETH,
TO_USD_TO_TOKEN,
TO_ETH_TO_TOKEN
}