Domain Model
Class Diagram
«Aggregate Root» IPSProfile
- id : IPSId PK
- userId : UserId
- riskBucket : RiskBucket {5 buckets, 0-100}
- riskScore : int [0..100]
- riskProfiler : RiskProfiler
- investmentHorizon : Duration
- goals : List<Goal>
- constraints : IPSConstraints
- liquidityNeeds : LiquidityProfile
- taxBracket : TaxBracket
- updatedAt : Instant
+ addGoal(goal) : void
+ updateRisk(level, rationale) : void
+ computeScore() : BYLDScore
«Value Object» BYLDScore
- value : int [300 .. 850]
- dimensions : Map<Dimension, Score>
- computedAt : Instant
- version : int
+ grade() : Grade {A+..F}
+ percentile() : int
+ improvementTips() : List<Tip>
«Aggregate» RebalancePlan
- id : PlanId PK
- userId : UserId
- currentAllocation : Allocation
- targetAllocation : Allocation
- actions : List<RebalanceAction>
- status : PlanStatus
- taxImpact : Money
+ approve(userId) : void
+ execute() : List<Order>
+ estimateTax() : Money
«Enum» RiskBucket
CONSERVATIVE (0-30) | MOD_CONSERVATIVE (31-45) | BALANCED (46-60) | GROWTH (61-75) | AGGRESSIVE (76-100)
«Value Object» RiskProfiler
- questions : 8 questions
- attitude : Score (Q1+Q2, w=0.30)
- capacity : Score (Q3+Q4, w=0.25)
- horizon : Score (Q5, w=0.20)
- income : Score (Q6+Q7, w=0.15)
- experience : Score (Q8, w=0.10)
+ computeScore() : int [0..100]
+ toBucket() : RiskBucket
+ modelAllocation() : Allocation
BYLD Score Engine
Score Calculation — 6 Dimensions
Diversification (w=0.20)
Goal Alignment (w=0.25)
Risk Fit (w=0.20)
Tax Efficiency (w=0.10)
Cost Ratio (w=0.10)
Liquidity (w=0.15)
BYLD Score = 300 + 550 × Σ( wi × Si )
wi = weight per dimension
Si = normalized score [0..1]
Range: 300 (worst) .. 850 (best)
742
Grade: A | 87th percentile
300 Poor Fair Good Excellent 850
Rebalancing Engine
Allocation Drift → Target → Actions
Current
AUM
2.4Cr
Equity 35%
Debt 25%
Gold 15%
Intl 10%
REIT 10%
Cash 5%
Target
TARGET
IPS
Equity 45%
Debt 20%
Gold 10%
Intl 15%
REIT 5%
Cash 5%
Rebalance Actions
BUY Parag Parikh Flexi Cap Fund +2,40,000
BUY Motilal Oswal Nasdaq 100 +1,20,000
SELL HDFC Corporate Bond Fund -1,20,000
SELL SBI Gold Fund -1,20,000
SELL Brookfield India REIT -1,20,000
HOLD Liquid Fund (Emergency)
Tax impact: ~18,200 LTCG | Net drift correction: 10% equity shift
Strategy Pattern: Advisory Mode
«interface»
AdvisoryStrategy
+ recommend(ips) : Recommendation
+ canExecute(order) : boolean
+ feeModel() : FeeStructure
+ disclosureRequired() : boolean
«implements»
FiduciaryStrategy
RIA mode (BYLD Wealth) | Fee-only | SEBI RIA
Best-interest standard | Direct plans only
«implements»
SuitabilityStrategy
MFD mode (BYLD Capital) | Commission | AMFI
Suitability standard | Regular plans allowed
API Endpoints + Events
EndpointDescription
POST/api/v1/advisory/ipsCreate/update IPS profile
GET/api/v1/advisory/scoreGet current BYLD Score
GET/api/v1/advisory/recommendationGet rebalance recommendation
POST/api/v1/advisory/rebalance/approveApprove rebalance plan
GET/api/v1/advisory/rebalance/{id}Rebalance execution status
byld.advisory.events.IPSCreated byld.advisory.events.ScoreComputed byld.advisory.events.RebalanceProposed byld.advisory.events.RebalanceApproved byld.advisory.events.RebalanceExecuted byld.advisory.events.DriftDetected
Legend & Notes
Domain
Infra
External
Events
Security
Data
Risk Profiler: 8 questions, 5 weighted dimensions (Attitude 30%, Capacity 25%, Horizon 20%, Income 15%, Experience 10%). Score 0-100 → 5 buckets with model allocations (Equity/Hybrid/Debt/Alternatives).

Dual-mode: AdvisoryStrategy isolates RIA (fiduciary) vs MFD (suitability).

Rebalance requires explicit user approval. Tax-aware: LTCG, STCG, exit load. Fund concentration: max 10% per fund.
"The strategy pattern lets you change the
guts of an object." -- Gang of Four (1994)