Giter Site home page Giter Site logo

marginswap-subgraph's People

Contributors

aloaiza-dev avatar jordajm avatar werg avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

levintech

marginswap-subgraph's Issues

Other queries / entities

We want all of the below values per individual token as well as in total converted to USD

  • Total lending
  • Total value held in crossmargin
  • Total value locked: max of total value in lending and cross margin accounts
  • Daily trading volume: sum of all trades per day or for the last 24 hours
  • Also if possible each individual swaps for exchange trackers like coinmarketcap and coingecko (ask dr o)
  • Lending interest rate
  • Borrowing interest rate

Cumulative Incentive claims

We want to compute how much MFI incentive a user gets. The addToClaim and subtractFromClaim events are our basis for this calculation. For now we want to retrieve for every user, for every token they hold, the cumulative claim that they have.

Ultimately we will need to accumulate the claim balance in the following manner:

  • we have variables ongoingClaim and cumulativeClaimBalance, starting at 0, as well as lastUpdatedTimestamp
  • for either event compute the cumulativeClaimBalance += ongoingClaim * (currentTime - lastUpdatedTimestamp)
  • if it's an addToClaim we add the amount to ongoingClaim
  • otherwise we subtract

In my understanding there possibly are two ways to do this:

  • we make our graphql mapping very simple, basically just forwarding the event and then we do the agglomerative math in post-query logic
  • we integrate this into the mapping and present a claim-per-token entity to the client

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.