Giter Club home page Giter Club logo

terra-subgraph's Introduction

Terra Subgraph

Terra 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. 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 for more information.

Contributing

Contributions welcome! See Contributing.

Collaborators

License

Licensed under the MIT - see the LICENSE file for details.

terra-subgraph's People

Contributors

0xslipk avatar fersirni avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.