Skip to content

Commit

Permalink
Deploy price chart to production 🤝 (#361)
Browse files Browse the repository at this point in the history
* fix strategies list value + minor text changesB (#198)

Signed-off-by: belbazanas <[email protected]>

* Fix/asana kandel fixes 1 (#199)

* fix strategies list value + minor text changesB

Signed-off-by: belbazanas <[email protected]>

* fix total inventory and update strategies row click redirection

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Fix/edit kandel strategy (#200)

* fix edit strategy hook + decimals in dialogs

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* add metadatas and change points banner text

* Refactor all strategies page to use no. of offers instead of no. of price points

* Fix spread calculation in orderbook.tsx to avoid negative values

* fix level if the user is level 5

* Remove unused code related to priceRatio (#202)

* Remove unused code related to priceRatio

Signed-off-by: belbazanas <[email protected]>

* redirect to edit strategy from strategy list

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* remove the junk

* fix indexer sdk (#204)

* Fix/minor kandel fixes (#205)

* Update button labels in EditStrategyDialog and useForm

Signed-off-by: belbazanas <[email protected]>

* Update parameters table to display step size and locked bounty

Signed-off-by: belbazanas <[email protected]>

* Update history and parameters components

Signed-off-by: belbazanas <[email protected]>

* Update launch strategy button label to Publish

Signed-off-by: belbazanas <[email protected]>

* Add source icon for pacFinance

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Update close strategy dialog message (#206)

Signed-off-by: belbazanas <[email protected]>

* Fix bounty deposit validation (#207)

Signed-off-by: belbazanas <[email protected]>

* Fix/kandel closed strategies (#208)

* Update leaderboard table, change header from Return (%) to PnL (%). Update lockedBounty display in parameters table.

Signed-off-by: belbazanas <[email protected]>

* Remove AverageReturn component from PriceRange

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* diable strategies

Signed-off-by: belbazanas <[email protected]>

* Update table headers, disable close strategy if no live offers, remove wrong tooltips (#213)

Signed-off-by: belbazanas <[email protected]>

* Remove console.log statements

Signed-off-by: belbazanas <[email protected]>

* show boosts (#215)

Co-authored-by: Johan le Roch <[email protected]>
Co-authored-by: Anas <[email protected]>

* Fix/points volume message (#216)

* show boosts

* show nft boosts

* show boost value returned by /points endpoint

* fix zod conversion error

* show message

* revert points update message

---------

Co-authored-by: Johan le Roch <[email protected]>

* Update navbar.tsx, disable strategies in production

* enable strategies tab on staging

Signed-off-by: belbazanas <[email protected]>

* Add warning banner component to strategy layout

Signed-off-by: belbazanas <[email protected]>

* Update warning banner close button styling

Signed-off-by: belbazanas <[email protected]>

* Fix typo in base deposit error message

Signed-off-by: belbazanas <[email protected]>

* Add market selector component and update info bar component, testing feeback fixes

Signed-off-by: belbazanas <[email protected]>

* Update useForm hook to reset form fields when market changes

Signed-off-by: belbazanas <[email protected]>

* update strategy warning banner message

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* Update 'No. of offers' to 'Nb. of offers' in various components

Signed-off-by: belbazanas <[email protected]>

* Do workaround to merge nft and volume points on the FE

* Add usePnL hook and update components to display pnl data

Signed-off-by: belbazanas <[email protected]>

* Fix build issue

* Refactor use-parameters and unrealized-pnl components

Signed-off-by: belbazanas <[email protected]>

* Refactor useParameters function to handle pnlQuote and returnRate with market symbol

Signed-off-by: belbazanas <[email protected]>

* bump mangrove.js (#229)

* Update navbar.tsx

* Add useResolveWhenBlockIsIndexed hook to useEditKandelStrategy (#224)

Signed-off-by: belbazanas <[email protected]>

* enable strategies on staging

Signed-off-by: belbazanas <[email protected]>

* review gasreq for minvolume on kandel strategies

Signed-off-by: belbazanas <[email protected]>

* Feat/withdrawable inventory (#233)

* Add withdrawable balance feature

Signed-off-by: belbazanas <[email protected]>

* pnl fix

* change namming

* Fix inventory order in parameters component

Signed-off-by: belbazanas <[email protected]>

* Fix withdrawal button disabled logic

Signed-off-by: belbazanas <[email protected]>

* fix withdraw balance button disabling condition

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

* Fix display issue for closed pnlQuote and returnRate

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: Johan le Roch <[email protected]>

* fix withdraw balance format

Signed-off-by: belbazanas <[email protected]>

* fix distribution reactivity

Signed-off-by: belbazanas <[email protected]>

* Update warning banner styling and functionality

Signed-off-by: belbazanas <[email protected]>

* Update pnlQuote and returnRate values

Signed-off-by: belbazanas <[email protected]>

* hide pnl value

Signed-off-by: belbazanas <[email protected]>

* Add parametersHistory schema and update related components

Signed-off-by: belbazanas <[email protected]>

* Fix display issue in useParametersTable and update steps in EditStrategyDialog

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

* epoch on tables

* fix

* fix texts

* fix gas issues

* Fix edit LO orders + Refactor code to fix display issues

Signed-off-by: belbazanas <[email protected]>

* Feat/strategy liquidity sourcing (#241)

* add LS to new kandel strategy

Signed-off-by: belbazanas <[email protected]>

* add liquidity sourcing in edit, hide liquidity sourcing infos waiting for sdk

Signed-off-by: belbazanas <[email protected]>

* Fix liquidity sourcing token allowance query + Refactor code

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* update SDK to overestimate gas estimation for kandels

Signed-off-by: belbazanas <[email protected]>

* fix chart

* fix token symbol on price range chart

* Enable from the start the liquidity sourcing fields in strategies/new component

Signed-off-by: belbazanas <[email protected]>

* remove unused code

Signed-off-by: belbazanas <[email protected]>

* fix edit strategy useForm hook to set default values

Signed-off-by: belbazanas <[email protected]>

* Feat/epoc leaderboard (#251)

* WIP

* end epoch leaderboard

* adapt zod epoch model

* Hide boost column from total tab

* chore: Refactor use-liquidity-sourcing.ts to use react-query for data fetching

Signed-off-by: belbazanas <[email protected]>

* epoch / leaderboard

* fix build

* refactor points page

* chore: Refactor strategies list search input component and add sorting functionality

Signed-off-by: belbazanas <[email protected]>

* save wip

Signed-off-by: belbazanas <[email protected]>

* chore: Refactor use-parameters.ts to handle upcoming values for pnlQuote and returnRate

Signed-off-by: belbazanas <[email protected]>

* update pnpm

* Update volumes and boost to use new API (#254)

* Add new data for boosts/volumes

* Use volume not points for MS1 banner

* Revert "Update volumes and boost to use new API (#254)" (#256)

This reverts commit 64831ae.

* Fix/volumes and boosts (#255)

* Add new data for boosts/volumes

* Use volume not points for MS1 banner

---------

Co-authored-by: Daniel <[email protected]>

* call the price api and delay the indexer sdk until the usdb prices are fetched (#253)

* temporary remove liquidity sourcing

Signed-off-by: belbazanas <[email protected]>

* update edit base/quote deposit inputs decimals

Signed-off-by: belbazanas <[email protected]>

* fix nextjs version

* Feat/new sdk kandel (#260)

* feat: new sdk

* progress

* feat: continue

* new sdk - save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk wip market/limit orders

Signed-off-by: belbazanas <[email protected]>

* new sdk - retract order

Signed-off-by: belbazanas <[email protected]>

* update new sdk, chores

Signed-off-by: belbazanas <[email protected]>

* new sdk save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - project building and limit/market orders working :)

Signed-off-by: belbazanas <[email protected]>

* new sdk - kandel wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - kandel wip

Signed-off-by: belbazanas <[email protected]>

* new kandel - fix build

Signed-off-by: belbazanas <[email protected]>

* new kandel - fix build

Signed-off-by: belbazanas <[email protected]>

* Market simulation estimatedFrom send input

* compute estimation from receive field

* new kandel - fix creation

Signed-off-by: belbazanas <[email protected]>

* kandel - save wip

Signed-off-by: belbazanas <[email protected]>

* end market order refactor + refresh balances

* wip market / limit refactor

* new sdk edit kandel

Signed-off-by: belbazanas <[email protected]>

* new sdk fix build

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* remove frozen lock file

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: Maxence Raballand <[email protected]>
Co-authored-by: belbazanas <[email protected]>

* remove amplifed orders (#263)

* remove amplifed orders

Signed-off-by: belbazanas <[email protected]>

* Update join-program-banner.tsx

---------

Signed-off-by: belbazanas <[email protected]>

* fix kandel page display

Signed-off-by: belbazanas <[email protected]>

* fix kandel page display

Signed-off-by: belbazanas <[email protected]>

* fix kandel creation

Signed-off-by: belbazanas <[email protected]>

* fix kandel creation

Signed-off-by: belbazanas <[email protected]>

* fix kandel market selector

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* add error message in post market order

Signed-off-by: belbazanas <[email protected]>

* add table to vaults list

Signed-off-by: belbazanas <[email protected]>

* vault ui implementation

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* vault UI enhancements

Signed-off-by: belbazanas <[email protected]>

* fix logics icons + delete unused code

Signed-off-by: belbazanas <[email protected]>

* fix default limit order price

Signed-off-by: belbazanas <[email protected]>

* fix default limit order price bug

Signed-off-by: belbazanas <[email protected]>

* feat: list

* kandel fix: display offers in price range chart

Signed-off-by: belbazanas <[email protected]>

* feat: add page

* feat: advance

* feat: advance

* add vault dialogs

Signed-off-by: belbazanas <[email protected]>

* vault remove liquidity dialog update

Signed-off-by: belbazanas <[email protected]>

* temporary fix vaults list query

Signed-off-by: belbazanas <[email protected]>

* temporary fix vault query

Signed-off-by: belbazanas <[email protected]>

* kandel: fix price chart dots

Signed-off-by: belbazanas <[email protected]>

* feat: advance

* feat: advance

* feat: advance

* limit order: fix default price (#270)

Signed-off-by: belbazanas <[email protected]>

* Fix/cancel limit order (#271)

* limit order: fix default price

Signed-off-by: belbazanas <[email protected]>

* limit order: fix cancel order

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* fix: max amounts and errors in ABI
- Added test Skate vault

* Feat/base testnet (#272)

* baseTestnet: remove old mgv sdk + comment amplified order files

Signed-off-by: belbazanas <[email protected]>

* implement baseTestnet + faucet

Signed-off-by: belbazanas <[email protected]>

* remove old sdk mergedOffers save wip

Signed-off-by: belbazanas <[email protected]>

* BaseTestnet implementation wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove error on first load

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Feat/base testnet (#273)

* baseTestnet: remove old mgv sdk + comment amplified order files

Signed-off-by: belbazanas <[email protected]>

* implement baseTestnet + faucet

Signed-off-by: belbazanas <[email protected]>

* remove old sdk mergedOffers save wip

Signed-off-by: belbazanas <[email protected]>

* BaseTestnet implementation wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove error on first load

Signed-off-by: belbazanas <[email protected]>

* remove last old SDK traces

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* cleanup

* zod schema for total points

* navbar: remove posthog check for strategies

Signed-off-by: belbazanas <[email protected]>

* Feat/base testnet (#276)

* baseTestnet: remove old mgv sdk + comment amplified order files

Signed-off-by: belbazanas <[email protected]>

* implement baseTestnet + faucet

Signed-off-by: belbazanas <[email protected]>

* remove old sdk mergedOffers save wip

Signed-off-by: belbazanas <[email protected]>

* BaseTestnet implementation wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove error on first load

Signed-off-by: belbazanas <[email protected]>

* remove last old SDK traces

Signed-off-by: belbazanas <[email protected]>

* trade: refresh tabs on market update + remove amplified table

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* feat: vault

* Feat/strategy ls fixes (#277)

* kandel: re-activate liquidity sourcing

Signed-off-by: belbazanas <[email protected]>

* kandel: detail page wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove strategyQuery from priceRange overview

Signed-off-by: belbazanas <[email protected]>

* kandel: total inventory display, remove mangrove.jspackage

Signed-off-by: belbazanas <[email protected]>

* trade: fix limit order default price

Signed-off-by: belbazanas <[email protected]>

* kandel: fix edit workflow wip

Signed-off-by: belbazanas <[email protected]>

* retractParams: add type

Signed-off-by: belbazanas <[email protected]>

* kandel: fix retract offers

Signed-off-by: belbazanas <[email protected]>

* kandel: fix edit strat

Signed-off-by: belbazanas <[email protected]>

* kandel: strategies list save wip

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Fix build

* kandel: refetch strategy list on close (#278)

* kandel: refetch strategy list on close

Signed-off-by: belbazanas <[email protected]>

* remove log

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* fix computeReceiveAmount

* fix computeSendAmount

* Fix/last minutes fixes (#279)

* kandel: refetch strategy list on close

Signed-off-by: belbazanas <[email protected]>

* remove log

Signed-off-by: belbazanas <[email protected]>

* kandel-trade: fixes

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

* fix parseUnits

* trade: disable cancel offer

Signed-off-by: belbazanas <[email protected]>

* add usde token logo

* fix: change skate vault list (#280)

* fix: change skate vault list

* chore: revert lockfile change

* trade: mute edit order

Signed-off-by: belbazanas <[email protected]>

* vaul: minor changes

Signed-off-by: belbazanas <[email protected]>

* vaul: minor changes

Signed-off-by: belbazanas <[email protected]>

* vaul: remove Big.js in strategies

Signed-off-by: belbazanas <[email protected]>

* ENG-268: Fix slider value calculation in Limit component (#293)

* ENG-268: Fix slider value calculation in Limit component

The commit fixes the calculation of the slider value in the Limit component. It now correctly calculates the value based on the send balance and send amount.

* fix: market order slider inout

Signed-off-by: belbazanas <[email protected]>

* refactor: minor refacto

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: belbazanas <[email protected]>

* strategy: enable close strategy in all cases (#297)

* Feat/strategy current provision (#298)

* improve initial zoom (#303)

* improve initial zoom

* cleaning some logs

* cleaning some logs

* try to fix top gap on layout with some extensions (#300)

* eng-299: update sdk to display 4 decimals to USD prices (#302)

* ENG-269: Fix percentage bar error (market) (#295)

Co-authored-by: Johan le Roch <[email protected]>

* add blast token

* update mgv sdk

* Synapse Widget (#296) (#309)

* Synapse Widget (#296)

* add feedbacks

Signed-off-by: belbazanas <[email protected]>

* update amplified tables after edit + feedbacks

Signed-off-by: belbazanas <[email protected]>

* close sheet after edit dialog

Signed-off-by: belbazanas <[email protected]>

* display errors in bottom
amplifed form

Signed-off-by: belbazanas <[email protected]>

* ui minor changes

Signed-off-by: belbazanas <[email protected]>

* update mangrove sdk+ add expiry date in tables and sheet

Signed-off-by: belbazanas <[email protected]>

* re-arrange the toast messages

Signed-off-by: belbazanas <[email protected]>

* Debug kandel

* fix errors

* fixes

* edit expiry date

Signed-off-by: belbazanas <[email protected]>

* replace retracted by cancelled

Signed-off-by: belbazanas <[email protected]>

* WIP dialog improvements

* check if atleast one offer is open

Signed-off-by: belbazanas <[email protected]>

* add chain id as a dependency to 'strategies' query

* fix maxPrice

* parameters values improvements

* bounty tooltip

* check if atleast one offer is open

Signed-off-by: belbazanas <[email protected]>

* save wip

Signed-off-by: belbazanas <[email protected]>

* unwrap eth v1 (#187)

Signed-off-by: belbazanas <[email protected]>

* optimize orbit image

* save wip

Signed-off-by: belbazanas <[email protected]>

* invalidate offers query

Signed-off-by: belbazanas <[email protected]>

* save wip

Signed-off-by: belbazanas <[email protected]>

* save wip

Signed-off-by: belbazanas <[email protected]>

* save wip

Signed-off-by: belbazanas <[email protected]>

* add status to strateiges list

Signed-off-by: belbazanas <[email protected]>

* update amplifyOrder documentation link (#195)

Signed-off-by: belbazanas <[email protected]>

* fix strategies list status

Signed-off-by: belbazanas <[email protected]>

* Plug Incentives api wip

* save update after refill progress

Signed-off-by: belbazanas <[email protected]>

* end points

* enable the menu

* fix build

* edit kandel strategy + re-open

Signed-off-by: belbazanas <[email protected]>

* Add community points and boosts informations into Page points

* remove re-fill row + fix build

Signed-off-by: belbazanas <[email protected]>

* Update form legend and reward display, fix information banner text, and redirect after successful edit

Signed-off-by: belbazanas <[email protected]>

* Refactor leaderboard table and use-table components

* Remove console.log statements and improve boost page

* Add pagination to leaderboard

* Points page: Tables loading improvements, separate user table from leaderboard table and add link to doc

* add total count of traders

* add kandel smart router in UI + fixes (#197)

* Update strategy type to smart in multiple files

Signed-off-by: belbazanas <[email protected]>

* update mangrove sdk and indexer,add strategy smart router hooks,  add new kandel type, update default values

Signed-off-by: belbazanas <[email protected]>

* update overall logics types for build

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* fix strategies list value + minor text changesB (#198)

Signed-off-by: belbazanas <[email protected]>

* Fix/asana kandel fixes 1 (#199)

* fix strategies list value + minor text changesB

Signed-off-by: belbazanas <[email protected]>

* fix total inventory and update strategies row click redirection

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Fix/edit kandel strategy (#200)

* fix edit strategy hook + decimals in dialogs

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* add metadatas and change points banner text

* Refactor all strategies page to use no. of offers instead of no. of price points

* Fix spread calculation in orderbook.tsx to avoid negative values

* fix level if the user is level 5

* Remove unused code related to priceRatio (#202)

* Remove unused code related to priceRatio

Signed-off-by: belbazanas <[email protected]>

* redirect to edit strategy from strategy list

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* remove the junk

* fix indexer sdk (#204)

* Fix/minor kandel fixes (#205)

* Update button labels in EditStrategyDialog and useForm

Signed-off-by: belbazanas <[email protected]>

* Update parameters table to display step size and locked bounty

Signed-off-by: belbazanas <[email protected]>

* Update history and parameters components

Signed-off-by: belbazanas <[email protected]>

* Update launch strategy button label to Publish

Signed-off-by: belbazanas <[email protected]>

* Add source icon for pacFinance

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Update close strategy dialog message (#206)

Signed-off-by: belbazanas <[email protected]>

* Fix bounty deposit validation (#207)

Signed-off-by: belbazanas <[email protected]>

* Fix/kandel closed strategies (#208)

* Update leaderboard table, change header from Return (%) to PnL (%). Update lockedBounty display in parameters table.

Signed-off-by: belbazanas <[email protected]>

* Remove AverageReturn component from PriceRange

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* diable strategies

Signed-off-by: belbazanas <[email protected]>

* Update table headers, disable close strategy if no live offers, remove wrong tooltips (#213)

Signed-off-by: belbazanas <[email protected]>

* Remove console.log statements

Signed-off-by: belbazanas <[email protected]>

* show boosts (#215)

Co-authored-by: Johan le Roch <[email protected]>
Co-authored-by: Anas <[email protected]>

* Fix/points volume message (#216)

* show boosts

* show nft boosts

* show boost value returned by /points endpoint

* fix zod conversion error

* show message

* revert points update message

---------

Co-authored-by: Johan le Roch <[email protected]>

* Update navbar.tsx, disable strategies in production

* enable strategies tab on staging

Signed-off-by: belbazanas <[email protected]>

* Add warning banner component to strategy layout

Signed-off-by: belbazanas <[email protected]>

* Update warning banner close button styling

Signed-off-by: belbazanas <[email protected]>

* Fix typo in base deposit error message

Signed-off-by: belbazanas <[email protected]>

* Add market selector component and update info bar component, testing feeback fixes

Signed-off-by: belbazanas <[email protected]>

* Update useForm hook to reset form fields when market changes

Signed-off-by: belbazanas <[email protected]>

* update strategy warning banner message

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* Update 'No. of offers' to 'Nb. of offers' in various components

Signed-off-by: belbazanas <[email protected]>

* Do workaround to merge nft and volume points on the FE

* Add usePnL hook and update components to display pnl data

Signed-off-by: belbazanas <[email protected]>

* Fix build issue

* Refactor use-parameters and unrealized-pnl components

Signed-off-by: belbazanas <[email protected]>

* Refactor useParameters function to handle pnlQuote and returnRate with market symbol

Signed-off-by: belbazanas <[email protected]>

* bump mangrove.js (#229)

* Update navbar.tsx

* Add useResolveWhenBlockIsIndexed hook to useEditKandelStrategy (#224)

Signed-off-by: belbazanas <[email protected]>

* enable strategies on staging

Signed-off-by: belbazanas <[email protected]>

* review gasreq for minvolume on kandel strategies

Signed-off-by: belbazanas <[email protected]>

* Feat/withdrawable inventory (#233)

* Add withdrawable balance feature

Signed-off-by: belbazanas <[email protected]>

* pnl fix

* change namming

* Fix inventory order in parameters component

Signed-off-by: belbazanas <[email protected]>

* Fix withdrawal button disabled logic

Signed-off-by: belbazanas <[email protected]>

* fix withdraw balance button disabling condition

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

* Fix display issue for closed pnlQuote and returnRate

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: Johan le Roch <[email protected]>

* fix withdraw balance format

Signed-off-by: belbazanas <[email protected]>

* fix distribution reactivity

Signed-off-by: belbazanas <[email protected]>

* Update warning banner styling and functionality

Signed-off-by: belbazanas <[email protected]>

* Update pnlQuote and returnRate values

Signed-off-by: belbazanas <[email protected]>

* hide pnl value

Signed-off-by: belbazanas <[email protected]>

* Add parametersHistory schema and update related components

Signed-off-by: belbazanas <[email protected]>

* Fix display issue in useParametersTable and update steps in EditStrategyDialog

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

* epoch on tables

* fix

* fix texts

* fix gas issues

* Fix edit LO orders + Refactor code to fix display issues

Signed-off-by: belbazanas <[email protected]>

* Feat/strategy liquidity sourcing (#241)

* add LS to new kandel strategy

Signed-off-by: belbazanas <[email protected]>

* add liquidity sourcing in edit, hide liquidity sourcing infos waiting for sdk

Signed-off-by: belbazanas <[email protected]>

* Fix liquidity sourcing token allowance query + Refactor code

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* update SDK to overestimate gas estimation for kandels

Signed-off-by: belbazanas <[email protected]>

* fix chart

* fix token symbol on price range chart

* Enable from the start the liquidity sourcing fields in strategies/new component

Signed-off-by: belbazanas <[email protected]>

* remove unused code

Signed-off-by: belbazanas <[email protected]>

* fix edit strategy useForm hook to set default values

Signed-off-by: belbazanas <[email protected]>

* Feat/epoc leaderboard (#251)

* WIP

* end epoch leaderboard

* adapt zod epoch model

* Hide boost column from total tab

* chore: Refactor use-liquidity-sourcing.ts to use react-query for data fetching

Signed-off-by: belbazanas <[email protected]>

* epoch / leaderboard

* fix build

* refactor points page

* chore: Refactor strategies list search input component and add sorting functionality

Signed-off-by: belbazanas <[email protected]>

* save wip

Signed-off-by: belbazanas <[email protected]>

* chore: Refactor use-parameters.ts to handle upcoming values for pnlQuote and returnRate

Signed-off-by: belbazanas <[email protected]>

* update pnpm

* Update volumes and boost to use new API (#254)

* Add new data for boosts/volumes

* Use volume not points for MS1 banner

* Revert "Update volumes and boost to use new API (#254)" (#256)

This reverts commit 64831ae.

* Fix/volumes and boosts (#255)

* Add new data for boosts/volumes

* Use volume not points for MS1 banner

---------

Co-authored-by: Daniel <[email protected]>

* call the price api and delay the indexer sdk until the usdb prices are fetched (#253)

* temporary remove liquidity sourcing

Signed-off-by: belbazanas <[email protected]>

* update edit base/quote deposit inputs decimals

Signed-off-by: belbazanas <[email protected]>

* fix nextjs version

* Feat/new sdk kandel (#260)

* feat: new sdk

* progress

* feat: continue

* new sdk - save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk wip market/limit orders

Signed-off-by: belbazanas <[email protected]>

* new sdk - retract order

Signed-off-by: belbazanas <[email protected]>

* update new sdk, chores

Signed-off-by: belbazanas <[email protected]>

* new sdk save wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - project building and limit/market orders working :)

Signed-off-by: belbazanas <[email protected]>

* new sdk - kandel wip

Signed-off-by: belbazanas <[email protected]>

* new sdk - kandel wip

Signed-off-by: belbazanas <[email protected]>

* new kandel - fix build

Signed-off-by: belbazanas <[email protected]>

* new kandel - fix build

Signed-off-by: belbazanas <[email protected]>

* Market simulation estimatedFrom send input

* compute estimation from receive field

* new kandel - fix creation

Signed-off-by: belbazanas <[email protected]>

* kandel - save wip

Signed-off-by: belbazanas <[email protected]>

* end market order refactor + refresh balances

* wip market / limit refactor

* new sdk edit kandel

Signed-off-by: belbazanas <[email protected]>

* new sdk fix build

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* remove frozen lock file

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: Maxence Raballand <[email protected]>
Co-authored-by: belbazanas <[email protected]>

* remove amplifed orders (#263)

* remove amplifed orders

Signed-off-by: belbazanas <[email protected]>

* Update join-program-banner.tsx

---------

Signed-off-by: belbazanas <[email protected]>

* fix kandel page display

Signed-off-by: belbazanas <[email protected]>

* fix kandel page display

Signed-off-by: belbazanas <[email protected]>

* fix kandel creation

Signed-off-by: belbazanas <[email protected]>

* fix kandel creation

Signed-off-by: belbazanas <[email protected]>

* fix kandel market selector

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* add error message in post market order

Signed-off-by: belbazanas <[email protected]>

* add table to vaults list

Signed-off-by: belbazanas <[email protected]>

* vault ui implementation

Signed-off-by: belbazanas <[email protected]>

* fix build

Signed-off-by: belbazanas <[email protected]>

* vault UI enhancements

Signed-off-by: belbazanas <[email protected]>

* fix logics icons + delete unused code

Signed-off-by: belbazanas <[email protected]>

* fix default limit order price

Signed-off-by: belbazanas <[email protected]>

* fix default limit order price bug

Signed-off-by: belbazanas <[email protected]>

* feat: list

* kandel fix: display offers in price range chart

Signed-off-by: belbazanas <[email protected]>

* feat: add page

* feat: advance

* feat: advance

* add vault dialogs

Signed-off-by: belbazanas <[email protected]>

* vault remove liquidity dialog update

Signed-off-by: belbazanas <[email protected]>

* temporary fix vaults list query

Signed-off-by: belbazanas <[email protected]>

* temporary fix vault query

Signed-off-by: belbazanas <[email protected]>

* kandel: fix price chart dots

Signed-off-by: belbazanas <[email protected]>

* feat: advance

* feat: advance

* feat: advance

* limit order: fix default price (#270)

Signed-off-by: belbazanas <[email protected]>

* Fix/cancel limit order (#271)

* limit order: fix default price

Signed-off-by: belbazanas <[email protected]>

* limit order: fix cancel order

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* fix: max amounts and errors in ABI
- Added test Skate vault

* Feat/base testnet (#272)

* baseTestnet: remove old mgv sdk + comment amplified order files

Signed-off-by: belbazanas <[email protected]>

* implement baseTestnet + faucet

Signed-off-by: belbazanas <[email protected]>

* remove old sdk mergedOffers save wip

Signed-off-by: belbazanas <[email protected]>

* BaseTestnet implementation wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove error on first load

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Feat/base testnet (#273)

* baseTestnet: remove old mgv sdk + comment amplified order files

Signed-off-by: belbazanas <[email protected]>

* implement baseTestnet + faucet

Signed-off-by: belbazanas <[email protected]>

* remove old sdk mergedOffers save wip

Signed-off-by: belbazanas <[email protected]>

* BaseTestnet implementation wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove error on first load

Signed-off-by: belbazanas <[email protected]>

* remove last old SDK traces

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* cleanup

* zod schema for total points

* navbar: remove posthog check for strategies

Signed-off-by: belbazanas <[email protected]>

* Feat/base testnet (#276)

* baseTestnet: remove old mgv sdk + comment amplified order files

Signed-off-by: belbazanas <[email protected]>

* implement baseTestnet + faucet

Signed-off-by: belbazanas <[email protected]>

* remove old sdk mergedOffers save wip

Signed-off-by: belbazanas <[email protected]>

* BaseTestnet implementation wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove error on first load

Signed-off-by: belbazanas <[email protected]>

* remove last old SDK traces

Signed-off-by: belbazanas <[email protected]>

* trade: refresh tabs on market update + remove amplified table

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* feat: vault

* Feat/strategy ls fixes (#277)

* kandel: re-activate liquidity sourcing

Signed-off-by: belbazanas <[email protected]>

* kandel: detail page wip

Signed-off-by: belbazanas <[email protected]>

* kandel: remove strategyQuery from priceRange overview

Signed-off-by: belbazanas <[email protected]>

* kandel: total inventory display, remove mangrove.jspackage

Signed-off-by: belbazanas <[email protected]>

* trade: fix limit order default price

Signed-off-by: belbazanas <[email protected]>

* kandel: fix edit workflow wip

Signed-off-by: belbazanas <[email protected]>

* retractParams: add type

Signed-off-by: belbazanas <[email protected]>

* kandel: fix retract offers

Signed-off-by: belbazanas <[email protected]>

* kandel: fix edit strat

Signed-off-by: belbazanas <[email protected]>

* kandel: strategies list save wip

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Fix build

* kandel: refetch strategy list on close (#278)

* kandel: refetch strategy list on close

Signed-off-by: belbazanas <[email protected]>

* remove log

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* fix computeReceiveAmount

* fix computeSendAmount

* Fix/last minutes fixes (#279)

* kandel: refetch strategy list on close

Signed-off-by: belbazanas <[email protected]>

* remove log

Signed-off-by: belbazanas <[email protected]>

* kandel-trade: fixes

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

* fix parseUnits

* trade: disable cancel offer

Signed-off-by: belbazanas <[email protected]>

* add usde token logo

* fix: change skate vault list (#280)

* fix: change skate vault list

* chore: revert lockfile change

* trade: mute edit order

Signed-off-by: belbazanas <[email protected]>

* vaul: minor changes

Signed-off-by: belbazanas <[email protected]>

* vaul: minor changes

Signed-off-by: belbazanas <[email protected]>

* vaul: remove Big.js in strategies

Signed-off-by: belbazanas <[email protected]>

* ENG-268: Fix slider value calculation in Limit component (#293)

* ENG-268: Fix slider value calculation in Limit component

The commit fixes the calculation of the slider value in the Limit component. It now correctly calculates the value based on the send balance and send amount.

* fix: market order slider inout

Signed-off-by: belbazanas <[email protected]>

* refactor: minor refacto

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: belbazanas <[email protected]>

* Synapse Widget

* Custom Rpcs

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: belbazanas <[email protected]>
Co-authored-by: Johan le Roch <[email protected]>
Co-authored-by: Mangrove Automation Bot <[email protected]>
Co-authored-by: Maxence Raballand <[email protected]>
Co-authored-by: Daniel <[email protected]>

* Add tab

* switch to provider

* Add blast as target chain

* refactor bridge page to handle network unsupported by the dApp for bridging

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: bigboydiamonds <[email protected]>
Co-authored-by: belbazanas <[email protected]>
Co-authored-by: Johan le Roch <[email protected]>
Co-authored-by: Mangrove Automation Bot <[email protected]>
Co-authored-by: Daniel <[email protected]>

* merge offers with same price on the orderbook

* Fix/eng 242 (#313)

* disable auto scroll when the user has scrolled

* eng-242: disable auto scroll when the user has scrolled

* Feat/eng 325 (#314)

* eng-325 move bridge to drop down menu

* rename bridge assets

* Add custom switch chain dialog (#316)

* WIP - Draft

* refactoring

* Refactor

* add cronos

* end mecanism

* Dialog styling

* end custom chain dialog

* fix build

* ENG-265: fix edit limit order (#299)

* trade: fix edit limit order

Signed-off-by: belbazanas <[email protected]>

* trade: save edit order wip

Signed-off-by: belbazanas <[email protected]>

* trade: edit limit order wip

Signed-off-by: belbazanas <[email protected]>

* add logs

Signed-off-by: belbazanas <[email protected]>

* ENG-265: fix edit limit order

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* ENG-267: update mangrove sdk to fix strategy min price points (#320)

Signed-off-by: belbazanas <[email protected]>

* ENG-278: remove create strat when on passive strategy tab (#319)

Signed-off-by: belbazanas <[email protected]>

* hide ms1 program banner (#322)

* eng-326: add overlay (#323)

* add return buttons to modal steps (#318)

Signed-off-by: belbazanas <[email protected]>

* Feat/eng 354 (#325)

* ENG-354: Remove smart kandel

Signed-off-by: belbazanas <[email protected]>

* ENG-354: turn validateKandelParams deposit to true

Signed-off-by: belbazanas <[email protected]>

* ENG-354: fix approval

Signed-off-by: belbazanas <[email protected]>

* ENG-354: remove comments

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* eng-359: clean and remove amplified orders everywhere (#329)

* ENG-351: add arbitrum network (#328)

Signed-off-by: belbazanas <[email protected]>

* fix arbitrum icon

* Fix/eng 361 (#330)

* eng-359: clean and remove amplified orders everywhere

* wip / debug

* refactoring / cleaning

* improve number readability

* cleaning

* show depth chart even if it's one sided book (#332)

* Fix/eng 366 (#333)

* cleaning - wip

* replace all useChainId by useAccount

* remove nuqs

* eng-367: fix add tooltip in orderbook sizes an total values (#331)

* eng-367: fix add tooltip in orderbook sizes an total values

Signed-off-by: belbazanas <[email protected]>

* eng-367: update sdk

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* eng-371: fix wrong units (#334)

* eng-371: fix wrong units

* fix wrong unit

* fix buil

* fix number of offers (#335)

* fix number of offers

* cleanup

* market order: fix not enough volume on book error when selling (#340)

* market order: fix not enough volume on book error when selling

Signed-off-by: belbazanas <[email protected]>

* remove unused logs

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* eng-363: Hide passive strategy on arbitrum & add tooltip (#338)

Signed-off-by: belbazanas <[email protected]>

* eng-358: update synapse network text (#337)

Signed-off-by: belbazanas <[email protected]>

* eng-373: remove network (#341)

* Fix limit orders (#342)

* Fix limit orders

* if GTC or PO, take into account the expiryDate

* Fix edit order sheet

* show detail in the confirm dialog

* Fix link issue

* test fix

* fix overlay issue for mobile declension

* fix

* eng-379: fix balance's tooltip

* fix decimals issue (#351)

* eng-367: Check edit strategy workflow (#336)

* eng-367: Fix form is error state at first load

Signed-off-by: belbazanas <[email protected]>

* eng-364: Fix kandel strategy approvals

Signed-off-by: belbazanas <[email protected]>

* add logs

Signed-off-by: belbazanas <[email protected]>

* display current deposited liquidity to wallet balance

Signed-off-by: belbazanas <[email protected]>

* remove logs

Signed-off-by: belbazanas <[email protected]>

* remove unused code

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>

* Add token logo for weETH and update mgv sdk

* fix build by adding color property

* update sdk version

* DEBUG - Feat/eng 171 (#357)

* Create table

* End table and data

* debug

* pagination fix on trades history

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: belbazanas <[email protected]>

* Feat/plug price chart (#359)

* Add TradingView chart component and datafeed

* mock data

* WIP

* WIP

* update trading view

* wip plug the new api

* end

* set depth chart as default

* fix build (#360)

Signed-off-by: belbazanas <[email protected]>

---------

Signed-off-by: belbazanas <[email protected]>
Co-authored-by: Johan le Roch <[email protected]>
Co-authored-by: Maxence Raballand <[email protected]>
Co-authored-by: Mangrove Automation Bot <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: bigboydiamonds <[email protected]>
  • Loading branch information
6 people authored Sep 17, 2024
1 parent 1203899 commit a57620c
Show file tree
Hide file tree
Showing 1,740 changed files with 19,393 additions and 5,574 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ export function MinMax({ min, max, quote, base }: Props) {
const minBigInt = BigInt(Math.floor(Number(min)))
const maxBigInt = BigInt(Math.floor(Number(max)))

console.log(quoteToken.decimals)

if (!quoteToken) {
return
}

console.log(quoteToken.decimals)

return (
<div>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export function useStrategies<T = Strategy[]>({
skip,
knownTokens: tokensList,
})
console.log({ result })
return parseStrategies(result)
} catch (error) {
console.error(error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react"

import CloseStrategyDialog from "@/app/strategies/[address]/_components/parameters/dialogs/close"
import { DataTable } from "@/components/ui/data-table/data-table"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import type { Strategy } from "../../../_schemas/kandels"
import { useStrategies } from "./hooks/use-strategies"
import { useTable } from "./hooks/use-table"
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/(list)/_components/tables/vaults/vaults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react"

import CloseStrategyDialog from "@/app/strategies/[address]/_components/parameters/dialogs/close"
import { DataTable } from "@/components/ui/data-table/data-table"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import type { Strategy } from "../../../_schemas/kandels"
import { useTable } from "./hooks/use-table"
import { useVaults } from "./hooks/use-vaults"
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/(list)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react"

import { Navbar } from "@/components/navbar"
import { IndexerSdkProvider } from "@/providers/mangrove-indexer"
import { MarketProvider } from "@/providers/market.new"
import { MarketProvider } from "@/providers/market"
import WarningBanner from "../(shared)/_components/warning-banner"

export const metadata: Metadata = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
SelectValue,
} from "@/components/ui/select"
import { useTokenFromAddress } from "@/hooks/use-token-from-address"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"

function getSymbol(market?: MarketParams) {
if (!market) return
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/(shared)/_hooks/use-kandel-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Address } from "viem"

import { Strategy } from "@/app/strategies/(list)/_schemas/kandels"
import { useMangroveAddresses } from "@/hooks/use-addresses"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { useClient } from "wagmi"

type Params = Partial<Pick<Strategy, "address" | "base" | "quote">>
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/(shared)/_hooks/use-strategy-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useClient, usePublicClient } from "wagmi"

import { Strategy } from "@/app/strategies/(list)/_schemas/kandels"
import { useMangroveAddresses } from "@/hooks/use-addresses"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { getTokenPriceInToken } from "@/services/tokens.service"

export type Status = "active" | "inactive" | "closed" | "unknown"
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/[address]/_hooks/use-kandel-steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { kandelActions } from "@mangrovedao/mgv"
import { useQuery } from "@tanstack/react-query"

import { useMangroveAddresses } from "@/hooks/use-addresses"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { getErrorMessage } from "@/utils/errors"
import { Address } from "viem"
import { useAccount, useClient, usePublicClient } from "wagmi"
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/[address]/edit/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Metadata } from "next"
import React from "react"

import { IndexerSdkProvider } from "@/providers/mangrove-indexer"
import { MarketProvider } from "@/providers/market.new"
import { MarketProvider } from "@/providers/market"

export const metadata: Metadata = {
title: "Edit Strategy | Mangrove DEX",
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/[address]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react"
import { KandelStrategyProvider } from "@/app/strategies/[address]/_providers/kandel-strategy"
import { Navbar } from "@/components/navbar"
import { IndexerSdkProvider } from "@/providers/mangrove-indexer"
import { MarketProvider } from "@/providers/market.new"
import { MarketProvider } from "@/providers/market"
import WarningBanner from "../(shared)/_components/warning-banner"

export const metadata: Metadata = {
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/new/_components/form/use-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useAccount, useBalance } from "wagmi"
import { useValidateKandel } from "@/app/strategies/[address]/_hooks/use-kandel-validator"
import { useLogics } from "@/hooks/use-addresses"
import { useTokenBalance } from "@/hooks/use-token-balance"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { getErrorMessage } from "@/utils/errors"
import { ChangingFrom, useNewStratStore } from "../../_stores/new-strat.store"

Expand Down
2 changes: 1 addition & 1 deletion app/strategies/new/_components/launch-strategy-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"
import { Separator } from "@/components/ui/separator"
import { useInfiniteApproveToken } from "@/hooks/use-infinite-approve-token"
import { useStep } from "@/hooks/use-step"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { useKandelSteps } from "../../[address]/_hooks/use-kandel-steps"
import { useCreateKandelStrategy } from "../_hooks/use-deploy-kandel-strategy"
import { useLaunchKandelStrategy } from "../_hooks/use-launch-kandel-strategy"
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/new/_components/price-range/price-range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button"
import withClientOnly from "@/hocs/withClientOnly"
import { useBook } from "@/hooks/use-book"
import { useTokenFromAddress } from "@/hooks/use-token-from-address"
import { default as useMarketNew } from "@/providers/market.new"
import { default as useMarketNew } from "@/providers/market"
import {
calculatePriceDifferencePercentage,
calculatePriceFromPercentage,
Expand Down
2 changes: 1 addition & 1 deletion app/strategies/new/_hooks/use-deploy-kandel-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { toast } from "sonner"
import { useAccount, useClient, usePublicClient, useWalletClient } from "wagmi"

import { useKandelSeeder } from "@/hooks/use-addresses"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { getTitleDescriptionErrorMessages } from "@/utils/tx-error-messages"
import { BaseError, ContractFunctionExecutionError } from "viem"

Expand Down
2 changes: 1 addition & 1 deletion app/strategies/new/_hooks/use-launch-kandel-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation } from "@tanstack/react-query"
import { useRouter } from "next/navigation"
import { toast } from "sonner"

import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { getTitleDescriptionErrorMessages } from "@/utils/tx-error-messages"
import { KandelParams } from "@mangrovedao/mgv"
import {
Expand Down
3 changes: 1 addition & 2 deletions app/strategies/new/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import React from "react"

import { Navbar } from "@/components/navbar"
import { IndexerSdkProvider } from "@/providers/mangrove-indexer"

import { MarketProvider } from "@/providers/market.new"
import { MarketProvider } from "@/providers/market"
import WarningBanner from "../(shared)/_components/warning-banner"
import { KandelStrategyProvider } from "../[address]/_providers/kandel-strategy"

Expand Down
2 changes: 1 addition & 1 deletion app/strategies/vault/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react"

import { Navbar } from "@/components/navbar"
import { IndexerSdkProvider } from "@/providers/mangrove-indexer"
import { MarketProvider } from "@/providers/market.new"
import { MarketProvider } from "@/providers/market"
import WarningBanner from "../(shared)/_components/warning-banner"

export const metadata: Metadata = {
Expand Down
7 changes: 3 additions & 4 deletions app/trade/_components/charts/charts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ import {
CustomTabsList,
CustomTabsTrigger,
} from "@/components/custom-tabs"
import { TVChartContainer } from "@/components/trading-view/trading-view-chart"
import { cn } from "@/utils"
import { renderElement } from "@/utils/render"

enum ChartType {
DEPTH = "Depth chart",
// PRICE = "Price chart",
PRICE = "Price chart",
}

const TABS_CONTENT = {
[ChartType.DEPTH]: DepthChart,
// [ChartType.PRICE]: (
// <TVChartContainer symbol={"AAPL"} interval={`1D` as ResolutionString} />
// ),
[ChartType.PRICE]: <TVChartContainer />,
}

export function Market({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Big from "big.js"
import React from "react"

import { useBook } from "@/hooks/use-book"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { clamp } from "@/utils/interpolation"
import type { CompleteOffer } from "@mangrovedao/mgv"
import { calculateCumulative } from "./utils"
Expand Down
2 changes: 1 addition & 1 deletion app/trade/_components/forms/hooks/use-trade-infos.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTokenBalance } from "@/hooks/use-balances"
import { useBook } from "@/hooks/use-book"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { determineDecimals } from "@/utils/numbers"
import { BS } from "@mangrovedao/mgv/lib"
import { useSpenderAddress } from "./use-spender-address"
Expand Down
2 changes: 1 addition & 1 deletion app/trade/_components/forms/limit/hooks/use-limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useEventListener } from "usehooks-ts"
import { useLogics } from "@/hooks/use-addresses"
import { useTokenBalance, useTokenLogics } from "@/hooks/use-balances"
import { useBook } from "@/hooks/use-book"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { BS, getDefaultLimitOrderGasreq, minVolume } from "@mangrovedao/mgv/lib"
import { formatUnits, parseUnits } from "viem"
import { TimeInForce, TimeToLiveUnit } from "../enums"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { useMutation, useQueryClient } from "@tanstack/react-query"
import {
BaseError,
Expand Down
2 changes: 1 addition & 1 deletion app/trade/_components/forms/limit/limit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from "@/components/ui/select"
import { Separator } from "@/components/ui/separator"
import { Slider } from "@/components/ui/slider"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { cn } from "@/utils"
import { enumKeys } from "@/utils/enums"
import { Accordion } from "../components/accordion"
Expand Down
2 changes: 1 addition & 1 deletion app/trade/_components/forms/market/hooks/use-market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import React from "react"
import { formatUnits, parseUnits } from "viem"

import { useBook } from "@/hooks/use-book"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"

import useMangroveTokenPricesQuery from "@/hooks/use-mangrove-token-price-query"
import { determinePriceDecimalsFromToken } from "@/utils/numbers"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TRADE } from "@/app/trade/_constants/loading-keys"
import { useMangroveAddresses } from "@/hooks/use-addresses"
import { useMarketClient } from "@/hooks/use-market"
import { useResolveWhenBlockIsIndexed } from "@/hooks/use-resolve-when-block-is-indexed"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { useLoadingStore } from "@/stores/loading.store"
import { toast } from "sonner"
import { parseUnits } from "viem"
Expand Down
2 changes: 1 addition & 1 deletion app/trade/_components/market-selector/market-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { MarketParams } from "@mangrovedao/mgv"
import { getAddress, isAddressEqual } from "viem"
import { TokenIcon } from "../../../../components/token-icon"
Expand Down
15 changes: 9 additions & 6 deletions app/trade/_components/orderbook/orderbook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"
import { Skeleton } from "@/components/ui/skeleton"
import { Table, TableBody, TableHeader, TableRow } from "@/components/ui/table"
import { useBook } from "@/hooks/use-book"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { cn } from "@/utils"
import { BA } from "@mangrovedao/mgv/lib"
import { SemiBook } from "./semibook"
import { OrderBookTableCell } from "./table-cell"
import { OrderBookTableHead } from "./table-head"
import { Trades } from "./trade-history/trades"
import useScrollToMiddle from "./use-scroll-to-middle"

export function OrderBook({
Expand All @@ -34,12 +35,18 @@ export function OrderBook({
>
<CustomTabsList className="w-full flex justify-start border-b">
<CustomTabsTrigger value={"book"}>Book</CustomTabsTrigger>
<CustomTabsTrigger value={"trades"}>Trades</CustomTabsTrigger>
</CustomTabsList>
<CustomTabsContent value="book">
<div className="p-1 relative h-full">
<BookContent />
</div>
</CustomTabsContent>
<CustomTabsContent value="trades">
<div className="p-1 relative h-full">
<Trades />
</div>
</CustomTabsContent>
</CustomTabs>
)
}
Expand Down Expand Up @@ -76,11 +83,7 @@ function BookContent() {
}).format(spreadPercent / 100)

return (
<ScrollArea
className="h-full trololo"
scrollHideDelay={200}
ref={scrollAreaRef}
>
<ScrollArea className="h-full" scrollHideDelay={200} ref={scrollAreaRef}>
<Table className="text-sm leading-5 h-full select-none relative">
<TableHeader className="sticky top-0 bg-background z-40 py-2 text-xs h-[var(--bar-height)]">
<TableRow className="border-none">
Expand Down
2 changes: 1 addition & 1 deletion app/trade/_components/orderbook/semibook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip"
import useMarket from "@/providers/market.new"
import useMarket from "@/providers/market"
import { cn } from "@/utils"
import { OrderBookTableCell } from "./table-cell"
import { calculateCumulatedVolume } from "./utils"
Expand Down
31 changes: 31 additions & 0 deletions app/trade/_components/orderbook/trade-history/schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { z } from "zod"

const tradeHistorySchema = z.object({
creationDate: z.date(),
transactionHash: z.string(),
isBid: z.boolean(),
takerGot: z.string(),
takerGave: z.string(),
penalty: z.string(),
feePaid: z.string(),
initialWants: z.string(),
initialGives: z.string(),
price: z.string(),
status: z.string(),
isMarketOrder: z.boolean(),
})

export type TradeHistory = z.infer<typeof tradeHistorySchema>

export function parseTradeHistory(data: unknown[]): TradeHistory[] {
return data
.map((item) => {
try {
return tradeHistorySchema.parse(item)
} catch (error) {
console.error("Invalid format for trade history: ", item, error)
return null
}
})
.filter(Boolean) as TradeHistory[]
}
41 changes: 41 additions & 0 deletions app/trade/_components/orderbook/trade-history/trades.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"use client"
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"

import useMarket from "@/providers/market"
import { useAccount } from "wagmi"
import { DataTable } from "../../../../../components/ui/data-table/data-table"
import { useTable } from "./use-table"
import { useTradeHistory } from "./use-trade-history"

export function Trades() {
const { chain } = useAccount()
// const [{ page, pageSize }, setPageDetails] = React.useState<PageDetails>({
// page: 1,
// pageSize: 5,
// })
const { currentMarket: market } = useMarket()
const tradesHistoryQuery = useTradeHistory()

const table = useTable({
data: tradesHistoryQuery.data,
})

const blockExplorerUrl = chain?.blockExplorers?.default.url

return (
<ScrollArea className="h-full" scrollHideDelay={200}>
<DataTable
table={table}
isError={!!tradesHistoryQuery.error}
isLoading={tradesHistoryQuery.isLoading || !market}
onRowClick={(row) =>
row &&
row.transactionHash &&
window.open(`${blockExplorerUrl}/tx/${row.transactionHash}`, "_blank")
}
cellClasses="py-0 text-xs"
/>
<ScrollBar orientation="vertical" className="z-50" />
</ScrollArea>
)
}
Loading

0 comments on commit a57620c

Please sign in to comment.