You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CORE-0000
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on updating the documentation for various blockchain use cases, enhancing clarity and structure. It introduces a new section summarizing insights and specific blueprints for tracking on-chain activities.
### Detailed summary
- Removed detailed explanations for various use cases in sections for `Gaming`, `DeFi`, `NFTs`, and `Wallets`.
- Added a new section titled `Insight Use Cases`.
- Provided a concise table summarizing use cases and corresponding blueprints for tracking blockchain data.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
In blockchain games, players often own digital assets such as in-game items or tokens. To display these assets, the events blueprint can track Transfer events of ERC-721 (NFT) or ERC-1155 tokens, allowing you to determine which assets belong to each player’s wallet.
18
-
- The Events blueprint can be used to fetch Transfer events where the player’s wallet is the recipient, showing all NFTs or in-game items acquired by the player.
19
-
20
-
### Show users the tokens they earned
21
-
Some games reward players with tokens based on achievements or progress. Using the transactions blueprint, you can display these earned tokens by tracking transactions where the game’s smart contract sends tokens to the player’s wallet.
22
-
- Transactions Blueprint: Shows all transactions where the game contract transfers tokens to players.
23
-
- Events Blueprint: Filters Transfer events from the game’s contract to list all tokens awarded to players.
24
-
25
-
## DeFi
26
-
27
-
### Analyse Token Economics e.g. USDC 24h volume
28
-
Token economics, like daily trading volume, helps in understanding a token’s liquidity and market activity. By using the transactions blueprint users can get transactions involving USDC and then aggregating data based on timestamps, you can calculate 24-hour transaction volume.
29
-
- Transactions Blueprint: Retrieves all USDC transactions in the past 24 hours, enabling calculation of volume and other economic indicators.
30
-
31
-
### Optimize protocol gas efficiency
32
-
DeFi protocols aim to minimize gas fees for users. Using the transactions blueprint allow users to analyze the gas consumption of different transactions, you can identify areas where gas optimization is possible by evaluating high-gas transactions or commonly used functions.
33
-
- Transactions Blueprint: Summarizes gas usage across transactions for specific functions, helping to analyze and optimize protocol functions for efficiency.
34
-
35
-
### Analyse Token ownership
36
-
Understanding who holds a token (e.g., whales, retail investors) is crucial in DeFi to gauge community health and investment risk. The events blueprint helps track token transfer events, where users can analyze the distribution and concentration of token holders.
37
-
- Events Blueprint: Retrieves Transfer events to build a map of current token holders, showing distributions among wallets.
38
-
39
-
## NFTs
40
-
41
-
### Get all transfers of an NFT collection
42
-
To track the movement of an entire NFT collection, users can use the events blueprint to capture all Transfer events for that collection. This helps show ownership history or current trading volume for the collection.
43
-
- Events Blueprint: Queries Transfer events by contract address, returning each transfer for the NFT collection.
44
-
45
-
### Get All NFTs owned by address
46
-
To show all NFTs owned by a user, users can use the events blueprint to fetch Transfer events where the specified address is the recipient. This shows a complete list of NFTs in their wallet.
47
-
- Events Blueprint: Retrieves Transfer events for each NFT contract where the wallet address is the recipient.
48
-
49
-
## Wallets
50
-
51
-
### Get all transactions performed by a wallet cross chain
52
-
Wallet activity often spans multiple chains. By using the transactions blueprint with the wallet address across different chain_ids, users can retrieve a cross-chain view of all transactions for that wallet.
53
-
- Transactions Blueprint: Filters transactions by wallet address and chain ID, providing a history of cross-chain transactions.
54
-
55
-
### Get all ERC-20 tokens owned by a wallet
56
-
This allows users to see all ERC-20 tokens they own. By using the events blueprint to find Transfer events where the wallet address is the recipient, you can list each ERC-20 token held by that wallet.
57
-
- Events Blueprint: Tracks Transfer events of ERC-20 tokens to the wallet address, providing a list of token balances.
58
-
59
-
### Detect wallet staking activity (e.g. AAVE)
60
-
To identify staking activity in AAVE or any DeFi protocol, users can use the events blueprint to watch for staking-related events, such as Deposit or Stake events on any protocol e.g. AAVE’s smart contracts. This helps monitor which wallets are actively staking assets.
61
-
- Events Blueprint: Filters by staking events on AAVE’s staking contracts for the wallet address, providing insights into wallet staking activity.
62
-
12
+
# Insight Use Cases
13
+
14
+
Insight offers versatile use cases for using blockchain data within applications, enabling developers to track and analyze a wide array of on-chain activities.
15
+
With Insight, you can efficiently monitor transfer events, transactions, token ownership, NFT collections, and staking activities across multiple chains, and more,
16
+
making it a powerful tool for building dynamic blockchain applications.
17
+
18
+
| Use Case | Blueprint(s) |
19
+
| --- | --- |
20
+
| Display in-game assets such as items or tokens (ERC-20, ERC-721, or ERC-1155) tied to the player's wallet. | Use Events Blueprint to fetch transfer events where the player’s wallet is the recipient, showing all NFTs or in-game items acquired by the player. |
21
+
| Display earned tokens based on achievements or progress rewarded to players in games. | Use Transactions Blueprint to track transactions where the game’s smart contract sends tokens to a player’s wallet. <br/> Use Events Blueprint to filter transfer events from the game’s contract to list all tokens awarded to players. |
22
+
| Analyze token economics such as daily trading volume to understand token liquidity or market activity. | Use the Transactions Blueprint to get transactions involving any token and then aggregate data based on timestamps to calculate 24-hour transaction volumes. |
23
+
| Analyze gas consumption of different transactions to help minimize gas fees for users by evaluating high-gas transactions or commonly used functions. | Use Transactions Blueprint to summarize gas usage across transactions for specific functions, helping to analyze and optimize protocol functions for efficiency. |
24
+
| Analyze token ownership to understand community health and investment risks. | Use Events Blueprint to track token transfer events, allowing users to analyze the distribution and concentration of token holders. |
25
+
| Track the movements of an entire NFT collection. | Use Events Blueprint to capture all transfer events for a specified collection and show ownership history or current trading volume for the collection. |
26
+
| Fetch all NFTs owned by a specific wallet address. | Use Events Blueprint to fetch transfer events for each NFT contract where the specified wallet address is the recipient. |
27
+
| Fetch all transactions emitted by a single wallet across multiple chains. | Use Transactions Blueprint to filter transactions by wallet address across different chain_ids to provide a historical view of cross-chain transactions. |
28
+
| Fetch all tokens owned by a specific wallet address. | Use Events Blueprint to find transfer events where the wallet address is the recipient, providing a list of token balances. |
29
+
| Detect wallet staking activity on platforms such as AAVE or other DeFi protocols. | Use Events Blueprint to filter for staking-related events such as deposits, and monitor which wallets are actively staking. |
0 commit comments