bancorprotocol / carbon-app

https://app.carbondefi.xyz
MIT License
23 stars 14 forks source link

[Overlapping] Graph uses external market price #1321

Closed GrandSchtroumpf closed 2 weeks ago

GrandSchtroumpf commented 3 weeks ago

fix #1320

Strategy with external market price: image

Strategy without external market price image

Note: The text is "Geometric mean", while it's not exactly that when strategy is above/below market. Maybe use "Calculated market price".

Strategy with user market price image

Switching from untouched to touch changes the marginal price: https://github.com/bancorprotocol/carbon-app/assets/8143464/ce548f8d-c799-4b85-bec0-4783b09133e3

cloudflare-pages[bot] commented 3 weeks ago

Deploying carbon-app-sei with  Cloudflare Pages  Cloudflare Pages

Latest commit: bea1be0
Status: ✅  Deploy successful!
Preview URL: https://e7a2bb25.carbon-app-sei.pages.dev
Branch Preview URL: https://issue--1320.carbon-app-sei.pages.dev

View logs

cloudflare-pages[bot] commented 3 weeks ago

Deploying carbon-app with  Cloudflare Pages  Cloudflare Pages

Latest commit: bea1be0
Status: ✅  Deploy successful!
Preview URL: https://261f0c31.carbon-app-csq.pages.dev
Branch Preview URL: https://issue--1320.carbon-app-csq.pages.dev

View logs

ashachaf commented 2 weeks ago

https://github.com/bancorprotocol/carbon-app/assets/40430285/2ddb9d14-cc1a-466a-bbe1-5b931647f31b

updated warning: Warning, the defined market price will be used for strategy budget distribution

image
Costa769 commented 2 weeks ago

flow:

  1. Find concentrated strategy without market price
  2. Click edit prices
  3. Chage the prices via the graph without providing the market price

Expected: User can't update the prices

Actual: User can change the prices of the strategy

flow:

  1. Find concentrated strategy without market price
  2. Click edit prices
  3. Select one of the tokens and click on edit budget without providing the market price
  4. Input deposit amount
  5. Click the checkbox

Expected: CTA becomes enabled

Actual: CTA is disabled and becomes enabled only after user sets the market price

ashachaf commented 2 weeks ago
ashachaf commented 2 weeks ago

updated: {token} market price is missing. Please provide the market price to enable price editing.

Costa769 commented 2 weeks ago

image

Current: We always display difference from market price indicators below the strategy price points, regardless of the presence or absence of a market price. Updated: Show difference from market price indicators only when there is an external market price or market price that was provided by the user. Otherwise, show only the price points without the difference from market price indicators

GrandSchtroumpf commented 2 weeks ago

Manually tested with :

  1. Create an overlapping strategy with tokens with market price
  2. Trade against it
  3. Go to edit price, the graph should display external market price, but marginal price is the current one from the strategy
  4. Try to withdraw without change price or spread, it should use the calculated market price
  5. Withdraw

  6. Create an overlapping strategy with tokens without market price
  7. Trade against it
  8. Go to edit price, the graph should be disabled (you cannot change the price), and the price section is hidden
  9. Withdraw -> it should use calculated market price
  10. Go back to edit price, enter a market price in the input field -> the graph should be enabled and price is available
  11. Withdraw -> it should use the market price you filled in the input