我试图弄清here得出的保证金水平计算公式:
保证金水平=总资产价值/(借入总额+应计利息总额)
例如,如果我的抵押品是1个BTC,ETH / BTC的价格是0.1,而我借了10个ETH,那么如何计算以下值?
所有内容都是根据基本(ETH)或报价(BTC)资产计算的吗?
根据我的直觉,我可以提出以下细分,但希望得到确认。
例如,如果hour = 1
(借用时间)和eth_hourly_interest_rate = 0.001
:
collateral + (borrowed * current_price)
= 1 BTC +(10 ETH * 0.1)= 2 BTC borrowed * price_at_borrow
= 10 ETH * 0.1 = 1 BTC hour * eth_hourly_interest_rate * current_price
= 1 * 0.001 ETH * 0.1 = 0.0001 BTC 因此,保证金水平= 2 /(1 + 0.0001)=〜1.998
在此示例中,为简单起见,current_price
和price_at_borrow
相同,但是current_price
会随时间变化,而price_at_borrow
将保持不变。
答案 0 :(得分:3)
n小时总应计利息= eth_hourly_interest_rate_hour(0,1)* eth_hourly_interest_rate_hour(1,n)*借入总额*当前价格