Skip to content

Commit

Permalink
Merge pull request #3435 from TrueBlocks/fix/uniswap-core
Browse files Browse the repository at this point in the history
Fixes an issue with uniswap pricing
  • Loading branch information
tjayrush authored Dec 2, 2023
2 parents be29ddb + 61c7f9b commit 1ada881
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/apps/chifra/pkg/pricing/uniswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ func PriceUsdUniswap(conn *rpc.Connection, testMode bool, statement *types.Simpl
return 0.0, "not-priced", err
}
reserve0 := new(big.Float)
if result.Values != nil && result.Values["_reserve0"] == "" {
if result.Values != nil && (result.Values["_reserve0"] == "" || result.Values["_reserve0"] == "0") {
reserve0.SetString("1")
} else {
reserve0.SetString(result.Values["_reserve0"])
}
reserve1 := new(big.Float)
if result.Values != nil && result.Values["_reserve1"] == "" {
reserve0.SetString("1")
if result.Values != nil && (result.Values["_reserve1"] == "" || result.Values["_reserve1"] == "0") {
reserve1.SetString("1")
} else {
reserve1.SetString(result.Values["_reserve1"])
}
Expand Down

0 comments on commit 1ada881

Please sign in to comment.