Git Product home page Git Product logo

squeeth-monorepo's People

Contributors

0xmutwo avatar adam5909099 avatar akwritescode avatar aleone avatar alexisgauba avatar alpinechicken avatar antoncoding avatar aparnakr avatar block902 avatar cb-jake avatar daryakaviani avatar demolajames avatar estherseyi avatar ezhou7 avatar haythem96 avatar haythemsellami avatar kmkoushik avatar nikkaroraa avatar reganomalley avatar rootial avatar rootulp avatar rushikeshakhare avatar sanandnarayan avatar wilsoncusack avatar yichiehliu avatar zkoticha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

squeeth-monorepo's Issues

Trade page randomly switched user between long and short

Describe the bug
User had an existing short position and was trying to mint and sell more, but the interface kept switching them between long and short

Expected behavior
If a user is on the short side, keep them on the short side and vice versa for longs.

Screenshots

Screen.Recording.2022-01-21.at.11.35.14.PM.mov

Make "manage vault" clearer on the frontend

Please describe the problem you're having.
Some users aren't aware of the "manage vaults" interface / functionality. Make it clearer to users how to get there

Additional context

  • Could be UI changes to make the button more prominent on the trade page and positions page
  • Could potentially be it's own tab

Re-use user vaults after they fully close them out

Please describe the problem you're having.
Right now if a user fully closes out a vault, and then tries to put on a new position, we a create a new vault. This means they need to re-approve the operator for their new vault, which is an extra gas txn

Too many requests being made to infura/alchemy

Describe the bug

to many calls made to fetch latest block

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'squeeth.com'
    2.Open the network monitor
  2. Look at the calls, you will see that a lot of duplicate calls are being made to infura/alchemy to fetch the latest block

Expected behavior
Do not make too many calls as that means the service provider will give us a 429 error sooner than later

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Add confirmation states to vault cards

Please describe the problem you're having.
Folks were confused about if their mint/burn/add/remove transactions were confirmed because there's currently no confirmation state. We can add a confirmation state just like the Trade page has

During auctions add a warning and disable deposit / withdraw from crab strategy

Please describe the problem you're having.
During hedge auctions, deposits and withdraws are likely to fail because the composition of the vault is changing. During the time period of the auction, display a warning and disable the deposit and withdraw buttons.

Some ideas for warning messages:

  • "Deposits and withdraws available after the auction ends in [insert time]"
  • "Deposits and withdraws are likely to revert while an auction is occurring. Auction ends in [insert time]. We suggest depositing or withdrawing after the auction"

Have a graph showing funding over time

Please describe the problem you're having.
User's often ask about what the current funding rate is and how they can see past funding rates

Screenshots
Applications like dydx show graphs for historical funding

Screen.Recording.2022-01-22.at.6.53.22.PM.mov

Additional context
Could add this graph as a tab on the trade page next to the payoff, risks etc. sections

Refactor: move position hooks to context

Please describe the problem you're having.
move position hooks to context like useTrade did to improve performance

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context or screenshots about the feature request here.

On "full close" for shorts, don't let users partially close

Describe the bug
Right now "full close" on short/close lets you input an amount to close, effectively letting you partially close. This causes issues because users have inputted partial values there but then have been left with a position at min collat ratio of 150%, because to fully close you need 150%

To Reproduce

  1. Open a short position
  2. Go to "short/close" have "Full close" selected and input an amount less than your full short amount and close that amount
  3. Go to the positions tab to see your remaining vault with 150% collateral ratio

Expected behavior

  • If full close is selected, the ETH collateral input should autofill the max amount and should be disabled
  • Users should have to select the "partial close" dropdown to partially close

Get more accurate historical price data

Please describe the problem you're having.
Right now our ethPriceData gives us 5min prices within 1 day, 1 hr prices within 90 days, and daily prices after 90 days. However ETH price can change dramatically within both an hour and a day, so user's PnL could be considerably off. We need to find a price source that gives us as precise historical price data as possible and move to that

Show liquidation price + status on the position card on the trade page for shorts

Please describe the problem you're having.
Make it obvious to users as soon as they enter the trade page what their liquidation price / status is, so they are immediately aware about if they need to take action

Additional context

  • Could add liquidation price and some sort of visual indicator on the position card?
  • If a user is in the danger zone / close to liquidation, maybe have an additional alert to manage their position?

Clarify the restricted countries notification and allow people in restricted countries to still see the data on the app

Please describe the problem you're having.

  • Folks are confused about whether they are restricted or not, so we should clarify the error message
  • Even if folks in restricted countries can't use the app, we can still show them the data and most of them would like to be able to access that

Additional context

  • dYdX does a good job of this, we should have a more specific restricted message
  • We should show users the app even if they are restricted, just disable functionality

Screen Shot 2022-01-11 at 1 46 18 PM

For vault manager actions, add a check with on-chain amounts

Similar to how we have a "final squeeth amount" check for a user's max short squeeth amount for closing shorts, we should have a similar check for vault manager actions

  • For burning, check a user's max burn amount vs. vaults[firstValidVault].shortAmount (the on chain amount)
  • For removing collateral, check a user's max collateral to remove vs. vaults[firstValidVault].collateralAmount (the on chain amount)

The trade page check:

fix: fix short backtest pnl chart and make it workable for crab strategy

Describe the bug
Fix short backtest pnl chart and make it workable for crab strategy

To Reproduce

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Take ETH collateral into account for short PnL

Short PnL is currently calculated as (amt of ETH earned from selling oSQTH) - (amt of ETH to pay to buy oSQTH back) * ETH price, not taking ETH as collateral into account

We should update it to ((amt of ETH earned from selling oSQTH) - (amt of ETH to pay to buy oSQTH back) * ETH price) + (ethDeposited * (ethPriceAtDeposit - ethPriceNow))

Positions don't reload on the positions tab or vault manager

Describe the bug
The positions card and short input are now showing the right value for positions, but it takes those about three reloads to show the right value. The positions tab and vault manager don't reload, so positions doesn't show up at all and vault manager gets stuck showing the wrong value. This is potentially because the LP loading is not taken into account?

Screen Shot 2022-01-15 at 6 08 04 PM

Screen Shot 2022-01-15 at 6 07 52 PM

Screen Shot 2022-01-15 at 6 07 15 PM

To Reproduce

  1. Mint some oSQTH
  2. Add liquidity to LP
  3. Go short
  4. Remove LP liquidity
  5. Check positions card, short / close, positions tab, and vault manager

Expected behavior

  • Positions tab should show a short position with the same value as positions card
  • Vault manager should show the same value as positions card for short debt, and should actually show the minted debt (right now shows 0)
  • Adjust debt max to burn should show the oSqueethBal, not 0

Confirmation on short/open is showing "0 squeeth"

Describe the bug
Confirmation on short/open is showing "0 squeeth"

To Reproduce
Open a short position and wait for the confirmation modal

Expected behavior
Should show the exact amount of squeeth the user went short

Screenshots
Screenshot_2022-01-12_at_11 13 33

Update backtest with live data

  • Use live squeeth data for IV on the backtest from launch onwards
  • Clearly delineate the difference on the graph (maybe the line becomes a different color?)

Users are confused about how to unwind their squeeth position after they close LP positions

  • It's currently not intuitive for users to close out their squeeth position after LP positions
  • If a user bought squeeth and then LPed, they may end with just ETH in which case they don't need to do anything, or they may end with oSQTH which they then need to sell to fully close
  • If a user minted oSQTH, they end with squeeth debt and more oSQTH than debt, in which case they need to burn as much oSQTH as they have debt to redeem their collateral and then sell the remaining, or they end with less oSQTH than they have debt in which case they need to buy more oSQTH and then close out their short
  • It's unclear to a user what exact actions of the above they need to take and where to take them from

Update swaps query to pull from the shortHelper and Uniswap directly

Describe the bug
Right now the swaps query on the short side doesn't consider the Uniswap router, when it should because users manually mint and then sell on Uniswap, or manually buy back on Uniswap to burn

To Reproduce
Manually mint and sell on Uniswap

Expected behavior
Swaps router takes into account txns on Uniswap and properly classifies them as short if mint + sell directly on Uniswap

Need to disable "deposit and sell" button if vaultId hasn't loaded yet

Describe the bug
User deposited and sold some oSQTH, then refreshed the page to sell some more and clicked "deposit and sell" before the page had loaded their vault ID to know that they already had an open vault

This meant they ended up having 2 vaults which is a problem since our interface doesn't support two vaults

To Reproduce

  1. Open a short position
  2. Reload
  3. Immediately go short more

Expected behavior
Disable the "deposit and sell" button until the vaultId has loaded so we know for sure that the page is using the user's existing vault if they have one

Let users deposit and withdraw for crab strategy

Actions, connect to contracts:

  • Deposit (flash)
  • Withdraw (flash)

Show:

  • Amount of ETH putting down
  • Slippage
    • Have a default and allow users to toggle it with a settings icon similar to Trade page
  • Price impact
  • Slippage + price impact warnings if too high

Liquidation price is different on positions tab vs. vault manager

Describe the bug
The liquidation price is showing up differently on the positions tab vs. the vault manager

To Reproduce
Steps to reproduce the behavior:

  1. Open a short position

Expected behavior
Liquidation price should be the same on the positions tab and vault manager

Screenshots
Image 1-20-22 at 11 46 PM
Screen Shot 2022-01-20 at 11 46 47 PM

Show users funding received / funding paid

Please describe the problem you're having.
Users are not clear about how to see how much funding they have paid or received

Additional context
Could add as a field on the positions tab

Price APIs aren't loading for some people + causing the app to crash

Describe the bug
Folks are being 429ed by Coingecko and Messari. When the error is not caught, the whole app errors out

To Reproduce

  1. Go to site
  2. Open console

Note, this isn't happening to everyone, so might not happen to you, but we need to add some error handling

Expected behavior

  • Show the ETH price, maybe we use Uniswap spot as a backup?
  • If all price sources error out, catch the error instead of crashing the app

Screenshots
Screen Shot 2022-01-11 at 12 39 09 PM (1)

Use the correct ETH collateral amount for taking ETH collateral into account for short PnL

Describe the bug
#47 updated the formula for PnL, but uses the wrong data for calculating the ETH collateral portion

  • It is using ETH amount from the Uniswap swap, but that is not the collateral amount, that is the amount the user earns from selling their oSQTH on Uniswap

To Reproduce

  1. Create a short position
  2. Check the unrealized PnL

Expected behavior

  • It should use the amount of collateral the user put down to mint their oSQTH.
  • Additionally, if a user partially closed their position, it should take that into account as well

Unrealized Formula: ((amt of ETH earned from selling oSQTH) - (amt of ETH to pay to buy oSQTH back) * ETH price) + ((initialEthDeposited - any collateral removed)* (ethPriceNow - ethPriceAtDeposit))

As EJ called out below, need to update realized as well

Unrealized PnL for partially closed positions is off

Describe the bug

  • For partially closed positions, unrealized PnL should only take into account the part of the position that wasn't closed yet. Right now unrealized PnL takes into account the users full, initial position, not just what's left over after the partial close. That means unrealized PnL is too high for users after partial closes

To Reproduce
Steps to reproduce the behavior:

  1. Open a long position
  2. Partially close it
  3. Compare the unrealized PnL

Expected behavior
After a partial close, unrealized PnL should only be based on the remaining amount

Show data about the crab strategy to users

  • Collateral ratio of vault
  • Liquidation price of vault
    • Explain why and when liquidations happen, how often they are expected, what % of the vault can be liquidated at one time
  • ETH price
  • Time since last rebalance
  • Total amount deposited in the strategy
  • Strategy cap

Positions page and trade page don't show anything when folks use Gnosis Safe with WalletConnect

Describe the bug

  • When folks use Gnosis Safe with wallet connect, nothing shows up on the positions page or trade page
  • Their positions do show up on the Vault Manager
  • If they connect with the key they used to execute the Gnosis safe transaction, the trade page and positions page surface their position

To Reproduce
Steps to reproduce the behavior:

  1. Create a short position using Gnosis Safe with wallet connect

Expected behavior

  • Show users their position throughout the whole app when signed it with gnosis safe through wallet connect

Show PnL in dollar terms

Please describe the problem you're having.
Right now we show PnL for longs and shorts in eth terms using (ethToClose - ethPaid) * ethPriceNow. Instead we should show PnL in dollar terms using (ethToClose * ethPriceNow) - (ethPaid * ethPriceWhenOpened). We would need to take into account ETH prices for partial closes as well to show that in USD terms

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.