An object that mints PriceQuotes and handles triggers and notifiers for changes in the price

interface PriceAuthority {
    getQuoteIssuer: ((brandIn, brandOut) => ERef<Issuer<"set">>);
    getTimerService: ((brandIn, brandOut) => ERef<TimerService>);
    makeQuoteNotifier: ((amountIn, brandOut) => ERef<Notifier<PriceQuote>>);
    mutableQuoteWhenGT: ((amountIn, amountOutLimit) => ERef<MutableQuote>);
    mutableQuoteWhenGTE: ((amountIn, amountOutLimit) => ERef<MutableQuote>);
    mutableQuoteWhenLT: ((amountIn, amountOutLimit) => ERef<MutableQuote>);
    mutableQuoteWhenLTE: ((amountIn, amountOutLimit) => ERef<MutableQuote>);
    quoteAtTime: ((deadline, amountIn, brandOut) => Promise<PriceQuote>);
    quoteGiven: ((amountIn, brandOut) => Promise<PriceQuote>);
    quoteWanted: ((brandIn, amountOut) => Promise<PriceQuote>);
    quoteWhenGT: ((amountIn, amountOutLimit) => Promise<PriceQuote>);
    quoteWhenGTE: ((amountIn, amountOutLimit) => Promise<PriceQuote>);
    quoteWhenLT: ((amountIn, amountOutLimit) => Promise<PriceQuote>);
    quoteWhenLTE: ((amountIn, amountOutLimit) => Promise<PriceQuote>);
}

Properties

getQuoteIssuer: ((brandIn, brandOut) => ERef<Issuer<"set">>)

Type declaration

    • (brandIn, brandOut): ERef<Issuer<"set">>
    • Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair

      Parameters

      • brandIn: Brand<AssetKind>
      • brandOut: Brand<AssetKind>

      Returns ERef<Issuer<"set">>

getTimerService: ((brandIn, brandOut) => ERef<TimerService>)

Type declaration

    • (brandIn, brandOut): ERef<TimerService>
    • Get the timer used in PriceQuotes for a given brandIn/brandOut pair

      Parameters

      • brandIn: Brand<AssetKind>
      • brandOut: Brand<AssetKind>

      Returns ERef<TimerService>

makeQuoteNotifier: ((amountIn, brandOut) => ERef<Notifier<PriceQuote>>)

Type declaration

    • (amountIn, brandOut): ERef<Notifier<PriceQuote>>
    • Be notified of the latest PriceQuotes for a given amountIn. The rate at which these are issued may be very different between priceAuthorities.

      Parameters

      • amountIn: Amount<"nat">
      • brandOut: Brand<"nat">

      Returns ERef<Notifier<PriceQuote>>

mutableQuoteWhenGT: ((amountIn, amountOutLimit) => ERef<MutableQuote>)

Type declaration

    • (amountIn, amountOutLimit): ERef<MutableQuote>
    • Resolve when a price quote of amountIn exceeds amountOutLimit

      Parameters

      • amountIn: Amount<AssetKind>
      • amountOutLimit: Amount<AssetKind>

      Returns ERef<MutableQuote>

mutableQuoteWhenGTE: ((amountIn, amountOutLimit) => ERef<MutableQuote>)

Type declaration

    • (amountIn, amountOutLimit): ERef<MutableQuote>
    • Resolve when a price quote of amountIn reaches or exceeds amountOutLimit

      Parameters

      • amountIn: Amount<AssetKind>
      • amountOutLimit: Amount<AssetKind>

      Returns ERef<MutableQuote>

mutableQuoteWhenLT: ((amountIn, amountOutLimit) => ERef<MutableQuote>)

Type declaration

    • (amountIn, amountOutLimit): ERef<MutableQuote>
    • Resolve when the price quote of amountIn drops below amountOutLimit

      Parameters

      • amountIn: Amount<AssetKind>
      • amountOutLimit: Amount<AssetKind>

      Returns ERef<MutableQuote>

mutableQuoteWhenLTE: ((amountIn, amountOutLimit) => ERef<MutableQuote>)

Type declaration

    • (amountIn, amountOutLimit): ERef<MutableQuote>
    • Resolve when a price quote of amountIn reaches or drops below amountOutLimit

      Parameters

      • amountIn: Amount<AssetKind>
      • amountOutLimit: Amount<AssetKind>

      Returns ERef<MutableQuote>

quoteAtTime: ((deadline, amountIn, brandOut) => Promise<PriceQuote>)

Type declaration

    • (deadline, amountIn, brandOut): Promise<PriceQuote>
    • Resolves after deadline passes on the priceAuthority's timerService with the price quote of amountIn at that time

      Parameters

      • deadline: Timestamp
      • amountIn: Amount<"nat">
      • brandOut: Brand<"nat">

      Returns Promise<PriceQuote>

quoteGiven: ((amountIn, brandOut) => Promise<PriceQuote>)

Type declaration

    • (amountIn, brandOut): Promise<PriceQuote>
    • Get a quote corresponding to the specified amountIn

      Parameters

      • amountIn: Amount<"nat">
      • brandOut: Brand<"nat">

      Returns Promise<PriceQuote>

quoteWanted: ((brandIn, amountOut) => Promise<PriceQuote>)

Type declaration

    • (brandIn, amountOut): Promise<PriceQuote>
    • Get a quote corresponding to the specified amountOut

      Parameters

      • brandIn: Brand<"nat">
      • amountOut: Amount<"nat">

      Returns Promise<PriceQuote>

quoteWhenGT: ((amountIn, amountOutLimit) => Promise<PriceQuote>)

Type declaration

    • (amountIn, amountOutLimit): Promise<PriceQuote>
    • Resolve when a price quote of amountIn exceeds amountOutLimit

      Parameters

      • amountIn: Amount<"nat">
      • amountOutLimit: Amount<"nat">

      Returns Promise<PriceQuote>

quoteWhenGTE: ((amountIn, amountOutLimit) => Promise<PriceQuote>)

Type declaration

    • (amountIn, amountOutLimit): Promise<PriceQuote>
    • Resolve when a price quote of amountIn reaches or exceeds amountOutLimit

      Parameters

      • amountIn: Amount<"nat">
      • amountOutLimit: Amount<"nat">

      Returns Promise<PriceQuote>

quoteWhenLT: ((amountIn, amountOutLimit) => Promise<PriceQuote>)

Type declaration

    • (amountIn, amountOutLimit): Promise<PriceQuote>
    • Resolve when the price quote of amountIn drops below amountOutLimit

      Parameters

      • amountIn: Amount<AssetKind>
      • amountOutLimit: Amount<AssetKind>

      Returns Promise<PriceQuote>

quoteWhenLTE: ((amountIn, amountOutLimit) => Promise<PriceQuote>)

Type declaration

    • (amountIn, amountOutLimit): Promise<PriceQuote>
    • Resolve when a price quote of amountIn reaches or drops below amountOutLimit

      Parameters

      • amountIn: Amount<AssetKind>
      • amountOutLimit: Amount<AssetKind>

      Returns Promise<PriceQuote>

Generated using TypeDoc