Skip to content

feat(analytics): add asset flow visualization engine#173

Open
yusuftomilola wants to merge 1 commit into
MD-Creative-Production:mainfrom
yusuftomilola:feat/asset-flow-visualization-engine
Open

feat(analytics): add asset flow visualization engine#173
yusuftomilola wants to merge 1 commit into
MD-Creative-Production:mainfrom
yusuftomilola:feat/asset-flow-visualization-engine

Conversation

@yusuftomilola

Copy link
Copy Markdown

Summary

Implements the Asset Flow Visualization Engine under �pps/backend/src/modules/analytics/flows/.

Changes

  • interfaces/asset-flow.interface.ts — defines AssetTransfer, FlowNode, FlowEdge, AssetFlowGraph, and AssetFlowQuery
  • �sset-flow.service.ts — AssetFlowService with three methods:
    • generateGraph(transfers) — builds a directed graph of nodes (unique addresses) and edges (address→address per asset) with aggregated amounts and tx counts
    • queryFlow(transfers, query) — filters by address, chain, asset, and date range before generating the graph
    • raceHistory(transfers, address) — returns all transfers for an address sorted chronologically
      
  • �sset-flow.module.ts — NestJS module exporting AssetFlowService
  • �sset-flow.service.spec.ts — unit tests covering graph generation, node/edge aggregation, asset filtering, date range filtering, historical tracing, and edge cases

What was tested

All unit tests pass locally. Follows existing module conventions (reflect-metadata, NestJS Testing, Prettier config).

Closes #142

Implement AssetFlowService under apps/backend/src/modules/analytics/flows/:
- generateGraph(): builds FlowNode/FlowEdge graph from raw transfers
- queryFlow(): filters transfers by address, chain, asset, date range
- traceHistory(): returns address transfers sorted by timestamp

Includes interfaces (AssetTransfer, FlowNode, FlowEdge, AssetFlowGraph)
and unit tests covering graph generation, aggregation, filtering,
and historical tracing.
@mijinummi

Copy link
Copy Markdown
Collaborator

Hello @yusuftomilola , thank you for your contribution. Please kindly fix linting that are failing please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🌊 Create Asset Flow Visualization Engine

2 participants