Skip to content

Commit

Permalink
Merge pull request #1256 from bancorprotocol/issue-#1241
Browse files Browse the repository at this point in the history
Replace "overlapping" with "concentrated liquidity"
  • Loading branch information
GrandSchtroumpf authored Jun 12, 2024
2 parents 2158dea + ad2658e commit 542fefc
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The '/debug' route is available to debug the app (ex: localhost:3000/debug). It
}
```

where `spread` is in percentage, and `value` is the number of strategies to create.
where `spread` (fee tier in the UI) is in percentage, and `value` is the number of strategies to create.

# Customization

Expand Down
2 changes: 1 addition & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ await expect(first.getTestId('strategy-pair')).toHaveText('ETH/DAI');
As the same network was used for all tests, mutating a strategy in one test might impact another test. For now, it is suggested to try to use different token pairs for each test to avoid unwanted side effect, for example:

- `ETH/DAI`: Create recurring strategy
- `ETH/BNT`: Create overlapping strategy
- `ETH/BNT`: Create concentrated liquidity strategy (overlapping in the code)
- `ETH/USDC`: Trade Buy
- `USDC/USDT`: Trade Sell

Expand Down
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.
Binary file modified e2e/screenshots/strategy/overlapping/Overlapping/create/form.png
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.
4 changes: 2 additions & 2 deletions src/components/debug/DebugCreateStrategy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export const DebugCreateStrategy = () => {
</fieldset>

<fieldset className="flex flex-col gap-8 rounded border border-white/60 p-16">
<legend>Overlapping Spread</legend>
<legend>Concentrated Liquidity Fee Tier</legend>
<Label label="Spread">
<Input
type="text"
Expand All @@ -259,7 +259,7 @@ export const DebugCreateStrategy = () => {
/>
</Label>
<p id="strategy-spread-description" className="text-12 text-white/60">
Spread will create an overlapping strategy. You still need to set the
Spread will create a concentrated liquidity. You still need to set the
correct budget.
</p>
</fieldset>
Expand Down
9 changes: 6 additions & 3 deletions src/components/simulator/input/SimInputStrategyType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SimulatorType } from 'libs/routing/routes/sim';
import { Link } from 'libs/routing';

interface ItemProps {
title: string;
label: SimulatorType;
svg: JSX.Element;
tooltipText: string;
Expand All @@ -20,16 +21,18 @@ interface Props {
export const SimInputStrategyType: FC<Props> = ({ baseToken, quoteToken }) => {
const items: ItemProps[] = [
{
title: 'Recurring',
label: 'recurring',
svg: <IconTwoRanges className="w-37 h-16" />,
tooltipText:
'Create buy and sell orders (limit or range) that are linked together. Newly acquired funds automatically rotate between them, creating an endless trading cycle without need for manual intervention.',
},
{
title: 'Concentrated',
label: 'overlapping',
svg: <IconOverlappingStrategy className="w-37 h-16" />,
tooltipText:
'A concentrated position where you buy and sell in a custom price range, used to create a bid-ask spread that moves as the market does.',
'A concentrated position where you buy and sell in a custom price range, used to create a bid-ask fee tier that moves as the market does.',
},
];

Expand All @@ -42,7 +45,7 @@ export const SimInputStrategyType: FC<Props> = ({ baseToken, quoteToken }) => {
<h2 className="text-18 font-weight-500 m-0">Strategy Type</h2>
</header>
<article role="tablist" className="grid grid-cols-2 gap-8">
{items.map(({ label, svg, tooltipText }) => (
{items.map(({ title, label, svg, tooltipText }) => (
<Link
role="tab"
id={'tab-' + label}
Expand Down Expand Up @@ -70,7 +73,7 @@ export const SimInputStrategyType: FC<Props> = ({ baseToken, quoteToken }) => {
isActive ? 'text-white' : 'text-white/40'
}`}
>
{label}
{title}
</span>
<Tooltip
element={<div>{tooltipText}</div>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export const CreateOverlappingStrategy: FC<Props> = (props) => {
</article>
<article className="rounded-10 bg-background-900 flex w-full flex-col gap-10 p-20">
<header className="mb-10 flex items-center gap-8 ">
<h3 className="text-18 font-weight-500 flex-1">Set Spread</h3>
<h3 className="text-18 font-weight-500 flex-1">Set Fee Tier</h3>
<Tooltip
element="The difference between the highest bidding (Sell) price, and the lowest asking (Buy) price"
iconClassName="h-14 w-14 text-white/60"
Expand Down
7 changes: 6 additions & 1 deletion src/components/simulator/result/SimResultSummaryTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ interface Props {
strategyType: 'recurring' | 'overlapping';
}

const title = {
recurring: 'Recurring',
overlapping: 'Concentrated Liquidity',
};

export const SimResultSummaryTokens = ({
baseToken,
quoteToken,
Expand All @@ -22,7 +27,7 @@ export const SimResultSummaryTokens = ({
{quoteToken.symbol}
</h2>
<h3 className="text-12 flex items-center gap-8 capitalize text-white/60">
{strategyType}
{title[strategyType]}
</h3>
</div>
</article>
Expand Down
2 changes: 1 addition & 1 deletion src/components/strategies/create/CreateOverlapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export const CreateOverlapping: FC<Props> = (props) => {
className="rounded-10 bg-background-900 flex w-full flex-col gap-10 p-20"
>
<header className="mb-10 flex items-center gap-8 ">
<h3 className="text-18 font-weight-500 flex-1">Set Spread</h3>
<h3 className="text-18 font-weight-500 flex-1">Set Fee Tier</h3>
<Tooltip
element="The difference between the highest bidding (Sell) price, and the lowest asking (Buy) price"
iconClassName="h-14 w-14 text-white/60"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ export const getStrategyTypeItem = (
id: 'two-ranges',
},
{
label: 'Overlapping Liquidity',
label: 'Concentrated Liquidity',
description:
'A concentrated position where you buy and sell in a custom price range, used to create a bid-ask spread that moves as the market does',
'A concentrated position where you buy and sell in a custom price range, used to create a bid-ask fee tier that moves as the market does',
benefits: [
{
summary: 'No trading or gas fees on filled orders',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export const EditPriceOverlappingStrategy: FC<Props> = (props) => {
</article>
<article className="rounded-10 bg-background-900 flex w-full flex-col gap-10 p-20">
<header className="mb-10 flex items-center gap-8 ">
<h2 className="text-18 font-weight-500 flex-1">Edit Spread</h2>
<h2 className="text-18 font-weight-500 flex-1">Edit Fee Tier</h2>
<Tooltip
element="The difference between the highest bidding (Sell) price, and the lowest asking (Buy) price"
iconClassName="h-14 w-14 text-white/60"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const OverlappingAnchor: FC<Props> = (props) => {
<h2 className="text-18">Budget</h2>
<Tooltip
iconClassName="size-14 text-white/60"
element="Indicate the token, action and amount for the strategy. Note that in order to maintain the overlapping behavior, the 2nd budget indication will be calculated using the prices, spread and budget values you use."
element="Indicate the token, action and amount for the strategy. Note that in order to maintain the concentrated liquidity behavior, the 2nd budget indication will be calculated using the prices, fee tier and budget values you use."
/>
</header>
<p className="text-14 text-white/80">Please select a token to proceed.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const OverlappingInitMarketPriceField = (props: FieldProps) => {
{!externalPrice && <SetPriceText base={base} />}
<BudgetInput
title={`Enter Market Price (${quote.symbol} per 1 ${base.symbol})`}
titleTooltip="Price used to calculate overlapping strategy params"
titleTooltip="Price used to calculate concentrated liquidity strategy params"
placeholder="Enter Price"
value={localPrice}
onChange={changePrice}
Expand Down Expand Up @@ -121,7 +121,7 @@ export const OverlappingInitMarketPriceField = (props: FieldProps) => {
)}
<p className="text-12 text-white/60">
By adjusting the market price, you alter the price range within which
your overlapping strategy initiates.
your concentrated liquidity strategy initiates.
{!!externalPrice && <EditPriceText />}
</p>
{!error && showApproval && (
Expand Down
6 changes: 3 additions & 3 deletions src/components/strategies/overlapping/OverlappingSpread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface Props {
}

const getWarning = (maxSpread: number) => {
return `Given price range, max spread cannot exceed ${maxSpread}%`;
return `Given price range, max fee tier cannot exceed ${maxSpread}%`;
};

const round = (value: number) => Math.round(value * 100) / 100;
Expand Down Expand Up @@ -160,12 +160,12 @@ export const OverlappingSpread: FC<Props> = (props) => {
)}
{spread <= 0 && (
<WarningMessageWithIcon htmlFor="spread-custom" isError>
The spread should be above 0%
The fee tier should be above 0%
</WarningMessageWithIcon>
)}
{spread > 100 && (
<WarningMessageWithIcon htmlFor="spread-custom" isError>
The spread should be equal or below 100%
The fee tier should be equal or below 100%
</WarningMessageWithIcon>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ export const OverlappingStrategyGraph: FC<Props> = (props) => {
<span>Geometric mean price</span>
)}
<span role="separator">·</span>
<span>Spread {spread || 0}%</span>
<span>Fee Tier {spread || 0}%</span>
</figcaption>
<svg
ref={svg}
Expand Down

0 comments on commit 542fefc

Please sign in to comment.