Code Monkey home page Code Monkey logo

kwenta-subgraph's Issues

Add `FuturesMarginAccount` entity

Add an entity that tracks the margin for each user within each market. The entity will update each time they deposit, withdraw, or modify their position.

  • Added FuturerMarginAccount entity futures subgraph

Investigate PnL calculation

  • Add basic PnL summation to subgraph
  • Verify PnL includes funding
  • Determine if we should have a separate subgraph for the futures competition

Subgraph CI Updates

  • Add separate latest-rates deploy to CI
  • Point Kwenta at new latest-rates endpoint
  • Update main subgraph to exclude latest-rates

Add raw PositionModified Events

Add a handler for the PositionModified events coming from each FuturesMarket contract.

  • Subgraph contains PositionModified entity

Fix Liquidation Pnl

Liquidation position pnl is showing as >100%

Cap liquidation losses to initial margin + total deposits. This occurs when funding is really high or closing price results in excess losses taken by the debt pool.

  • pnlWithFeesPaid is never >100% for a position
  • Implement pnlWithFeesPaid on frontend queries

Discuss Future of Subgraph

  • Investigate what to do once subgraph starts sunsetting hosted service (Q3/22)
  • Investigate alternatives

Set up repo

Deliverables:

  • Remove all subgraphs except futures and latest-rates (candles)
  • Review docs for info that is not relevant to Kwenta subgraphs

Production Subgraph Updates

  • Deploy production subgraph for optimism mainnet
  • Get contract addresses from Synthetix libraries
  • Add fees to position handler
  • Point UI at production subgraph
  • Add conditional statement to point at mainnet vs testnet subgraphs

Update README

Update readme with relevant information for Kwenta. Remove deprecated Synthetix information and entities

Limit order investigation

Collect transactions for limit orders through gelato and plan a way to track open orders and transactions

Add keeper fee to position

Update fees on Next-price order execution

  • Add keeper fee to position and trade entities if NP order executed by keeper

Update orders

  • Change "Pending" state to "Open"
  • Add event handlers for limit order events

Implement decentralized subgraph

  • Set up Kwenta test polygon wallet
  • Manually deploy to decentralized subgraph
  • Check curation and indexing on newly deployed graph

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.