> For the complete documentation index, see [llms.txt](https://docs.cryptum.io/english/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cryptum.io/english/community-edition/sdk-guides/chainlink/price-feeds.md).

# Price Feeds

Smart contracts often act in real-time on data such as prices of assets. This is especially true in DeFi. For example, Synthetix uses Data Feeds to determine prices on their derivatives platform. Lending and borrowing platforms like AAVE use Data Feeds to ensure the total value of the collateral. Data Feeds aggregate many data sources and publish them on-chain using a combination of the Decentralized Data Model and Off-Chain Reporting.

[Read more about Chainlink Data Feeds](https://docs.chain.link/data-feeds)

<mark style="color:purple;">**Step 1**</mark>

The first prerequisite you will need is the creation of an **account** and a **Project (API Key**) on Cryptum Dashboard.

**PS**: Our dashboard is almost ready! To generate an API Key, contact <hello@blockforce.in>

<mark style="color:purple;">**Step 2**</mark>

With a valid Cryptum API Key, you can then instantiate the SDK as follows:

```javascript
const CryptumSdk = require('cryptum-sdk')

const sdk = new CryptumSdk({
  environment: 'testnet',  // 'testnet', 'mainnet'
  apiKey: "YOUR-API-KEY-HERE",
})
```

<mark style="color:purple;">**Step 3**</mark>

Now we must select the function in our SDK:

#### Get Price By Address <a href="#get-price-by-address" id="get-price-by-address"></a>

In our SDK, there are enums of contracts for token pairs on Ethereum mainnet and testnet. If you cannot find the pair you desire, check the available [Price Feeds Addresses](https://docs.chain.link/data-feeds/price-feeds/addresses).

```javascript
const address = sdk.chainlink.feeds.MAINNET.ETHEREUM.ADA_USD

const price = await sdk.chainlink.getPricesByAddress({
    protocol: "ETHEREUM",
    address: address
})
```

#### Get Price By Asset <a href="#get-price-by-asset" id="get-price-by-asset"></a>

List currency price quotations

```javascript
const price = await sdk.chainlink.getPrices({
    protocol: "ETHEREUM",
    asset: 'ETH'
})
// Prices {
//   "USD": 0.3495,
//   "BTC": 7.35687406736623e-06,
// }
```
