Skip to content

Commit a8ff7d8

Browse files
committed
fix: remove transfer to core vault redemption requests from explorer statistics calculation
1 parent 5e33b6e commit a8ff7d8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/fasset-indexer-api/src/analytics/explorer.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import * as Entities from "fasset-indexer-core/entities"
44
import { PaymentReference } from "fasset-indexer-core/utils"
55
import { EVENTS } from "fasset-indexer-core/config"
66
import { XRP_TRANSACTION_SUCCESS_CODE } from 'fasset-indexer-xrp/constants'
7+
import { unixnow } from "../shared/utils"
8+
import { SharedAnalytics } from "./shared"
79
import * as ExplorerType from "./types"
810
import * as SQL from "./utils/raw-sql"
9-
import { SharedAnalytics } from "./shared"
10-
import { unixnow } from "../shared/utils"
11+
import { DEAD_ADDRESS } from "../config/constants"
1112
import type { EntityManager, ORM } from "fasset-indexer-core/orm"
1213
import type { FilterQuery } from "@mikro-orm/core"
1314

@@ -550,7 +551,11 @@ export class ExplorerAnalytics extends SharedAnalytics {
550551
.join('rr.evmLog', 'rrel')
551552
.join('rpel.block', 'rpeb')
552553
.join('rrel.block', 'rreb')
553-
.where({ 'rpeb.timestamp': { $gte: start, $lt: end } })
554+
.join('rr.redeemer', 'rdmr')
555+
.where({
556+
'rdmr.hex': { $ne: DEAD_ADDRESS },
557+
'rpeb.timestamp': { $gte: start, $lt: end }
558+
})
554559
.groupBy('rr.fasset')
555560
.execute() as { fasset: core.FAssetType, count: number, value: string, time: number }[]
556561
return {

packages/fasset-indexer-api/src/config/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ export const CP_SCORE_MIN_POOL_COLLATERAL_WEI = BigInt("100000000000000000000000
99

1010
export const PRICE_DECIMALS = 8
1111
export const PRICE_FACTOR = BigInt(10 ** PRICE_DECIMALS)
12-
export const MAX_BIPS = BigInt(1e4)
12+
export const MAX_BIPS = BigInt(1e4)
13+
14+
export const DEAD_ADDRESS = '0x000000000000000000000000000000000000dEaD'

0 commit comments

Comments
 (0)