File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -229,17 +229,22 @@ async function updateTxValuesV3(transaction: DbTx): Promise<void> {
229229 `No rate found for payout ${ payoutCurrency } ${ payoutChainPluginId } ${ payoutTokenId } `
230230 )
231231 }
232- if ( depositRate != null && payoutRate != null ) {
232+ if (
233+ depositRate != null &&
234+ depositRate > 0 &&
235+ payoutRate != null &&
236+ payoutRate > 0
237+ ) {
233238 transaction . payoutAmount = ( depositAmount * depositRate ) / payoutRate
234239 }
235240 }
236241
237242 // Calculate the usdValue first trying to use the deposit amount. If that's not available
238243 // then try to use the payout amount.
239244 if ( transaction . usdValue == null || transaction . usdValue <= 0 ) {
240- if ( depositRate != null ) {
245+ if ( depositRate != null && depositRate > 0 ) {
241246 transaction . usdValue = depositAmount * depositRate
242- } else if ( payoutRate != null ) {
247+ } else if ( payoutRate != null && payoutRate > 0 ) {
243248 transaction . usdValue = transaction . payoutAmount * payoutRate
244249 }
245250 }
You can’t perform that action at this time.
0 commit comments