Skip to content

Commit

Permalink
Fix price 0 logic
Browse files Browse the repository at this point in the history
  • Loading branch information
boyuan-chen committed Mar 15, 2024
1 parent 6125a41 commit 5285d4f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/boba/gas-price-oracle/src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,14 +671,20 @@ export class GasPriceOracleService extends BaseService<GasPriceOracleOptions> {

private async _queryTokenPrice(tokenPair: string): Promise<void> {
if (tokenPair === 'ETH/USD') {
this.state.ETHUSDPrice = Number(
const ETHUSDPrice = Number(
await this._getTokenPriceFromCoinGecko('ethereum')
)
if (ETHUSDPrice > 0) {
this.state.ETHUSDPrice = ETHUSDPrice
}
}
if (tokenPair === 'BOBA/USD') {
this.state.BOBAUSDPrice = Number(
const BOBAUSDPrice = Number(
await this._getTokenPriceFromCoinGecko('boba-network')
)
if (BOBAUSDPrice > 0) {
this.state.BOBAUSDPrice = BOBAUSDPrice
}
}
}

Expand Down

0 comments on commit 5285d4f

Please sign in to comment.