FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
uniswap_interface_sc/apps/web/src/utils/slippage.ts at main · stringcode86/uniswap_interface_sc · GitHub
stringcode86
uniswap_interface_sc
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
uniswap_interface_sc
/
apps
/
web
/
src
/
utils
/
slippage.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
10 lines (8 loc) · 323 Bytes
Breadcrumbs
uniswap_interface_sc
/
apps
/
web
/
src
/
utils
/
slippage.ts
Copy path
File metadata and controls
10 lines (8 loc) · 323 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
import
{
Percent
}
from
'@uniswap/sdk-core'
const
PRECISION
=
10_000
const
DENOMINATOR
=
PRECISION
*
100
// turn "0.5" into Percent representing 0.5%
export
function
toSlippagePercent
(
slippage
:
string
)
:
Percent
{
const
numerator
=
Math
.
floor
(
Number
(
slippage
)
*
PRECISION
)
return
new
Percent
(
numerator
,
DENOMINATOR
)
}
Back
|
FazBrowse Home
|
New Git URL