bancorprotocol / carbon-app

https://app.carbondefi.xyz
MIT License
25 stars 17 forks source link

[Overlapping] Use correct market price #1286

Closed tiagofilipenunes closed 2 months ago

tiagofilipenunes commented 2 months ago

Market price for overlapping strategies

Market price definition

User defined market price is defined if user fills the input. Calculated market price is defined if strategy has budget External market price is defined if both token has an entry in coingecko

Market price order

We should always use the market price in this order of importance (if 1 is not defined we use 2, ...) :

Edit price

If price/spread has not changed :

  1. User defined market price
  2. Calculated market price
  3. External market price

If price/spread has changed :

  1. User defined market price
  2. External market price
  3. User defined market price (with warning)

Edit budget

  1. User defined market price
  2. Calculated market price
  3. External market price (with warning)

If there is none of the market prices above is defined, we display the market price input to the user.

cloudflare-pages[bot] commented 2 months ago

Deploying carbon-app-sei with  Cloudflare Pages  Cloudflare Pages

Latest commit: 47c1b7c
Status: ✅  Deploy successful!
Preview URL: https://6104f29b.carbon-app-sei.pages.dev
Branch Preview URL: https://hotfix-no-external-price.carbon-app-sei.pages.dev

View logs

cloudflare-pages[bot] commented 2 months ago

Deploying carbon-app with  Cloudflare Pages  Cloudflare Pages

Latest commit: 47c1b7c
Status: ✅  Deploy successful!
Preview URL: https://9a7a7f14.carbon-app-csq.pages.dev
Branch Preview URL: https://hotfix-no-external-price.carbon-app-csq.pages.dev

View logs

ashachaf commented 2 months ago
ashachaf commented 2 months ago