@@ -210,7 +210,7 @@ export class OTokenEntityProducer {
210
210
address : await this . getOrCreateAddress ( from ) ,
211
211
timestamp : new Date ( this . otoken . block . header . timestamp ) ,
212
212
blockNumber : this . otoken . block . header . height ,
213
- txHash : this . otoken . block . header . hash ,
213
+ txHash : trace . transaction ! . hash ,
214
214
type : HistoryType . Sent ,
215
215
value : value ,
216
216
balance : this . otoken . balanceOf ( from ) ,
@@ -226,7 +226,7 @@ export class OTokenEntityProducer {
226
226
address : await this . getOrCreateAddress ( to ) ,
227
227
timestamp : new Date ( this . otoken . block . header . timestamp ) ,
228
228
blockNumber : this . otoken . block . header . height ,
229
- txHash : this . otoken . block . header . hash ,
229
+ txHash : trace . transaction ! . hash ,
230
230
type : HistoryType . Received ,
231
231
value : value ,
232
232
balance : this . otoken . balanceOf ( to ) ,
@@ -238,7 +238,7 @@ export class OTokenEntityProducer {
238
238
return entries
239
239
}
240
240
241
- private async getOrCreateAPYEntity ( ) : Promise < OTokenAPY > {
241
+ private async getOrCreateAPYEntity ( trace : Trace ) : Promise < OTokenAPY > {
242
242
const dateStr = new Date ( this . otoken . block . header . timestamp ) . toISOString ( ) . split ( 'T' ) [ 0 ]
243
243
const id = `${ this . ctx . chain . id } :${ this . otoken . address } :${ dateStr } `
244
244
@@ -275,7 +275,7 @@ export class OTokenEntityProducer {
275
275
otoken : this . otoken . address ,
276
276
timestamp : new Date ( this . otoken . block . header . timestamp ) ,
277
277
blockNumber : this . otoken . block . header . height ,
278
- txHash : this . otoken . block . header . hash ,
278
+ txHash : trace . transaction ! . hash ,
279
279
date : dateStr ,
280
280
apr : 0 ,
281
281
apy : 0 ,
@@ -290,7 +290,7 @@ export class OTokenEntityProducer {
290
290
apy . rebasingCreditsPerToken = currentCreditsPerToken
291
291
apy . timestamp = new Date ( this . otoken . block . header . timestamp )
292
292
apy . blockNumber = this . otoken . block . header . height
293
- apy . txHash = this . otoken . block . header . hash // Not a great field considering we can have more than one rebase per day.
293
+ apy . txHash = trace . transaction ! . hash // Not a great field considering we can have more than one rebase per day.
294
294
295
295
// Calculate APY if we have previous data
296
296
if ( previousApy ) {
@@ -382,7 +382,7 @@ export class OTokenEntityProducer {
382
382
otoken : this . otoken . address ,
383
383
timestamp : new Date ( this . otoken . block . header . timestamp ) ,
384
384
blockNumber : this . otoken . block . header . height ,
385
- txHash : this . otoken . block . header . hash ,
385
+ txHash : trace . transaction ! . hash ,
386
386
totalSupply : this . otoken . totalSupply ,
387
387
rebasingCredits : this . otoken . rebasingCreditsHighres ( ) ,
388
388
rebasingCreditsPerToken : this . otoken . rebasingCreditsPerTokenHighres ( ) ,
@@ -396,13 +396,13 @@ export class OTokenEntityProducer {
396
396
}
397
397
398
398
// Update with current values
399
- rebase . apy = await this . getOrCreateAPYEntity ( )
399
+ rebase . apy = await this . getOrCreateAPYEntity ( trace )
400
400
rebase . totalSupply = this . otoken . totalSupply
401
401
rebase . rebasingCredits = this . otoken . rebasingCreditsHighres ( )
402
402
rebase . rebasingCreditsPerToken = this . otoken . rebasingCreditsPerTokenHighres ( )
403
403
rebase . timestamp = new Date ( this . otoken . block . header . timestamp )
404
404
rebase . blockNumber = this . otoken . block . header . height
405
- rebase . txHash = this . otoken . block . header . hash
405
+ rebase . txHash = trace . transaction ! . hash
406
406
407
407
this . rebaseMap . set ( id , rebase )
408
408
return rebase
@@ -469,7 +469,7 @@ export class OTokenEntityProducer {
469
469
470
470
async afterChangeSupply ( trace : Trace , newTotalSupply : bigint , totalSupplyDiff : bigint ) : Promise < void > {
471
471
await this . getOrCreateOTokenEntity ( )
472
- await this . getOrCreateAPYEntity ( )
472
+ await this . getOrCreateAPYEntity ( trace )
473
473
await this . getOrCreateRebaseEntity ( trace , totalSupplyDiff )
474
474
await Promise . all (
475
475
Object . entries ( this . otoken . creditBalances )
@@ -488,7 +488,7 @@ export class OTokenEntityProducer {
488
488
address : await this . getOrCreateAddress ( account ) ,
489
489
timestamp : new Date ( this . otoken . block . header . timestamp ) ,
490
490
blockNumber : this . otoken . block . header . height ,
491
- txHash : this . otoken . block . header . hash ,
491
+ txHash : trace . transaction ! . hash ,
492
492
type : HistoryType . Yield ,
493
493
value : earnedDiff ,
494
494
balance : this . otoken . balanceOf ( account ) ,
0 commit comments