Divvi Protocol - KPI calculation functions / fonbnk
Functions
calculateKpi()
- HyperSync: Token transfer events from Fonbnk payout wallets to user addresses
- Fonbnk API: Payout wallet discovery via GET
/api/util/payout-wallets
endpoint - Token Price API: Historical token prices via
fetchTokenPrices
utility for USD conversion - Block Data: Timestamps via
getBlockRange
utility for temporal filtering - Network RPCs: Multi-network transaction data via Viem public clients
- Transaction volume is measured by token transfers from Fonbnk payout wallets to user
- User’s volume contribution is the sum of all transfers received within the time window
- USD conversion uses token prices at time of each transaction for accuracy
- Only transfers from verified Fonbnk payout addresses are included
- Transaction volume represents cash-in transactions from Fonbnk services
- Retrieves verified Fonbnk payout wallet addresses from Fonbnk API
- Queries token transfer events from Fonbnk payout wallets to user address across all supported networks
- Filters transfers by the specified time window using block timestamp data
- Converts transfer amounts to USD using historical token prices at transaction timestamps
- Aggregates USD volume across all networks and token types
- Returns total transaction volume representing cash-in transactions received from Fonbnk
Parameters
params
Calculation parametersaddress
string
User wallet address to calculate transaction volume for
endTimestampExclusive
Date
End of time window for volume calculation (exclusive)
startTimestamp
Date
Start of time window for volume calculation (inclusive)
Returns
Promise
<KpiResult
<string
>>
Promise resolving to total cash-in transaction volume in USD
Suggest changes to this pageLast updated: Aug 6, 2025, 3:51 PM