Git Product home page Git Product logo

pwn-subgraph's Introduction

PWN Subgraph

This repository contains the code for PWN Subgraph. The latest version of this subgraph can be explored at https://api.studio.thegraph.com/query/25077/pwn/version/latest. There is a simple frontend that uses this subgraph at https://spitko.github.io/pwn-subgraph/.

Example queries

All loans

query Loans {
  loans(orderBy: createdDate, orderDirection: desc) {
    id
    borrower {
      id
    }
    lender {
      id
    }
    expiration
    status
    collateral {
      id
      category
      token {
        name
        symbol
        decimals
      }
    }
    collateralAmount
    collateralTokenId
    borrowAsset {
      id
      category
      token {
        name
        symbol
        decimals
      }
    }
    loanPaidBackEvents {
      transactionHash
    }
    borrowAmount
    repayAmount
    createdDate
    repaidDate
  }
}

Accounts that have borrowed the most times

{
  accounts(orderBy:totalBorrowedLoans, orderDirection:desc) {
    id
    totalLendedLoans
    totalBorrowedLoans
  }
}

Accounts with active loans at a specific block

{
  accounts(block: {number:19999284} where:{borrowed_: {status: RUNNING}}) {
    id
    borrowed {
      id
      expiration
      status
      collateral {
        id
      }
      collateralAmount
      collateralTokenId
      borrowAsset {
        id
      }
    }
    totalBorrowedLoans
  }
}

pwn-subgraph's People

Contributors

spitko avatar

Stargazers

microHoffman avatar

Watchers

 avatar

Forkers

taskvault

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.