NowgateDocs

Rates

Rates, estimates and minimums for prices in USD and EUR.

On this page

Rates come from Nowgate's own rate engine: Chainlink and Pyth feeds and exchange pools on the networks Nowgate follows, every read checked by a second operator. An asset has a rate only when two independent families of sources agree, one of them an oracle. See prices in a currency.

List rates#

GET/v1/ratesAPI key, read scope

Each price asset's newest rate in USD and EUR, from Nowgate's own rate engine: Chainlink and Pyth feeds and exchange pools on the networks Nowgate follows, every read verified by a second operator. An asset has a rate only when two independent families of sources agree, one of them an oracle; otherwise available is false and reason says why.

await nowgate.rates.list();

Responses

200 Every price asset's newest round.

The RateList object
  • object"list"required
  • dataarray of Rate (object)required
    8 fields of Rate
    • assetstringrequired

      The price asset (BTC, ETH, USDC, ..., and EUR itself).

      Example: "ETH".

    • availablebooleanrequired
    • usdstring

      USD per whole unit, as a decimal. Present when available.

      Example: "2232.05".

    • eurstring

      EUR per whole unit, as a decimal. Present when available and EUR is too.

    • reasonstring

      Why there is no rate, when not available: too_few_sources, sources_disagree, no_oracle, jump_hold, depeg, stale or no_round.

    • familiesintegerrequired

      How many independent families of sources the round rests on, outliers left out. An available rate always has at least two, one of them an oracle.

    • parbooleanrequired

      True for a stablecoin priced at exactly 1 USD because its sources put it within 0.5 % of that.

    • rate_atTimestamp (string (date-time))required

      When the round was measured.

4xx, 5xx An error, as problem details.

Estimate a price#

GET/v1/estimateAPI key, read scope

What a payment priced in a currency would expect in an asset if created now. It takes no snapshot and holds nothing: the payment's own quote is taken when it is created.

await nowgate.rates.estimate({ … });

Query parameters

  • networkNetwork (string)required

    Network identifier; see GET /assets. New networks may be added.

  • assetAssetSymbol (string)required

    Asset symbol on the network; see GET /assets.

  • price_amountFiatAmount (string)required

    An amount of a currency with at most two decimal places, e.g. "25.00".

  • price_currencystringrequired
  • markup_bpsinteger

    From 0 to 1000.

  • fee_paid_byFeePaidBy (string)

    Who bears Nowgate's fee. With payer, the payer sends enough for you to receive the whole price after the fee. The default is merchant.

    One of: merchant, payer.

Responses

200 The estimate.

The Estimate object
  • networkNetwork (string)required

    Network identifier; see GET /assets. New networks may be added.

  • assetAssetSymbol (string)required

    Asset symbol on the network; see GET /assets.

  • amountAmount (string)required

    What a payment created now would expect.

  • pricePrice (object)required
    2 fields of Price
    • amountFiatAmount (string)required

      An amount of a currency with at most two decimal places, e.g. "25.00".

    • currencystringrequired

      Example: "USD".

  • quoteQuote (object)required

    How a fiat price was converted. The amount holds until the payment expires.

    4 fields of Quote
    • ratestringrequired

      The currency's price of one whole unit of the asset, as a decimal.

      Example: "2232.05".

    • currencystringrequired

      Example: "USD".

    • rate_atTimestamp (string (date-time))required

      When the rate was measured.

    • markup_bpsintegerrequired
  • fee_paid_byFeePaidBy (string)required

    Who bears Nowgate's fee. With payer, the payer sends enough for you to receive the whole price after the fee. The default is merchant.

    One of: merchant, payer.

4xx, 5xx An error, as problem details.

Get an asset's minimum#

GET/v1/min-amountAPI key, read scope

The smallest amount a payment in the asset may expect, and its value in a currency at the newest rate.

await nowgate.rates.minAmount({ … });

Query parameters

  • networkNetwork (string)required

    Network identifier; see GET /assets. New networks may be added.

  • assetAssetSymbol (string)required

    Asset symbol on the network; see GET /assets.

  • currencystring

Responses

200 The minimum.

The MinAmount object
  • networkNetwork (string)required

    Network identifier; see GET /assets. New networks may be added.

  • assetAssetSymbol (string)required

    Asset symbol on the network; see GET /assets.

  • min_amountAmount (string)required

    A non-negative decimal amount in the asset's units, e.g. "12.5".

  • fiatPrice (object)

    The minimum's value in the currency asked for, at the newest rate, rounded up to the cent.

    2 fields of Price
    • amountFiatAmount (string)required

      An amount of a currency with at most two decimal places, e.g. "25.00".

    • currencystringrequired

      Example: "USD".

4xx, 5xx An error, as problem details.

The rate object#

  • assetstringrequired

    The price asset (BTC, ETH, USDC, ..., and EUR itself).

    Example: "ETH".

  • availablebooleanrequired
  • usdstring

    USD per whole unit, as a decimal. Present when available.

    Example: "2232.05".

  • eurstring

    EUR per whole unit, as a decimal. Present when available and EUR is too.

  • reasonstring

    Why there is no rate, when not available: too_few_sources, sources_disagree, no_oracle, jump_hold, depeg, stale or no_round.

  • familiesintegerrequired

    How many independent families of sources the round rests on, outliers left out. An available rate always has at least two, one of them an oracle.

  • parbooleanrequired

    True for a stablecoin priced at exactly 1 USD because its sources put it within 0.5 % of that.

  • rate_atTimestamp (string (date-time))required

    When the round was measured.

The estimate object#

  • networkNetwork (string)required

    Network identifier; see GET /assets. New networks may be added.

  • assetAssetSymbol (string)required

    Asset symbol on the network; see GET /assets.

  • amountAmount (string)required

    What a payment created now would expect.

  • pricePrice (object)required
    2 fields of Price
    • amountFiatAmount (string)required

      An amount of a currency with at most two decimal places, e.g. "25.00".

    • currencystringrequired

      Example: "USD".

  • quoteQuote (object)required

    How a fiat price was converted. The amount holds until the payment expires.

    4 fields of Quote
    • ratestringrequired

      The currency's price of one whole unit of the asset, as a decimal.

      Example: "2232.05".

    • currencystringrequired

      Example: "USD".

    • rate_atTimestamp (string (date-time))required

      When the rate was measured.

    • markup_bpsintegerrequired
  • fee_paid_byFeePaidBy (string)required

    Who bears Nowgate's fee. With payer, the payer sends enough for you to receive the whole price after the fee. The default is merchant.

    One of: merchant, payer.