avoid zero division in the bond details hook

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-03-14 19:06:43 +03:00
parent bff5faa58c
commit 3d5340e49a
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
3 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.6.1",
"version": "0.6.2",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -78,7 +78,7 @@ export const BONDING_CALCULATOR_ADDRESSES = {
}
export const GATEKEEPER_ADDRESSES = {
[NetworkId.TESTNET_SEPOLIA]: "0xc85129A097773B7F8970a7364c928C05f265E6A1",
[NetworkId.TESTNET_SEPOLIA]: "0xd735cA07984a16911222c08411A80e24EB38869B",
[NetworkId.TESTNET_MORDOR]: "0x4823F1DC785D721eAdD2bD218E1eeD63aF67fBF4",
}

View File

@ -132,7 +132,7 @@ export const useLiveBonds = (chainId) => {
const quoteTokenPerBaseToken = new DecimalBigNumber(marketPrice, 9);
const priceInUsd = quoteTokenPerBaseToken.mul(baseTokenPerUsd).mul(quoteTokenPerUsd).mul(markdown).div(originalCoefficient);
const discount = baseTokenPerUsd._value > 0n
const discount = ftsoPrice._value > 0n
? ftsoPrice.sub(priceInUsd).div(ftsoPrice)
: new DecimalBigNumber("0", ftsoPrice._decimals);