Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dfinity/exchange-rate-canister

The exchange rate canister (XRC) makes use of the HTTP requests feature to provide exchange rates as a service to the IC.
https://github.com/dfinity/exchange-rate-canister

Last synced: 5 days ago
JSON representation

The exchange rate canister (XRC) makes use of the HTTP requests feature to provide exchange rates as a service to the IC.

Awesome Lists containing this project

README

        

# Exchange Rate Canister



Apache-2.0
Chat on the Forum


## Overview
The exchange rate canister provides an oracle service for cryptocurrency and
fiat currency exchange rates.
It interacts with all data sources using the
[HTTPS outcalls](https://internetcomputer.org/https-outcalls/) feature.

## Usage

The exchange rate canister offers a single endpoint:

```
"get_exchange_rate": (GetExchangeRateRequest) -> (GetExchangeRateResult)
```
The request must specify the base and quote assets and, optionally, a timestamp.
The returned result contains either the exchange rate for the requested asset pair
along with some metadata or an error.
Details can be found in the [Candid file](src/xrc/xrc.did).

> **_NOTE:_** 1B cycles must be sent to the exchange rate canister with each request.
A certain amount may be refunded depending on the number of required HTTPs outcalls
to serve the request. The base fee is 20M cycles.

## Official build
The official build should ideally be reproducible, so that independent parties
can validate that the correct WebAssembly module was deployed.

A dockerized build environment is used to build the gzipped WebAssembly module and
print its SHA-256 hash.

```bash
export IP_SUPPORT=ipv4
./scripts/docker-build
sha256sum xrc.wasm.gz
```

The canister ID of the deployed exchange rate canister is `uf6dk-hyaaa-aaaaq-qaaaq-cai`.

## Contribution mode
External contributions are accepted.