Skip to content

Commit

Permalink
Merge pull request #1317 from bancorprotocol/issue-#1316
Browse files Browse the repository at this point in the history
[Overlapping] mark none overlapping strategy as touched
  • Loading branch information
GrandSchtroumpf authored Jun 27, 2024
2 parents be574b4 + e83e5b0 commit 2d5e1c8
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/strategies/overlapping/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const isOverlappingTouched = (
const { order0, order1 } = strategy;
const { min, max, spread, marketPrice } = search;
if (marketPrice) return true;
if (!isOverlappingStrategy(strategy)) return true;
if (hasNoBudget(strategy)) return true;
if (isPaused(strategy)) return true;
if (min && min !== roundSearchParam(order0.startRate)) return true;
Expand Down
6 changes: 5 additions & 1 deletion src/pages/strategies/edit/prices/recurring.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { EditStrategyPriceField } from 'components/strategies/edit/EditPriceFiel
import { StrategySettings } from 'libs/routing';
import { useMarketPrice } from 'hooks/useMarketPrice';
import { EditStrategyForm } from 'components/strategies/edit/EditStrategyForm';
import { outSideMarketWarning } from 'components/strategies/common/utils';
import {
isOverlappingStrategy,
outSideMarketWarning,
} from 'components/strategies/common/utils';
import { useSetRecurringOrder } from 'components/strategies/common/useSetOrder';
import {
checkIfOrdersOverlap,
Expand Down Expand Up @@ -68,6 +71,7 @@ export const EditStrategyRecurringPage = () => {

const hasChanged = (() => {
const { order0, order1 } = strategy;
if (isOverlappingStrategy(strategy)) return true;
if (search.buyMin !== roundSearchParam(order0.startRate)) return true;
if (search.buyMax !== roundSearchParam(order0.endRate)) return true;
if (search.sellMin !== roundSearchParam(order1.startRate)) return true;
Expand Down

0 comments on commit 2d5e1c8

Please sign in to comment.