Skip to content

Commit 1caab18

Browse files
committed
fix yield amount shown in OTokenRebase entity (it should include the fee)
1 parent 0f83539 commit 1caab18

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/templates/otoken/otoken-entity-producer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ export class OTokenEntityProducer {
351351
rebase = await this.ctx.store.get(OTokenRebase, id)
352352
}
353353

354-
const _yield = totalSupplyDiff
355-
const _fee = (_yield * this.fee) / (100n - this.fee) // yield already has the fee removed.
354+
const _fee = (totalSupplyDiff * this.fee) / (100n - this.fee) // totalSupplyDiff does not include the fee
355+
const _yield = totalSupplyDiff + _fee // yes, yield here includes the fee
356356
let feeETH = 0n
357357
let yieldETH = 0n
358358
let feeUSD = 0n

src/utils/isContract.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const isContract = async (ctx: Context, block: Block, account: string): P
4141

4242
time += Date.now() - start
4343
count++
44-
if (true || process.env.DEBUG_PERF === 'true') {
44+
if (process.env.DEBUG_PERF === 'true') {
4545
ctx.log.info(`isContract ${count} ${time / count}`)
4646
}
4747
return codeAtBlock !== '0x'

0 commit comments

Comments
 (0)