Divvi Protocol - KPI calculation functions / scoutGameV0
Variables
calculateKpi
- HyperSync: Transaction data from Base, Celo, and Polygon networks via HyperSync clients
- Block Data: Timestamps via
getBlockRange
utility for temporal filtering across all networks
- Transaction count accurately represents user engagement across supported networks
- All user-initiated transactions contribute equally to engagement metrics regardless of network or value
- Cross-network transaction aggregation provides comprehensive view of user activity
- Higher transaction counts indicate more active participation in the Scout Game ecosystem
- Both successful and failed transactions represent legitimate user engagement attempts
- Iterates through all supported networks (Base, Celo, Polygon)
- For each network, queries all transactions initiated by user wallet within the time window
- Filters transactions by block timestamp to ensure they fall within the specified time range
- Aggregates transaction counts across all networks
- Returns total cross-network transaction count representing user’s Scout Game engagement
Param
Calculation parametersParam
User wallet address to calculate transaction count forParam
Start of time window for transaction counting (inclusive)Param
End of time window for transaction counting (exclusive)Returns
Promise resolving to total number of transactions across all supported networksSuggest changes to this pageLast updated: Aug 6, 2025, 3:51 PM