MoralisWeb3 / docs

Official documentation of Moralis Web3
https://docs.moralis.com
28 stars 123 forks source link

Feature request for: /web3-data-api/evm/how-to-get-historical-erc20-token-price #445

Closed cbueltem closed 4 months ago

cbueltem commented 4 months ago

The article describes how to get historical token prices. This is done by specifying the block number to which the price should be queried. It would be helpful to describe on how the block relstes to a certain point in time. I.e. if I want to fetch historical prices, I will e.g. want daily datapoints. So what is the block I need to use that translates to a certain point of time.

JohnVersus commented 4 months ago

Hi @cbueltem

You can use getDateToBlock endpoint to get the block number at a point in time. Have a look at the below docs for testing. https://docs.moralis.io/web3-data-api/evm/reference/get-date-to-block