Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pnl bands #947

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Pnl bands #947

wants to merge 13 commits into from

Conversation

KMKoushik
Copy link
Contributor

@KMKoushik KMKoushik commented Jan 24, 2023

Task:

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes ENG-1362

Type of change

  • New feature
  • Bug fix
  • Testing code
  • Document update or config files

@vercel
Copy link

vercel bot commented Jan 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
continuouscall ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 5, 2023 at 11:43PM (UTC)

@linear
Copy link

linear bot commented Jan 25, 2023

ENG-1362 Update PnL Bands to include deposit date to take into account different bands for new users, users depositing after last hedge, and existing users

Screen Shot 2023-01-13 at 4.01.22 PM.png

Screen Shot 2023-01-13 at 4.05.18 PM.png

Qs from the chat:

  1. Is deposit date/time going to be the timestamp of the latest deposit or the first one?
    1. Once a user is in the strategy they all have the same bands, so for an existing user who has multiple deposits into the strategy, we can show the latest deposit timestamp but the bands will be the same for their whole position if wallet connected
    2. For a user who is already in the strategy and deposited after the last hedge, we should show the worse timestamp + bands if wallet connected
  2. For the exact math and formulas, generally the bands should be wider for a new user but have the same center as the existing, and can ask Andrew + Joe on the exact math

Figma:

Date Picker - Switch Order - Crabby testin (Figma)

Copy link
Contributor

@alexisgauba alexisgauba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Some comments:

  • we should also show deposit selector when wallet connected show user knows what date the chart is referring to and also has the ability to play around even when connected
  • we should align deposit date with top of graph

Screen Shot 2023-01-25 at 4 41 02 PM

  • there should be more space between deposit date & next hedge in

Screen Shot 2023-01-25 at 4 40 33 PM

  • realize it looks a bit weird that they are diff fonts, maybe same font size of deposit date and next hedge in, could make next hedge in smaller (same size as the deposit date numbers) and that could help with the alignment as well

  • Looks like graph not updating for dates before the hedge vs. after the hedge

Screen Shot 2023-01-25 at 4 44 43 PM

Screen Shot 2023-01-25 at 4 44 36 PM

Copy link
Contributor

@alexisgauba alexisgauba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Looks like a weird UI thing here

Screen Shot 2023-01-26 at 11 02 20 AM

  • Looks like a loading thing where for a historical date the bands get wider and then thinner - initially it was actually only giving me those wider bands but eventually it started loading the thinner ones
Screen.Recording.2023-01-26.at.11.03.19.AM.mov
  • Prob worth checking with @aleone to make sure calcs all good

@alexisgauba
Copy link
Contributor

We should do this for bull as well! Just noticed its not done there yet - can be finalized for crab first and then copy / pasted over, but imo we shld launch with both

@alexisgauba
Copy link
Contributor

Also for users already in the strategy, the deposit date should be the date they deposited when their wallet is connected. This account has a test position but its showing today's date not deposit date

Screen Shot 2023-01-27 at 5 14 44 PM

const increment = new BigNumber(0.05)
const ending = new BigNumber(percentRange)

const ethRate = Math.exp(ethSupplyApy / (365 / time))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling this rate is a bit confusing, maybe ethFutureValue to be specific

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with usdRate

}
}

export const getBullProfitDataPoints = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should have some naming so it's clear that this is bull excess profit rather than bull total profit. getBullExcessProfitDataPoints() ?

Copy link
Contributor

@alpinechicken alpinechicken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bounds lgtm. Couple of suggestions for naming to make a bit clearer.

@alexisgauba
Copy link
Contributor

Looks like the tooltip is still doin dis weird thing, maybe we want the tooltip above the background stuffs?

Screen Shot 2023-02-02 at 9 28 15 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants