mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2024-12-22 09:23:16 +01:00
tweak FET calculation (#26)
* As of July 1st, use fixed ratios instead of FET market price as the markets for OCEAN & AGIX are limited * migration contracts guarantee fixed rate so no need for market rates for OCEAN/FET or AGIX/FET
This commit is contained in:
parent
10f6ceb1f2
commit
59c0faa195
@ -34,11 +34,20 @@ export function SwapResults({
|
|||||||
isLoadingToOcean
|
isLoadingToOcean
|
||||||
} = useQuote(tokenSymbol, amount, isUniswap)
|
} = useQuote(tokenSymbol, amount, isUniswap)
|
||||||
|
|
||||||
const amountInUsd =
|
const tokenSelected = tokenSymbol.toLowerCase() as keyof Prices
|
||||||
amount * prices[tokenSymbol.toLowerCase() as keyof Prices].usd
|
|
||||||
|
const amountInUsd = amount * prices[tokenSelected].usd
|
||||||
const amountToOcean = amountInUsd / prices.ocean.usd
|
const amountToOcean = amountInUsd / prices.ocean.usd
|
||||||
const amountToAgix = amountInUsd / prices.agix.usd
|
const amountToAgix = amountInUsd / prices.agix.usd
|
||||||
const amountToFet = amountInUsd / prices.fet.usd
|
|
||||||
|
// As of July 1st, use fixed ratios instead of FET market price
|
||||||
|
// as the markets for OCEAN & AGIX are limited
|
||||||
|
const amountToFet =
|
||||||
|
tokenSelected === 'ocean'
|
||||||
|
? amount * ratioOceanToAsi
|
||||||
|
: tokenSelected === 'agix'
|
||||||
|
? amount * ratioAgixToAsi
|
||||||
|
: amount
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user