Systematic Investment Plan for Precious Metals
Version: 1.2
Author: Swapnil Sharma
Last Updated: May 18, 2025
The SIPPM algorithm is designed to automatically monitor a user's precious metal portfolio (Gold, Silver, Platinum, Palladium) and rebalance it based on configurable thresholds, volatility factors, and market price changes—ensuring an optimized and diversified investment strategy.
| Parameter | Description |
|---|---|
investment_amount |
Total user investment (e.g., ₹100,000) |
rates |
Current metal rates (₹ per gram) |
previous_rate |
Rate used during last purchase or rebalance |
allocation_percent |
User's target allocation for each metal |
volatility_factor |
Adjustment factor based on historical price volatility |
transaction_cost |
Fixed % per buy/sell trade for that metal |
min_trade_amount |
Minimum trade amount to be executed (e.g., ₹200) |
delta_threshold |
Acceptable % deviation before triggering rebalance |
- Retrieve user metals with fields:
symbol,weight(grams),previous_rate,allocation_percentage. - Calculate
current_value = weight * current_rate.
- Fetch real-time INR rate for all metals.
- Recalculate total current value of the portfolio.
For each metal:
actualPercent = (currentValueOfMetal / totalPortfolioValue) * 100
delta = actualPercent - allocationPercent
adjustedDelta = delta * volatilityFactor
- If
abs(adjustedDelta) > deltaThreshold, the metal qualifies for rebalance.
- Metals above allocation → mark for SELL.
- Calculate how much to sell to move back to target allocation.
- Account for
transactionCostand skip trades undermin_trade_amount.
- Distribute freed cash from selling among under-allocated metals.
- Instead of equal buy, prioritize metals with:
- Highest negative delta
- Lower volatility (safer bets)
- Use weightage proportional to:
(abs(delta) * (1 - volatilityFactor))
- Simulate buy/sell based on cash available.
- Calculate expected new weights & project new portfolio allocation.
- Apply
transactionCostto both buy and sell amounts.
- Record all rebalanced units and new weights.
- Log transactions with:
metal,units,action,price,valuedate/time,user_id,delta breached
| Feature | Description |
|---|---|
| Capped Daily Rebalancing | Limit rebalance to once/day/user |
| Volatility-Based Delta | Adjusts sensitivity per metal |
| Transaction Cost Simulation | Includes trading fees in logic |
| Minimum Trade Amount | Skips micro trades |
| Threshold Tolerances | Prevents over-rebalancing |
| Weighted Dynamic Selling | Sell based on deviation magnitude |
| Dynamic Buying | Buy based on need, not equally |
| INR-Based Investment | All values calculated in ₹ |
[
{
"metal": "GOLD",
"weight": 5.2,
"previous_rate": 9215.72,
"current_rate": 9250.0,
"allocation_percent": 40.0,
"actual_percent": 45.0,
"delta": 5.0,
"volatility_factor": 1.1,
"transaction_cost": 0.01
}
]- Cash pool is retained if not enough under-allocated metals are found.
- Trade batcher accumulates trades until they meet the
min_trade_amount. - Cap limit: Only X metals rebalanced per cycle (e.g., 3).
- Machine Learning-based prediction for weight adjustment.
- User-level volatility override.
- Threshold auto-adjustment based on market activity.