Onchain.Aave.V4.Oracle (onchain_aave v0.4.0)

Copy Markdown View Source

Aave V4 Spoke-scoped oracle reads.

V4 has no protocol-wide oracle. Each Spoke owns an IAaveOracle (resolved via ISpoke.ORACLE()), and prices are keyed by Spoke reserve id, not underlying asset address. Pass a Spoke address instead of a network.

V3 BASE_CURRENCY / BASE_CURRENCY_UNIT / getFallbackOracle have no V4 equivalent — decimals/2 is the price scale (V4 oracles are 8 decimals). Direct Chainlink / IPriceFeed reads take a feed address, not a Spoke.

Error Format

Errors pass through from the underlying module that failed:

SourceError Shape
Onchain.Address.validate/1{:error, {:invalid_address, input}}
Onchain.Contract.call/5{:error, {:encode_error, ...}}, {:error, {:rpc_error, ...}}, {:error, {:decode_error, ...}}

Functions

FunctionPurpose
oracle_address/2Spoke's IAaveOracle via ISpoke.ORACLE()
get_reserve_price/3Price of one reserve (getReservePrice)
get_reserve_prices/3Batch prices (getReservesPrices)
get_reserve_source/3IPriceFeed for a reserve (getReserveSource)
decimals/2Oracle price decimals
get_spoke/2Spoke this oracle is bound to (spoke())
get_asset_price/3V3-shaped alias of get_reserve_price/3
get_asset_prices/3V3-shaped alias of get_reserve_prices/3
get_source_of_asset/3V3-shaped alias of get_reserve_source/3
get_latest_round_data/2Chainlink aggregator latestRoundData
get_latest_answer/2IPriceFeed.latestAnswer (what V4 AaveOracle reads)

API Functions

FunctionArityDescriptionParam Kinds
get_latest_answer!2Latest IPriceFeed answer. Raises on error.feed: value, opts: value
get_latest_answer2Latest IPriceFeed answer (the call V4 AaveOracle uses).feed: value, opts: value
get_latest_round_data!2Latest Chainlink round data. Raises on error.aggregator: value, opts: value
get_latest_round_data2Latest round data from a Chainlink aggregator.aggregator: value, opts: value
get_source_of_asset!3V3-shaped alias of get_reserve_source!/3. Raises on error.spoke: value, reserve_id: value, opts: value
get_source_of_asset3V3-shaped alias of get_reserve_source/3. The second argument is a Spoke reserve id, not an asset address.spoke: value, reserve_id: value, opts: value
get_asset_prices!3V3-shaped alias of get_reserve_prices!/3. Raises on error.spoke: value, reserve_ids: value, opts: value
get_asset_prices3V3-shaped alias of get_reserve_prices/3. Arguments are Spoke reserve ids, not asset addresses.spoke: value, reserve_ids: value, opts: value
get_asset_price!3V3-shaped alias of get_reserve_price!/3. Raises on error.spoke: value, reserve_id: value, opts: value
get_asset_price3V3-shaped alias of get_reserve_price/3. The second argument is a Spoke reserve id, not an asset address.spoke: value, reserve_id: value, opts: value
get_spoke!2Spoke this oracle is bound to. Raises on error.spoke: value, opts: value
get_spoke2Spoke address this IAaveOracle is bound to.spoke: value, opts: value
decimals!2Oracle price decimals. Raises on error.spoke: value, opts: value
decimals2Number of decimals used to return Spoke oracle prices.spoke: value, opts: value
get_reserve_source!3IPriceFeed address for a Spoke reserve. Raises on error.spoke: value, reserve_id: value, opts: value
get_reserve_source3IPriceFeed (Chainlink-style) address for a Spoke reserve.spoke: value, reserve_id: value, opts: value
get_reserve_prices!3Prices for multiple Spoke reserves. Raises on error.spoke: value, reserve_ids: value, opts: value
get_reserve_prices3Prices for multiple Spoke reserves in one call.spoke: value, reserve_ids: value, opts: value
get_reserve_price!3Price of a Spoke reserve. Raises on error.spoke: value, reserve_id: value, opts: value
get_reserve_price3Price of a Spoke reserve in oracle base units.spoke: value, reserve_id: value, opts: value
oracle_address!2Resolve a Spoke's IAaveOracle. Raises on error.spoke: value, opts: value
oracle_address2Resolve a Spoke's IAaveOracle via ISpoke.ORACLE().spoke: value, opts: value

Summary

Functions

Number of decimals used to return Spoke oracle prices.

Oracle price decimals. Raises on error.

V3-shaped alias of get_reserve_price/3. The second argument is a Spoke reserve id, not an asset address.

V3-shaped alias of get_reserve_price!/3. Raises on error.

V3-shaped alias of get_reserve_prices/3. Arguments are Spoke reserve ids, not asset addresses.

V3-shaped alias of get_reserve_prices!/3. Raises on error.

Latest IPriceFeed answer (the call V4 AaveOracle uses).

Latest IPriceFeed answer. Raises on error.

Latest round data from a Chainlink aggregator.

Latest Chainlink round data. Raises on error.

Price of a Spoke reserve in oracle base units.

Price of a Spoke reserve. Raises on error.

Prices for multiple Spoke reserves in one call.

Prices for multiple Spoke reserves. Raises on error.

IPriceFeed (Chainlink-style) address for a Spoke reserve.

IPriceFeed address for a Spoke reserve. Raises on error.

V3-shaped alias of get_reserve_source/3. The second argument is a Spoke reserve id, not an asset address.

V3-shaped alias of get_reserve_source!/3. Raises on error.

Spoke address this IAaveOracle is bound to.

Spoke this oracle is bound to. Raises on error.

Resolve a Spoke's IAaveOracle via ISpoke.ORACLE().

Resolve a Spoke's IAaveOracle. Raises on error.

Functions

decimals(spoke, opts \\ [])

@spec decimals(
  String.t() | binary(),
  keyword()
) :: {:ok, non_neg_integer()} | {:error, term()}

Number of decimals used to return Spoke oracle prices.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Price decimals (8 on V4) ({:ok, non_neg_integer()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    }
  },
  returns: %{
    type: "{:ok, non_neg_integer()} | {:error, term()}",
    description: "Price decimals (8 on V4)"
  }
}

decimals!(spoke, opts \\ [])

@spec decimals!(
  String.t() | binary(),
  keyword()
) :: non_neg_integer()

Oracle price decimals. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Price decimals (non_neg_integer)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    }
  },
  returns: %{type: :non_neg_integer, description: "Price decimals"}
}

get_asset_price(spoke, reserve_id, opts \\ [])

@spec get_asset_price(String.t() | binary(), non_neg_integer(), keyword()) ::
  {:ok, non_neg_integer()} | {:error, term()}

V3-shaped alias of get_reserve_price/3. The second argument is a Spoke reserve id, not an asset address.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Price in oracle decimals ({:ok, non_neg_integer()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{
    type: "{:ok, non_neg_integer()} | {:error, term()}",
    description: "Price in oracle decimals"
  }
}

get_asset_price!(spoke, reserve_id, opts \\ [])

@spec get_asset_price!(String.t() | binary(), non_neg_integer(), keyword()) ::
  non_neg_integer()

V3-shaped alias of get_reserve_price!/3. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Price in oracle decimals (non_neg_integer)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{type: :non_neg_integer, description: "Price in oracle decimals"}
}

get_asset_prices(spoke, reserve_ids, opts \\ [])

@spec get_asset_prices(String.t() | binary(), [non_neg_integer()], keyword()) ::
  {:ok, [non_neg_integer()]} | {:error, term()}

V3-shaped alias of get_reserve_prices/3. Arguments are Spoke reserve ids, not asset addresses.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_ids - List of Spoke reserve identifiers (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

List of prices ({:ok, [non_neg_integer()]} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_ids: %{
      description: "List of Spoke reserve identifiers",
      kind: :value
    }
  },
  returns: %{
    type: "{:ok, [non_neg_integer()]} | {:error, term()}",
    description: "List of prices"
  }
}

get_asset_prices!(spoke, reserve_ids, opts \\ [])

@spec get_asset_prices!(String.t() | binary(), [non_neg_integer()], keyword()) :: [
  non_neg_integer()
]

V3-shaped alias of get_reserve_prices!/3. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_ids - List of Spoke reserve identifiers (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

List of prices ([non_neg_integer()])

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_ids: %{
      description: "List of Spoke reserve identifiers",
      kind: :value
    }
  },
  returns: %{type: "[non_neg_integer()]", description: "List of prices"}
}

get_latest_answer(feed, opts \\ [])

@spec get_latest_answer(
  String.t() | binary(),
  keyword()
) :: {:ok, integer()} | {:error, term()}

Latest IPriceFeed answer (the call V4 AaveOracle uses).

Parameters

  • feed - IPriceFeed / Chainlink aggregator address (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Signed price answer in feed decimals ({:ok, integer()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    feed: %{
      description: "IPriceFeed / Chainlink aggregator address",
      kind: :value
    }
  },
  returns: %{
    type: "{:ok, integer()} | {:error, term()}",
    description: "Signed price answer in feed decimals"
  }
}

get_latest_answer!(feed, opts \\ [])

@spec get_latest_answer!(
  String.t() | binary(),
  keyword()
) :: integer()

Latest IPriceFeed answer. Raises on error.

Parameters

  • feed - IPriceFeed / Chainlink aggregator address (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Signed price answer (integer)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    feed: %{
      description: "IPriceFeed / Chainlink aggregator address",
      kind: :value
    }
  },
  returns: %{type: :integer, description: "Signed price answer"}
}

get_latest_round_data(aggregator, opts \\ [])

@spec get_latest_round_data(
  String.t() | binary(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Latest round data from a Chainlink aggregator.

Parameters

  • aggregator - Chainlink aggregator / IPriceFeed address (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Map with :round_id, :answer, :started_at, :updated_at, :answered_in_round ({:ok, map()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    aggregator: %{
      description: "Chainlink aggregator / IPriceFeed address",
      kind: :value
    }
  },
  returns: %{
    type: "{:ok, map()} | {:error, term()}",
    description: "Map with :round_id, :answer, :started_at, :updated_at, :answered_in_round"
  }
}

get_latest_round_data!(aggregator, opts \\ [])

@spec get_latest_round_data!(
  String.t() | binary(),
  keyword()
) :: map()

Latest Chainlink round data. Raises on error.

Parameters

  • aggregator - Chainlink aggregator / IPriceFeed address (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Round data map (map)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    aggregator: %{
      description: "Chainlink aggregator / IPriceFeed address",
      kind: :value
    }
  },
  returns: %{type: :map, description: "Round data map"}
}

get_reserve_price(spoke, reserve_id, opts \\ [])

@spec get_reserve_price(String.t() | binary(), non_neg_integer(), keyword()) ::
  {:ok, non_neg_integer()} | {:error, term()}

Price of a Spoke reserve in oracle base units.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Price in oracle decimals (8 for V4) ({:ok, non_neg_integer()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{
    type: "{:ok, non_neg_integer()} | {:error, term()}",
    description: "Price in oracle decimals (8 for V4)"
  }
}

get_reserve_price!(spoke, reserve_id, opts \\ [])

@spec get_reserve_price!(String.t() | binary(), non_neg_integer(), keyword()) ::
  non_neg_integer()

Price of a Spoke reserve. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Price in oracle decimals (non_neg_integer)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{type: :non_neg_integer, description: "Price in oracle decimals"}
}

get_reserve_prices(spoke, reserve_ids, opts \\ [])

@spec get_reserve_prices(String.t() | binary(), [non_neg_integer()], keyword()) ::
  {:ok, [non_neg_integer()]} | {:error, term()}

Prices for multiple Spoke reserves in one call.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_ids - List of Spoke reserve identifiers (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Prices in oracle decimals, same order as reserve_ids ({:ok, [non_neg_integer()]} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_ids: %{
      description: "List of Spoke reserve identifiers",
      kind: :value
    }
  },
  returns: %{
    type: "{:ok, [non_neg_integer()]} | {:error, term()}",
    description: "Prices in oracle decimals, same order as reserve_ids"
  }
}

get_reserve_prices!(spoke, reserve_ids, opts \\ [])

@spec get_reserve_prices!(String.t() | binary(), [non_neg_integer()], keyword()) :: [
  non_neg_integer()
]

Prices for multiple Spoke reserves. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_ids - List of Spoke reserve identifiers (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

List of prices ([non_neg_integer()])

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_ids: %{
      description: "List of Spoke reserve identifiers",
      kind: :value
    }
  },
  returns: %{type: "[non_neg_integer()]", description: "List of prices"}
}

get_reserve_source(spoke, reserve_id, opts \\ [])

@spec get_reserve_source(String.t() | binary(), non_neg_integer(), keyword()) ::
  {:ok, String.t()} | {:error, term()}

IPriceFeed (Chainlink-style) address for a Spoke reserve.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed price-feed address ({:ok, String.t()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{
    type: "{:ok, String.t()} | {:error, term()}",
    description: "Checksummed price-feed address"
  }
}

get_reserve_source!(spoke, reserve_id, opts \\ [])

@spec get_reserve_source!(String.t() | binary(), non_neg_integer(), keyword()) ::
  String.t()

IPriceFeed address for a Spoke reserve. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed price-feed address (string)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{type: :string, description: "Checksummed price-feed address"}
}

get_source_of_asset(spoke, reserve_id, opts \\ [])

@spec get_source_of_asset(String.t() | binary(), non_neg_integer(), keyword()) ::
  {:ok, String.t()} | {:error, term()}

V3-shaped alias of get_reserve_source/3. The second argument is a Spoke reserve id, not an asset address.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed price-feed address ({:ok, String.t()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{
    type: "{:ok, String.t()} | {:error, term()}",
    description: "Checksummed price-feed address"
  }
}

get_source_of_asset!(spoke, reserve_id, opts \\ [])

@spec get_source_of_asset!(String.t() | binary(), non_neg_integer(), keyword()) ::
  String.t()

V3-shaped alias of get_reserve_source!/3. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • reserve_id - Spoke reserve identifier (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed price-feed address (string)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    },
    reserve_id: %{description: "Spoke reserve identifier", kind: :value}
  },
  returns: %{type: :string, description: "Checksummed price-feed address"}
}

get_spoke(spoke, opts \\ [])

@spec get_spoke(
  String.t() | binary(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}

Spoke address this IAaveOracle is bound to.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed Spoke address from IPriceOracle.spoke() ({:ok, String.t()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    }
  },
  returns: %{
    type: "{:ok, String.t()} | {:error, term()}",
    description: "Checksummed Spoke address from IPriceOracle.spoke()"
  }
}

get_spoke!(spoke, opts \\ [])

@spec get_spoke!(
  String.t() | binary(),
  keyword()
) :: String.t()

Spoke this oracle is bound to. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed Spoke address (string)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    }
  },
  returns: %{type: :string, description: "Checksummed Spoke address"}
}

oracle_address(spoke, opts \\ [])

@spec oracle_address(
  String.t() | binary(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}

Resolve a Spoke's IAaveOracle via ISpoke.ORACLE().

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed IAaveOracle address ({:ok, String.t()} | {:error, term()})

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    }
  },
  returns: %{
    type: "{:ok, String.t()} | {:error, term()}",
    description: "Checksummed IAaveOracle address"
  }
}

oracle_address!(spoke, opts \\ [])

@spec oracle_address!(
  String.t() | binary(),
  keyword()
) :: String.t()

Resolve a Spoke's IAaveOracle. Raises on error.

Parameters

  • spoke - Spoke address as 0x hex string or 20-byte binary (value)
  • opts - Options: :rpc_url, :timeout, :block (default: [], value)

Returns

Checksummed IAaveOracle address (string)

# descripex:contract
%{
  params: %{
    opts: %{
      default: [],
      description: "Options: :rpc_url, :timeout, :block",
      kind: :value
    },
    spoke: %{
      description: "Spoke address as 0x hex string or 20-byte binary",
      kind: :value
    }
  },
  returns: %{type: :string, description: "Checksummed IAaveOracle address"}
}