align values for the bond discout object
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
a52372dbe5
commit
fb0f39e3e6
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.25",
|
"version": "0.0.26",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
@ -5,7 +5,7 @@ import { DecimalBigNumber } from "../../../helpers/DecimalBigNumber";
|
|||||||
|
|
||||||
const BondDiscount = ({ discount, textOnly }) => {
|
const BondDiscount = ({ discount, textOnly }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const discountString = `${formatNumber(Number(discount.mul(new DecimalBigNumber("100").toString())), 2)}%`;
|
const discountString = `${formatNumber(Number(discount.mul(new DecimalBigNumber("100")).toString()), 2)}%`;
|
||||||
|
|
||||||
return textOnly ? (
|
return textOnly ? (
|
||||||
<Box
|
<Box
|
||||||
@ -17,7 +17,7 @@ const BondDiscount = ({ discount, textOnly }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<Chip
|
<Chip
|
||||||
label={`${formatNumber(Number(discount.mul(new DecimalBigNumber("100")).toString()), 2)}%`}
|
label={discountString}
|
||||||
template={new DecimalBigNumber("0").gt(discount) ? "error" : "success"}
|
template={new DecimalBigNumber("0").gt(discount) ? "error" : "success"}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -102,7 +102,7 @@ export const useLiveBonds = (chainId) => {
|
|||||||
const priceInUsd = quoteTokenPerUsd.mul(quoteTokenPerBaseToken);
|
const priceInUsd = quoteTokenPerUsd.mul(quoteTokenPerBaseToken);
|
||||||
const discount = quoteTokenPerUsd._value > 0n
|
const discount = quoteTokenPerUsd._value > 0n
|
||||||
? quoteTokenPerUsd.sub(priceInUsd).div(quoteTokenPerUsd)
|
? quoteTokenPerUsd.sub(priceInUsd).div(quoteTokenPerUsd)
|
||||||
: quoteTokenPerUsd;
|
: new DecimalBigNumber("0", quoteTokenDecimals);
|
||||||
|
|
||||||
const capacityInBaseToken = capacityInQuote
|
const capacityInBaseToken = capacityInQuote
|
||||||
? new DecimalBigNumber(marketPrice > 0n ? marketCapacity / marketPrice : 0n, 9)
|
? new DecimalBigNumber(marketPrice > 0n ? marketCapacity / marketPrice : 0n, 9)
|
||||||
|
Loading…
Reference in New Issue
Block a user