Calculate Nervos DAO profit between two blocks. This function computes the profit earned from a Nervos DAO deposit based on the capacity and the time period between deposit and withdrawal.
The capacity that earns profit (total capacity minus occupied capacity).
The block header when the DAO deposit was made.
The block header when the DAO withdrawal is made.
The profit amount in CKB (capacity units).
const profit = calcDaoProfit( ccc.fixedPointFrom(100), // 100 CKB profitable capacity depositHeader, withdrawHeader);console.log(`Profit: ${profit} shannons`); Copy
const profit = calcDaoProfit( ccc.fixedPointFrom(100), // 100 CKB profitable capacity depositHeader, withdrawHeader);console.log(`Profit: ${profit} shannons`);
Nervos DAO RFC
Calculate Nervos DAO profit between two blocks. This function computes the profit earned from a Nervos DAO deposit based on the capacity and the time period between deposit and withdrawal.