Astar With Covalent API

Published on: 19.11.2022
Astar With Covalent API

One of the most significant differences between Web3, which is built on blockchain, and Web2 is the transparency of data; it’s possible to trace all on-chain activities (transactions) of Web3 end users. This dramatically increases the data that we can access and opens the door for massive opportunities for development. Imagine if all the transactions on Amazon were done using cryptocurrency on blockchain, you could access the purchase data of customers even if you were an employee at another e-commerce platform! That’s a new opportunity for the competing platform to learn from a market leader.

Even though it’s possible to gather this information, in practice blockchain data is largely irretrievable and meaningless without additional software. That is where Covalent comes in. Covalent allows you to access organized on-chain data from Astar and Shiden Networks by using a simple API. This enables dApp developers and end users to access a rich amount of on-chain data without heavy coding, allowing you to make better-informed decisions.

Getting Historical Token Prices

There are many powerful APIs from Covalent that an end user can use. Here we will introduce how to get historical token prices using pricing endpoints. A developer could use this information to create a trading dApp, rich with information, that provides bidders and sellers with historical information. From there, a user has a bit more insight into larger market trends and consumer sentiment.

Let’s walk through retrieving this information. Start by heading over to Covalent API docs and choose “Astar Mainnet” as the network. Then scroll down to the “Pricing Endpoints” section. Here you will find that there is an API for getting historical token prices.

Using the API is the usual way for in-depth analysis, but for this example, we will use the GUI for testing purposes. In this example, we retrieve the historical price data for $WASTR from 2022/8/1 to 2022/9/30. You’ll need the contract address for $WASTR from a block explorer, such as Blockscout. Fill in the necessary information, and hit “RUN” to see a sample response on the right. The returned object includes a token price for each day.

If you use Python to call this API and transform the data into a more flexible type, such as Pandas DataFrame, you will be able to analyze the data with more insight. Considering that most third-party APIs for getting historical token prices are not free, this could be a powerful tool for average retail users, as well as experienced developers.

Analyze NFT holders

Covalent also allows you to analyze NFTs with its easy-to-use API. For instance, let’s analyze one of the most popular NFT collections on Astar, which is Astar Degens. First, head over to TofuNFT and get the contract address for AstarDegens. You can find the contract address under the “info” tab, see below.

Next, go back to the Covalent API Docs webpage, and input the NFT contract address to “Get token holders as of any block height” API. You will then see the result with how many DEGENs each address owns. The address with the most has 93 DEGENs. Wow, that’s a real degen!

Just like that, you can use Covalent in a fun way to analyze your favorite NFT collection. For developers, this could be a key metric to provide insight into community engagement and wallet activity, especially during campaign events and partnership announcements.

We’re introducing price history and number of token holders as two useful metrics for users and developers, but Covalent offers a wide range of on-chain data on Astar and Shiden. We encourage you to use the links below to discover new ways to enhance your project.

About Astar

Astar Network — The Future of Smart Contracts for Multichain. Supports the building of dApps with EVM and WASM smart contracts and offers developers true interoperability, with cross-consensus messaging (XCM).

Website Twitter |

Source

REQUEST AN ARTICLE

Market Stats:
BTC Dominance: 58.07%(-0.44%/24h)
ETH Dominance: 14.07%(+0.33%/24h)
Defi Market Cap: $83.37B(+5.87%/24h)
Total Market Cap: $2601.54B(+1.00%/24h)
Total Trading Volume 24h: $126.31B(-4.76%/24h)
ETH Market Cap: $365.89B
Defi to ETH Ratio: 22.79%
Defi Dominance: 3.06%
Altcoin Market Cap: $1090.91B
Altcoin Volume 24h: $78.46B
Total Cryptocurrencies: 32099
Active Cryptocurrencies: 9955
Active Market Pairs: 88171
Active Exchanges: 762
Total Exchanges: 9536
BTC: 76371.6$(-0.13%/1H)
ETH: 3038.2$(-0.54%/1H)
AVAX: 29.19$(-0.78%/1H)
BNB: 623.19$(-0.29%/1H)
MATIC: 0.38$(-0.79%/1H)
FTM: 0.75$(0.18%/1H)
ADA: 0.44$(0.31%/1H)
DOT: 4.35$(-0.67%/1H)
UNI: 8.99$(-1.2%/1H)
CAKE: 1.95$(-0.46%/1H)
SUSHI: 0.74$(-0.56%/1H)
ONE: 0.01$(-0.7%/1H)