/prices/history/lines/pool

Returns the line-chart price history of a given pool

"use strict";
const Shards = require("web3-shards");

const shards = Shards.API.Ethereum.V1;
shards.configure({
    apiKey: "YOUR_API_KEY", // Join the discord to get your api key. https://discord.com/invite/kJd8W7Nh7e
    maxRequestsPerSecond:5, // client-side limiter to prevent accidental burning
    logger: 1               // 0=none,1=errors,2=verbose
});

const getPrice = async function() {
    const address = "0xefb47fcfcad4f96c83d4ca676842fb03ef20a477";
    const startTime = 16887862500;
    const endTime = 1689786250;
    const interval = "1h";
    const page = 1;
    const resp = await shards.prices.getPoolPriceLines(address, startTime, endTime, interval, page);
    console.log(resp)
}

getPrice();
Query Params
string
required
Defaults to 0xefb47fcfcad4f96c83d4ca676842fb03ef20a477

The contract address of the pool

int32
required
Defaults to 1688786250

The epoch seconds from which price history will be searched

int32
required
Defaults to 1689786250

The epoch seconds to which price history will be searched

string
enum
required
Defaults to 1h

The target price interval

int32
Defaults to 1

The page of price history to request. Max page size is 200 price data points.

string
enum
required
Defaults to eth

The target chain. One of eth | bsc | shibarium.

Allowed:
Headers
string
Defaults to db2f88b1-21cd-440b-9e8c-486a8688e34e
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
text/plain