avoid zero division in the bond details hook
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
bff5faa58c
commit
3d5340e49a
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.6.1",
|
"version": "0.6.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export const BONDING_CALCULATOR_ADDRESSES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const GATEKEEPER_ADDRESSES = {
|
export const GATEKEEPER_ADDRESSES = {
|
||||||
[NetworkId.TESTNET_SEPOLIA]: "0xc85129A097773B7F8970a7364c928C05f265E6A1",
|
[NetworkId.TESTNET_SEPOLIA]: "0xd735cA07984a16911222c08411A80e24EB38869B",
|
||||||
[NetworkId.TESTNET_MORDOR]: "0x4823F1DC785D721eAdD2bD218E1eeD63aF67fBF4",
|
[NetworkId.TESTNET_MORDOR]: "0x4823F1DC785D721eAdD2bD218E1eeD63aF67fBF4",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -132,7 +132,7 @@ export const useLiveBonds = (chainId) => {
|
|||||||
const quoteTokenPerBaseToken = new DecimalBigNumber(marketPrice, 9);
|
const quoteTokenPerBaseToken = new DecimalBigNumber(marketPrice, 9);
|
||||||
const priceInUsd = quoteTokenPerBaseToken.mul(baseTokenPerUsd).mul(quoteTokenPerUsd).mul(markdown).div(originalCoefficient);
|
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)
|
? ftsoPrice.sub(priceInUsd).div(ftsoPrice)
|
||||||
: new DecimalBigNumber("0", ftsoPrice._decimals);
|
: new DecimalBigNumber("0", ftsoPrice._decimals);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user