Interface PriceFeed

All Known Implementing Classes:
CachingPriceFeed, CoinGeckoFeed, JsonPriceFeed

public interface PriceFeed
A source of prices. CoinGeckoFeed covers most assets, JsonPriceFeed adapts any HTTP API that answers a price in JSON, and CachingPriceFeed keeps answers for a while so a screen that refreshes does not spend a rate limit.
  • Method Summary

    Modifier and Type
    Method
    Description
    getQuote(String base, String quote)
    The price of base in quote, by ticker (BTC, ETH, USD, EUR); case does not matter.
  • Method Details

    • getQuote

      Quote getQuote(String base, String quote) throws IOException

      The price of base in quote, by ticker (BTC, ETH, USD, EUR); case does not matter.

      Throws
      • IOException: when the source cannot be reached or does not know the pair
      Throws:
      IOException