Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blockcoders/terra-subgraph
Terra Money subgraph 📊
https://github.com/blockcoders/terra-subgraph
blockchain graph subgraph terra terramoney the-graph thegraph
Last synced: about 2 months ago
JSON representation
Terra Money subgraph 📊
- Host: GitHub
- URL: https://github.com/blockcoders/terra-subgraph
- Owner: blockcoders
- License: mit
- Created: 2022-03-03T20:51:49.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-25T17:55:19.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T10:33:00.089Z (9 months ago)
- Topics: blockchain, graph, subgraph, terra, terramoney, the-graph, thegraph
- Language: TypeScript
- Homepage:
- Size: 119 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Terra Subgraph
[Terra](https://www.terra.money/) is a public blockchain protocol deploying a suite of algorithmic decentralized stablecoins.
This subgraph dynamically tracks the current state of Terra contracts (LUNA, UST, wUST and wLUNA), and contains derived stats for things like historical data and USD prices.
## Running Locally
Make sure to update package.json settings to point to your own graph account.
## Queries
Below are a few ways to show how to query the terra-subgraph for data. The queries show most of the information that is queryable, but there are many other filtering options that can be used, just check out the [querying api](https://thegraph.com/docs/graphql-api). These queries can be used locally or in The Graph Explorer playground.
## Entity Overviews
### Token
- **id**: Token symbol (LUNA-UST)
- **totalBurned**: Total amount of burned tokens
- **totalUsersEver**: Total amount of created users that have sent, received or burned tokens### Transfer
- **id**: Transaction hash
- **timestamp**: Block timestamp of the event
- **from**: User that represents the sender of the transaction
- **to**: User that represents the receiver of the transaction
- **amount**: Amount in wei sent by the "from" User### User
- **id**: Represents the address of the user
- **lunaBalance**: Balance of wLUNA tokens in wei
- **ustBalance**: Balance of wUST tokens in wei
- **txCount**: Increments by one every time the user makes a transaction### Approval
- **id**: Transaction hash
- **owner**: Address of the tokens's owner
- **spender**: Address of the tokens's spender
- **amount**: Amount of tokens to approve### Burn
- **id**: Transaction hash
- **timestamp**: Block timestamp of the event
- **burner**: User that reprents the sender of the Burn transaction
- **amount**: Amount of tokens to be burned### OwnershipTransferred
- **id**: Transaction hash
- **previousOwner**: Address of the previous owner
- **newOwner**: Address of the new owner## Example Queries
```
{
users(first: 5) {
id
lunaBalance
ustBalance
txCount
}
tokens(first: 2) {
id
totalBurned
totalUsersEver
}
transfers(first: 10) {
id
timestamp
amount
from {
id
ustBalance
lunaBalance
txCount
}
to {
id
txCount
ustBalance
lunaBalance
}
}
approvals(first: 5) {
id
owner
spender
amount
}
burns(first: 5) {
id
timestamp
burner
amount
}
ownershipTransferreds(first: 5) {
id
previousOwner
newOwner
}
}
```## Change Log
See [Changelog](CHANGELOG.md) for more information.
## Contributing
Contributions welcome! See [Contributing](CONTRIBUTING.md).
## Collaborators
- [**Fernando Sirni**](https://github.com/fersirni)
- [**Jose Ramirez**](https://github.com/0xslipk)## License
Licensed under the MIT - see the [LICENSE](LICENSE) file for details.