rhino
Divvi Protocol - KPI calculation functions
Divvi Protocol - KPI calculation functions / rhino
rhino
Functions
calculateKpi()
function calculateKpi(params): Promise<KpiResult<string>>
Defined in: rhino/index.ts:221
Calculates transaction volume for Rhino.fi cross-chain bridge services.
KPI Unit: USD (United States Dollars)
Business Purpose: Measures the transaction volume attributable to a specific user's cross-chain bridge activity through Rhino.fi platform. This metric quantifies the economic activity generated by user interactions with multi-chain bridge services and supports volume analysis for cross-chain infrastructure.
Protocol Context: Rhino.fi is a decentralized exchange and bridge platform that enables cross-chain token transfers and trading. It facilitates asset movement between different blockchain networks through its bridge infrastructure and decentralized exchange services.
Supported Networks: Multiple EVM-compatible networks where Rhino.fi has deployed bridge contracts
Data Sources:
- HyperSync: Bridge transaction events from user wallets to Rhino.fi bridge contracts
- RPC Queries: Bridge contract interactions via Viem public client calls across supported networks
- 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 bridge transaction data across Ethereum, Polygon, Arbitrum, etc.
Business Assumptions:
- Transaction volume is measured by token amounts bridged through Rhino.fi contracts
- User's volume contribution is the sum of all bridge transactions within the time window
- USD conversion uses token prices at time of each transaction for accuracy
- Only interactions with verified Rhino.fi bridge contracts are included
- Transaction volume represents actual cross-chain asset movement
Bridge Types: Token deposits, withdrawals, cross-chain swaps, and multi-chain asset transfers
Calculation Method:
- Identifies verified Rhino.fi bridge contract addresses across all supported networks
- Queries token transfer and bridge interaction events from user wallet within time window
- Filters transactions by bridge contract interactions using event logs and transfer data
- Converts bridge transaction amounts to USD using historical token prices at transaction timestamps
- Aggregates USD volume across all networks and bridge transaction types
- Returns total transaction volume representing cross-chain bridge activity
Parameters
params
Calculation parameters
address
string
User wallet address to calculate bridge 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 bridge transaction volume in USD