You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of these will require SDK functions and maybe view functions in the contracts.
columns in table
Coin
Total Supplied
APY -- Let's actually calculate this off-chain. APY = (100 + APR/n)**n - 100, where APR is a percentage and n = 24 * 365,i.e. hours per year.
Maturity (make it hourly, maybe a count down? users can withdraw within 10 minutes at the beginning of every hour) -- for this you need to get the modulohour property from the HourlyBondSubscriptionLending contract. Either by reading the struct directly from this public variable, which would be called as HourlyBondSubscriptionLendingContract.hourlyBondAccounts(token, lenderAddress), which I believe returns a tuple which I'm not sure how `ethersjs parses that out. Alternatively we could write a new view function or add it to an existing view function.
Actions (withdraw and deposit) -- Speak to the relevant functions in Lending, similarly to how crossDeposit works in the margin-account part of the SDK.
The 3 cells on top of the table
Total Bond (in $) -- the sum of all hourly bonds held by the user, converted to the reference currency. You can get the price by calling this function. The PriceAware contract class is deployed at the same address as the CrossMarginTrading contract -- you may need to use the address of CrossMarginTrading, but the .abi of PriceAware when initializing the Contract object in the typescript code.
Average Yield ( 10 %) -- weighted sum of all APY, weighted by the dollar amount of the hourly bond in that token.
Earnings per day (in $) weighted sum of APR / 365
Please delete the BOND RATE table.
The text was updated successfully, but these errors were encountered:
BOND LENDING
Some of these will require SDK functions and maybe view functions in the contracts.
columns in table
APY = (100 + APR/n)**n - 100
, whereAPR
is a percentage andn = 24 * 365
,i.e. hours per year.HourlyBondSubscriptionLending
contract. Either by reading the struct directly from this public variable, which would be called asHourlyBondSubscriptionLendingContract.hourlyBondAccounts(token, lenderAddress)
, which I believe returns a tuple which I'm not sure how `ethersjs parses that out. Alternatively we could write a new view function or add it to an existing view function.Lending
, similarly to howcrossDeposit
works in themargin-account
part of the SDK.The 3 cells on top of the table
PriceAware
contract class is deployed at the same address as theCrossMarginTrading
contract -- you may need to use the address ofCrossMarginTrading
, but the.abi
ofPriceAware
when initializing theContract
object in the typescript code.APR / 365
Please delete the BOND RATE table.
The text was updated successfully, but these errors were encountered: