Skip to content

feat(analytics): implement behavioral wallet analysis module#174

Open
mftee wants to merge 1 commit into
MD-Creative-Production:mainfrom
mftee:feat/behavioral-wallet-analysis
Open

feat(analytics): implement behavioral wallet analysis module#174
mftee wants to merge 1 commit into
MD-Creative-Production:mainfrom
mftee:feat/behavioral-wallet-analysis

Conversation

@mftee

@mftee mftee commented Jun 19, 2026

Copy link
Copy Markdown

Summary

Implements the Behavioral Wallet Analysis module under �pps/backend/src/modules/behavioral-analysis/.

Changes

  • interfaces/behavioral-analysis.interface.ts — WalletTransaction, WalletProfile, BehaviorBaseline, WalletAnomaly, BehavioralAnalysisResult
  • �ehavioral-analysis.service.ts — BehavioralAnalysisService with:
    • �uildProfile() — generates historical wallet profile (volume, counterparties, first/last seen)
    • �uildBaseline() — establishes behavior baselines (avg daily txs, avg amount, typical counterparties/assets)
    • detectAnomalies() — detects volume spikes (>3× baseline), new counterparties, and unusual assets
    • �nalyze() — full pipeline returning profile + baseline + anomalies
  • �ehavioral-analysis.module.ts — NestJS module exporting the service
  • �ehavioral-analysis.service.spec.ts — unit tests covering all acceptance criteria

What was tested

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

Closes #141

Add apps/backend/src/modules/behavioral-analysis/ with:
- buildProfile(): historical wallet profiling from transactions
- buildBaseline(): compute avg amounts, counterparties, assets
- detectAnomalies(): detect volume spikes, new counterparties, unusual assets
- analyze(): full pipeline returning profile + baseline + anomalies

Includes interfaces and unit tests covering all acceptance criteria.
@mijinummi

Copy link
Copy Markdown
Collaborator

Hi @mftee , please kindly check
CI / Linting (20.x) (pull_request)Cancelled after 22s
CI / Linting (22.x) (pull_request)
CI / Linting (22.x) (pull_request)Failing after 21s
Code Quality & Security / TypeScript Type Checking (pull_request)
Code Quality & Security / TypeScript Type Checking (pull_request)

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.

👤 Implement Behavioral Wallet Analysis

2 participants