Working with Off-Chain Data
In the previous chapter, we learned that on-chain data serves as the primary source of Web3 data analysis. It is open, distributed, and trustworthy. While on-chain data will be key to answering most business data science questions, it is essential to complement it with relevant information from off-chain data sources, which is the focus of this chapter.
Consider a scenario where we receive a request to assess the economic relevance of a smart contract. We can query the number of tokens locked in it, but to finalize the analysis, we need to determine the monetary value of those tokens. To accomplish this, we must integrate on-chain data with prices, often derived from off-chain sources.
Prices, news, and opinions are not stored on-chain and must be retrieved from external sources. In this chapter, we will delve into those sources and acquire data from selected APIs. Specifically, we will discuss alternatives for fetching prices, analyze a crypto news...