diff --git a/xb.php b/xb.php index fd88266..7519617 100644 --- a/xb.php +++ b/xb.php @@ -124,17 +124,25 @@ $bnbinfo['price']=apiGet('https://binanceapi.mirrorsite.eu.org/api/v3/avgPrice?s $bnbinfo['amount']=$detail['bnb']->totalInvestAmount; $bnbinfo['new']=$detail['bnb']->rebateTotalAmount; $bnbinfo['rad']=$detail['bnb']->shareRatio; -$bnbinfo['rate']=apiGet('https://binanceapi.mirrorsite.eu.org/sapi/v1/margin/crossMarginData'.sign('coin=BNB'))[0][0]->dailyInterest; +$bnbinfo['bn_rate']=apiGet('https://binanceapi.mirrorsite.eu.org/sapi/v1/margin/crossMarginData'.sign('coin=BNB'))[0][0]->dailyInterest; +$bnbinfo['venus_rate']=(apiGet('https://api.venus.io/markets/?chainId=56&underlyingSymbol=BNB')[0]->result[0]->borrowApy)/36500; +$bnbinfo['rate']=max($bnbinfo['bn_rate'],$bnbinfo['venus_rate']); +$bnbinfo['w_rate']=min($bnbinfo['bn_rate'],$bnbinfo['venus_rate']); $fdinfo['amount']=$detail['fdusd']->totalInvestAmount; $fdinfo['new']=$detail['fdusd']->rebateTotalAmount; $fdinfo['rad']=$detail['fdusd']->shareRatio; -$fdinfo['rate']=apiGet('https://binanceapi.mirrorsite.eu.org/sapi/v1/simple-earn/flexible/list'.sign('asset=FDUSD'))[0]->rows[0]->latestAnnualPercentageRate; -$fdinfo['rate']=round($bnbinfo['rate']/365,5); +$fdinfo['bn_rate']=apiGet('https://binanceapi.mirrorsite.eu.org/sapi/v1/simple-earn/flexible/list'.sign('asset=FDUSD'))[0]->rows[0]->latestAnnualPercentageRate; +$fdinfo['venus_rate']=(apiGet('https://api.venus.io/markets/?chainId=56&underlyingSymbol=FDUSD')[0]->result[0]->borrowApy)/100; +$fdinfo['rate']=round(max($fdinfo['bn_rate'],$fdinfo['venus_rate'])/365,5); +$fdinfo['w_rate']=round(min($fdinfo['bn_rate'],$fdinfo['venus_rate'])/365,5); -$best=($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['rate']*$coininfo->duration)/$bnbinfo['new']; -$worst=(($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$bnbinfo['rad']+(($fdinfo['amount']*$fdinfo['rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$fdinfo['rad']; +#$best=($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['rate']*$coininfo->duration)/$bnbinfo['new']; +#$worst=(($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$bnbinfo['rad']+(($fdinfo['amount']*$fdinfo['rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$fdinfo['rad']; +$best=(($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$bnbinfo['rad']+(($fdinfo['amount']*$fdinfo['rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$fdinfo['rad']; +$worst=(($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['w_rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$bnbinfo['rad']+(($fdinfo['amount']*$fdinfo['w_rate']*$coininfo->duration)/$coininfo->rebateTotalAmount)*$fdinfo['rad']; + ?>

@@ -353,4 +361,5 @@ $worst=(($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['rate']*$coininfo->durati - \ No newline at end of file + +