Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
71787460
Unverified
Commit
71787460
authored
May 04, 2021
by
Noah Zinsmeister
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
highlight 100% position composition
parent
2efe8250
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
PositionPage.tsx
src/pages/Pool/PositionPage.tsx
+25
-16
No files found.
src/pages/Pool/PositionPage.tsx
View file @
71787460
...
@@ -222,14 +222,9 @@ export function PositionPage({
...
@@ -222,14 +222,9 @@ export function PositionPage({
const
currencyBase
=
inverted
?
currency1
:
currency0
const
currencyBase
=
inverted
?
currency1
:
currency0
// check if price is within range
// check if price is within range
const
inRange
:
boolean
=
const
below
=
pool
&&
typeof
tickLower
===
'
number
'
?
pool
.
tickCurrent
<
tickLower
:
undefined
pool
&&
typeof
tickLower
===
'
number
'
&&
typeof
tickUpper
===
'
number
'
const
above
=
pool
&&
typeof
tickUpper
===
'
number
'
?
pool
.
tickCurrent
>=
tickUpper
:
undefined
?
pool
.
tickCurrent
>=
tickLower
&&
pool
.
tickCurrent
<
tickUpper
const
inRange
:
boolean
=
typeof
below
===
'
boolean
'
&&
typeof
above
===
'
boolean
'
?
!
below
&&
!
above
:
false
:
false
// keep will need to be able to draw the range visualization
// const below = pool && typeof tickLower === 'number' ? pool.tickCurrent < tickLower : false
// const above = pool && typeof tickUpper === 'number' ? pool.tickCurrent >= tickUpper : false
const
ratio
=
useMemo
(()
=>
{
const
ratio
=
useMemo
(()
=>
{
return
priceLower
&&
pool
&&
priceUpper
return
priceLower
&&
pool
&&
priceUpper
...
@@ -616,10 +611,17 @@ export function PositionPage({
...
@@ -616,10 +611,17 @@ export function PositionPage({
{
priceLower
?.
toSignificant
(
4
)
}
{
currencyQuote
?.
symbol
}
{
priceLower
?.
toSignificant
(
4
)
}
{
currencyQuote
?.
symbol
}
</
TYPE
.
label
>
</
TYPE
.
label
>
</
RowFixed
>
</
RowFixed
>
<
TYPE
.
subHeader
color=
{
theme
.
text3
}
textAlign=
"center"
>
{
(
inverted
?
below
:
above
)
?
(
Your position will be
<
CurrencyLogo
currency=
{
inverted
?
currency1
:
currency0
}
size=
"12px"
/>
100%
{
'
'
}
<
TYPE
.
subHeader
color=
{
theme
.
text3
}
textAlign=
"center"
>
{
inverted
?
currency1
?.
symbol
:
currency0
?.
symbol
}
at this price
Your position will be
<
CurrencyLogo
currency=
{
inverted
?
currency1
:
currency0
}
size=
"12px"
/>
{
'
'
}
</
TYPE
.
subHeader
>
100%
{
inverted
?
currency1
?.
symbol
:
currency0
?.
symbol
}
at this price
</
TYPE
.
subHeader
>
)
:
(
<
TYPE
.
label
textAlign=
"center"
>
Your position is
<
CurrencyLogo
currency=
{
inverted
?
currency1
:
currency0
}
size=
"12px"
/>
100%
{
'
'
}
{
inverted
?
currency1
?.
symbol
:
currency0
?.
symbol
}
</
TYPE
.
label
>
)
}
</
AutoColumn
>
</
AutoColumn
>
</
LightCard
>
</
LightCard
>
...
@@ -632,10 +634,17 @@ export function PositionPage({
...
@@ -632,10 +634,17 @@ export function PositionPage({
{
priceUpper
?.
toSignificant
(
4
)
}
{
currencyQuote
?.
symbol
}
{
priceUpper
?.
toSignificant
(
4
)
}
{
currencyQuote
?.
symbol
}
</
TYPE
.
label
>
</
TYPE
.
label
>
</
RowFixed
>
</
RowFixed
>
<
TYPE
.
subHeader
color=
{
theme
.
text3
}
textAlign=
"center"
>
{
(
inverted
?
above
:
below
)
?
(
Your position will be
<
CurrencyLogo
currency=
{
inverted
?
currency0
:
currency1
}
size=
"12px"
/>
100%
{
'
'
}
<
TYPE
.
subHeader
color=
{
theme
.
text3
}
textAlign=
"center"
>
{
inverted
?
currency0
?.
symbol
:
currency1
?.
symbol
}
at this price
Your position will be
<
CurrencyLogo
currency=
{
inverted
?
currency0
:
currency1
}
size=
"12px"
/>
{
'
'
}
</
TYPE
.
subHeader
>
100%
{
inverted
?
currency0
?.
symbol
:
currency1
?.
symbol
}
at this price
</
TYPE
.
subHeader
>
)
:
(
<
TYPE
.
label
textAlign=
"center"
>
Your position is
<
CurrencyLogo
currency=
{
inverted
?
currency0
:
currency1
}
size=
"12px"
/>
100%
{
'
'
}
{
inverted
?
currency0
?.
symbol
:
currency1
?.
symbol
}
</
TYPE
.
label
>
)
}
</
AutoColumn
>
</
AutoColumn
>
</
LightCard
>
</
LightCard
>
</
RowBetween
>
</
RowBetween
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment