Skip to content

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

Merged
mijinummi merged 10 commits into
MD-Creative-Production:mainfrom
mftee:feat/behavioral-wallet-analysis
Jun 21, 2026
Merged

feat(analytics): implement behavioral wallet analysis module#174
mijinummi merged 10 commits into
MD-Creative-Production:mainfrom
mftee:feat/behavioral-wallet-analysis

Conversation

@mftee

@mftee mftee commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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)

@mijinummi mijinummi merged commit 48dc529 into MD-Creative-Production:main Jun 21, 2026
11 checks passed
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