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
9cb19dd0
Unverified
Commit
9cb19dd0
authored
Feb 10, 2022
by
Zach Pomerantz
Committed by
GitHub
Feb 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: filter integrator fee (#3281)
parent
02a77254
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
Details.tsx
src/lib/components/Swap/Summary/Details.tsx
+11
-15
No files found.
src/lib/components/Swap/Summary/Details.tsx
View file @
9cb19dd0
...
...
@@ -45,24 +45,22 @@ export default function Details({ trade, allowedSlippage }: DetailsProps) {
const
{
inputAmount
,
outputAmount
}
=
trade
const
inputCurrency
=
inputAmount
.
currency
const
outputCurrency
=
outputAmount
.
currency
const
priceImpact
=
useMemo
(()
=>
computeRealizedPriceImpact
(
trade
),
[
trade
])
const
lpFeeAmount
=
useMemo
(()
=>
computeRealizedLPFeeAmount
(
trade
),
[
trade
])
const
integrator
=
window
.
location
.
hostname
const
feeOptions
=
useAtomValue
(
feeOptionsAtom
)
const
priceImpact
=
useMemo
(()
=>
computeRealizedPriceImpact
(
trade
),
[
trade
])
const
lpFeeAmount
=
useMemo
(()
=>
computeRealizedLPFeeAmount
(
trade
),
[
trade
])
const
{
i18n
}
=
useLingui
()
const
details
=
useMemo
(()
=>
{
const
rows
=
[]
// @TODO(ianlapham): Check that provider fee is even a valid list item
if
(
feeOptions
)
{
const
parsedConvenienceFee
=
formatCurrencyAmount
(
outputAmount
.
multiply
(
feeOptions
.
fee
),
6
,
i18n
.
local
e
)
rows
.
push
([
t
`
${
integrator
}
fee`
,
`
${
parsedConvenienceFee
}
${
outputCurrency
.
symbol
||
currencyId
(
outputCurrency
)}
`
,
])
const
fee
=
outputAmount
.
multiply
(
feeOptions
.
fe
e
)
if
(
fee
.
greaterThan
(
0
))
{
const
parsedFee
=
formatCurrencyAmount
(
fee
,
6
,
i18n
.
locale
)
rows
.
push
([
t
`
${
integrator
}
fee`
,
`
${
parsedFee
}
${
outputCurrency
.
symbol
||
currencyId
(
outputCurrency
)}
`
])
}
}
const
priceImpactRow
=
[
t
`Price impact`
,
`
${
priceImpact
.
toFixed
(
2
)}
%`
]
...
...
@@ -74,11 +72,8 @@ export default function Details({ trade, allowedSlippage }: DetailsProps) {
rows
.
push
(
priceImpactRow
)
if
(
lpFeeAmount
)
{
const
localizedFeeAmount
=
formatCurrencyAmount
(
lpFeeAmount
,
6
,
i18n
.
locale
)
rows
.
push
([
t
`Liquidity provider fee`
,
`
${
localizedFeeAmount
}
${
inputCurrency
.
symbol
||
currencyId
(
inputCurrency
)}
`
,
])
const
parsedLpFee
=
formatCurrencyAmount
(
lpFeeAmount
,
6
,
i18n
.
locale
)
rows
.
push
([
t
`Liquidity provider fee`
,
`
${
parsedLpFee
}
${
inputCurrency
.
symbol
||
currencyId
(
inputCurrency
)}
`
])
}
if
(
trade
.
tradeType
===
TradeType
.
EXACT_OUTPUT
)
{
...
...
@@ -110,6 +105,7 @@ export default function Details({ trade, allowedSlippage }: DetailsProps) {
outputCurrency
,
inputCurrency
,
])
return
(
<>
{
details
.
map
(([
label
,
detail
,
color
])
=>
(
...
...
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