Divvi Protocol - KPI calculation functions / tetherV0
Functions
calculateKpi()
- HyperSync: Transfer event data from USDT and USDT0 token contracts on multiple networks via HyperSync client
- Block Data: Timestamps via
getBlockRange
utility for temporal filtering
- Transactions with net value >= 1 USDT or USDT0 (1,000,000 smallest units) are considered significant
- User’s economic impact is proportional to the number of eligible transactions across all networks
- Both incoming and outgoing transfers contribute to user activity measurement
- Transactions must have a net transfer value (incoming - outgoing) >= 1 USDT or USDT0
- Transactions must fall within the specified time window
- Queries all transactions initiated by user wallet across all supported networks
- Retrieves Transfer events from official Tether token contracts for each network
- Calculates net transfer value per transaction (incoming - outgoing transfers)
- Filters transactions by minimum value threshold (1 USDT)
- Aggregates eligible transaction counts across all networks
- Returns total count representing user’s significant Tether activity
Parameters
params
Calculation parametersaddress
string
User wallet address to calculate transaction count for
endTimestampExclusive
Date
End of time window for calculation (exclusive)
getReferrerIdFromTx?
(transactionHash
, networkId
) => Promise
<null
| string
>
redis?
RedisClientType
Optional Redis client for caching block ranges
startTimestamp
Date
Start of time window for calculation (inclusive)
Returns
Promise
<KpiResults
>
Promise resolving to KPI results grouped by referrer ID with per-network breakdown
Suggest changes to this pageLast updated: Aug 7, 2025, 7:35 PM