We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3648669 commit 19fea19Copy full SHA for 19fea19
lib/ain-ocean/src/api/pool_pair/service.rs
@@ -461,6 +461,14 @@ pub async fn get_apr(
461
let loan_usd = get_yearly_reward_loan_usd(ctx, id).await?;
462
let total_liquidity_usd = get_total_liquidity_usd(ctx, p).await?;
463
464
+ if custom_usd.is_zero()
465
+ || pct_usd.is_zero()
466
+ || loan_usd.is_zero()
467
+ || total_liquidity_usd.is_zero()
468
+ {
469
+ return Ok(PoolPairAprResponse::default());
470
+ }
471
+
472
let yearly_usd = custom_usd
473
.checked_add(pct_usd)
474
.context(ArithmeticOverflowSnafu)?
0 commit comments