simplify logic in Buy strategy

This commit is contained in:
Matthias Kretschmann 2024-04-04 02:20:58 +01:00
parent e73022c875
commit d1adc49455
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -22,43 +22,29 @@ export function Buy() {
</h3> </h3>
<Result <Result
token={getTokenBySymbol('OCEAN')} token={getTokenBySymbol('OCEAN')}
amount={prices.ocean ? debouncedAmount / prices.ocean : 0} amount={debouncedAmount / prices.ocean}
amountAsi={ amountAsi={(debouncedAmount / prices.ocean) * ratioOceanToAsi}
prices.ocean ? (debouncedAmount / prices.ocean) * ratioOceanToAsi : 0
}
amountFiat={ amountFiat={
prices.ocean (debouncedAmount / prices.ocean) * ratioOceanToAsi * prices.asi
? (debouncedAmount / prices.ocean) * ratioOceanToAsi * prices.asi
: 0
} }
isValidating={isValidating} isValidating={isValidating}
isLoading={isLoading} isLoading={isLoading}
/> />
<Result <Result
token={getTokenBySymbol('AGIX')} token={getTokenBySymbol('AGIX')}
amount={prices.agix ? debouncedAmount / prices.agix : 0} amount={debouncedAmount / prices.agix}
amountAsi={ amountAsi={(debouncedAmount / prices.agix) * ratioAgixToAsi}
prices.agix ? (debouncedAmount / prices.agix) * ratioAgixToAsi : 0
}
amountFiat={ amountFiat={
prices.agix (debouncedAmount / prices.agix) * ratioAgixToAsi * prices.asi
? (debouncedAmount / prices.agix) * ratioAgixToAsi * prices.asi
: 0
} }
isValidating={isValidating} isValidating={isValidating}
isLoading={isLoading} isLoading={isLoading}
/> />
<Result <Result
token={getTokenBySymbol('FET')} token={getTokenBySymbol('FET')}
amount={prices.fet ? debouncedAmount / prices.fet : 0} amount={debouncedAmount / prices.fet}
amountAsi={ amountAsi={(debouncedAmount / prices.fet) * ratioFetToAsi}
prices.fet ? (debouncedAmount / prices.fet) * ratioFetToAsi : 0 amountFiat={(debouncedAmount / prices.fet) * ratioFetToAsi * prices.asi}
}
amountFiat={
prices.fet
? (debouncedAmount / prices.fet) * ratioFetToAsi * prices.asi
: 0
}
isValidating={isValidating} isValidating={isValidating}
isLoading={isLoading} isLoading={isLoading}
/> />