更新 xb.php
引入Venus链上质押利率数据,修改算法
This commit is contained in:
parent
f5202b0e0f
commit
819715ae2d
19
xb.php
19
xb.php
@ -124,17 +124,25 @@ $bnbinfo['price']=apiGet('https://binanceapi.mirrorsite.eu.org/api/v3/avgPrice?s
|
|||||||
$bnbinfo['amount']=$detail['bnb']->totalInvestAmount;
|
$bnbinfo['amount']=$detail['bnb']->totalInvestAmount;
|
||||||
$bnbinfo['new']=$detail['bnb']->rebateTotalAmount;
|
$bnbinfo['new']=$detail['bnb']->rebateTotalAmount;
|
||||||
$bnbinfo['rad']=$detail['bnb']->shareRatio;
|
$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['amount']=$detail['fdusd']->totalInvestAmount;
|
||||||
$fdinfo['new']=$detail['fdusd']->rebateTotalAmount;
|
$fdinfo['new']=$detail['fdusd']->rebateTotalAmount;
|
||||||
$fdinfo['rad']=$detail['fdusd']->shareRatio;
|
$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['bn_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['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'];
|
#$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'];
|
#$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'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -354,3 +362,4 @@ $worst=(($bnbinfo['amount']*$bnbinfo['price']*$bnbinfo['rate']*$coininfo->durati
|
|||||||
|
|
||||||
<script src="https://static.laysense.cn/asset/js/app/main.js?" type="text/javascript"></script> </body>
|
<script src="https://static.laysense.cn/asset/js/app/main.js?" type="text/javascript"></script> </body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user