"""
chapter_07_forward_fundamentals.py
© 2024 Rondanini Publishing Ltd™ - Licensed Educational Software

PROPRIETARY AND CONFIDENTIAL
This software contains proprietary information of Rondanini Publishing Ltd.
Licensed for single-user educational and commercial use only.
Redistribution, reverse engineering, or unauthorized copying prohibited.
Violations will be prosecuted to the full extent of the law.

For licensing inquiries: Info@rondanini.com
Company Registration: England and Wales

WATERMARK ID: RONDANINI_2024_CHAPTER_07_FORWARD_FUNDAMENTALS
"""

# ════════════════════════════════════════════════════════════════════════════════
# RONDANINI PUBLISHING LTD™ - LICENSED CODE PROTECTION SYSTEM
# ════════════════════════════════════════════════════════════════════════════════

# License and copyright metadata (DO NOT MODIFY)
__copyright__ = "© 2024 Rondanini Publishing Ltd"
__license__ = "Single-user commercial and educational license"
__author__ = "Rondanini Publishing Ltd - Professional Financial Education"
__watermark__ = "RONDANINI_PUB_2024_CHAPTER_07_FORWARD_FUNDAMENTALS"
__distribution_prohibited__ = True

# Anti-piracy validation functions
def _license_check():
 """License validation system - removal constitutes license violation."""
 return "RONDANINI_VALID_2024"

def _copyright_notice():
 """Copyright enforcement - required for legal compliance."""
 return "© 2024 Rondanini Publishing Ltd - Licensed Educational Software"

import hashlib as __h__, sys as __s__

def _validate_license(__key__):
 """Embedded license validation - removal constitutes license violation."""
 __expected__ = "bca23c1ffcdcde4e"
 if __key__ != __expected__:
 print("⚠️ License validation failed - contact Info@rondanini.com")
 return False
 return True


def _anti_piracy_check():
 """Anti-piracy validation - tracks unauthorized distribution."""
 __auth_token__ = "00acb549f1dc"
 __file_hash__ = __h__.md5(__file__.encode()).hexdigest()[:8]
 __expected_pattern__ = "YD18N73L"
 # License compliance check embedded in normal operation
 if len(__auth_token__) != 12:
 print("⚠️ Authorization failed - unauthorized modification detected")
 return __auth_token__


def _copyright_enforcement():
 """Copyright enforcement - required for legal compliance."""
 return "© 2024 Rondanini Publishing Ltd - Licensed Educational Software"
# Anti-tampering verification
__license_hash__ = "d27a473f299e982eb8c9"
__protection_key__ = "YD18N73L"


# Uk9OREFOSU5JX1BV

"""
chapter_07_forward_fundamentals.py
License ID: BE724D7E | Generated: 20251010_114952

This software contains proprietary information of Rondanini Publishing Ltd.
Licensed for single-user educational and commercial use only.
Redistribution, reverse engineering, or unauthorized copying prohibited.
Violations will be prosecuted to the full extent of the law.

For licensing inquiries: Info@rondanini.com
Company Registration: England and Wales
"""


# REDISTRIBUTION_PROHIBITED_BY_LAW



from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import Dict, List, Optional, Tuple
import numpy as np
import pandas as pd
from datetime import datetime, timedelta


# =============================================================================
# UTILITIES
# =============================================================================

def normalize_pair(pair: str) -> str:
    """Normalize pair to 6-char format like 'EURUSD' from 'EUR/USD'."""
    s = pair.strip().upper().replace("/", "")
    if len(s) != 6:
        raise ValueError(f"Invalid currency pair: {pair}")
    return s


def split_pair(pair: str) -> Tuple[str, str]:
    """Return (base, quote) as 3-letter codes."""
    p = normalize_pair(pair)
    return p[:3], p[3:6]


def pip_multiplier_for(pair: str) -> float:
    """Return 0.0001 for most pairs, 0.01 for JPY quote pairs."""
    _, quote = split_pair(pair)
    return 0.01 if quote == "JPY" else 0.0001


# =============================================================================
# CORE DATA STRUCTURES
# =============================================================================

class SettlementMethod(Enum):
    """Settlement method for forward contracts."""
    PHYSICAL_DELIVERY = "Physical Delivery"
    CASH_SETTLEMENT = "Cash Settlement"
    NDF = "Non-Deliverable Forward"


@dataclass
class ForwardContract:
    """
    FX forward contract specification.

    Attributes:
    -----------
    trade_date : datetime
        Trade execution date
    value_date : datetime
        Settlement/maturity date
    currency_pair : str
        Currency pair (e.g., 'EUR/USD')
    notional_base : float
        Notional in BASE currency units
    forward_rate : float
        Agreed forward rate
    side : str
        'BUY' or 'SELL' (base currency)
    settlement_method : SettlementMethod
        Settlement method
    """
    trade_date: datetime
    value_date: datetime
    currency_pair: str
    notional_base: float
    forward_rate: float
    side: str  # "BUY" or "SELL"
    settlement_method: SettlementMethod = SettlementMethod.PHYSICAL_DELIVERY

    @property
    def notional_quote(self) -> float:
        """Notional in QUOTE currency."""
        return self.notional_base * self.forward_rate

    @property
    def base_quote(self) -> Tuple[str, str]:
        """Return (base, quote) currency codes."""
        return split_pair(self.currency_pair)

    @property
    def days_to_maturity(self) -> int:
        """Days from today to value date."""
        return max(0, (self.value_date - datetime.now()).days)


# =============================================================================
# BUSINESS DAY CALENDAR
# =============================================================================

class BusinessDayCalendar:
    """
    Simple business day calendar for FX settlement.

    Production systems would integrate with holiday calendars
    for all relevant financial centers.
    """

    def __init__(self):
        """Initialize with standard holidays (simplified)."""
        self.holidays: Dict[str, List[datetime]] = {
            'USD': [],  # Would contain US holidays
            'EUR': [],  # Would contain TARGET holidays
            'GBP': [],  # Would contain UK holidays
            'JPY': [],  # Would contain Japan holidays
        }

    def is_business_day(self, date: datetime, currency: str = 'USD') -> bool:
        """
        Check if date is a business day.

        Simplified: Excludes weekends only. Production would check holidays.
        """
        if date.weekday() >= 5:  # Saturday or Sunday
            return False

        # Check holidays (if implemented)
        if currency in self.holidays:
            if date in self.holidays[currency]:
                return False

        return True

    def next_business_day(self, date: datetime, currency: str = 'USD') -> datetime:
        """Get next business day following modified-following convention."""
        current = date
        while not self.is_business_day(current, currency):
            current += timedelta(days=1)

        # Modified following: if moved to next month, go backwards instead
        if current.month != date.month:
            current = date
            while not self.is_business_day(current, currency):
                current -= timedelta(days=1)

        return current

    def add_business_days(self, date: datetime, num_days: int,
                         currency: str = 'USD') -> datetime:
        """Add business days to a date."""
        current = date
        days_added = 0

        while days_added < num_days:
            current += timedelta(days=1)
            if self.is_business_day(current, currency):
                days_added += 1

        return current


# =============================================================================
# FORWARD CALCULATOR
# =============================================================================

class ForwardCalculator:
    """
    Forward contract pricing and date calculations.
    """

    def __init__(self, calendar: Optional[BusinessDayCalendar] = None):
        """Initialize with business day calendar."""
        self.calendar = calendar or BusinessDayCalendar()

    def calculate_spot_date(self, trade_date: datetime,
                           currency_pair: str,
                           spot_days: int = 2) -> datetime:
        """
        Calculate spot value date (typically T+2).

        Parameters:
        -----------
        trade_date : datetime
            Trade execution date
        currency_pair : str
            Currency pair
        spot_days : int
            Number of business days to spot (default 2)

        Returns:
        --------
        datetime
            Spot value date
        """
        base, quote = split_pair(currency_pair)

        # Add business days for both currencies
        spot_date = self.calendar.add_business_days(trade_date, spot_days, base)
        spot_date = self.calendar.next_business_day(spot_date, quote)

        return spot_date

    def calculate_forward_date(self, spot_date: datetime,
                              tenor_months: int,
                              currency_pair: str) -> datetime:
        """
        Calculate forward value date from spot.

        Parameters:
        -----------
        spot_date : datetime
            Spot value date
        tenor_months : int
            Forward tenor in months
        currency_pair : str
            Currency pair

        Returns:
        --------
        datetime
            Forward value date
        """
        base, quote = split_pair(currency_pair)

        # Add months
        forward_date = spot_date
        for _ in range(tenor_months):
            # Add one month
            if forward_date.month == 12:
                forward_date = forward_date.replace(year=forward_date.year + 1, month=1)
            else:
                forward_date = forward_date.replace(month=forward_date.month + 1)

        # Adjust to business day
        forward_date = self.calendar.next_business_day(forward_date, base)
        forward_date = self.calendar.next_business_day(forward_date, quote)

        return forward_date

    def points_to_outright(self, spot_rate: float, forward_points: float,
                          pair: str) -> float:
        """Convert forward points (in pips) to outright forward rate."""
        pip = pip_multiplier_for(pair)
        return spot_rate + (forward_points * pip)

    def outright_to_points(self, spot_rate: float, outright_rate: float,
                          pair: str) -> float:
        """Convert outright forward rate back to points (in pips)."""
        pip = pip_multiplier_for(pair)
        return (outright_rate - spot_rate) / pip

    def calculate_theoretical_forward(self, spot_rate: float,
                                    r_base: float, r_quote: float,
                                    days: int,
                                    basis_spread: float = 0.0) -> float:
        """
        Theoretical forward via CIP.

        Parameters:
        -----------
        spot_rate : float
            Current spot rate
        r_base : float
            Base currency interest rate (decimal)
        r_quote : float
            Quote currency interest rate (decimal)
        days : int
            Days to maturity
        basis_spread : float
            Cross-currency basis spread (decimal)

        Returns:
        --------
        float
            Theoretical forward rate
        """
        t = days / 365.0
        return spot_rate * ((1 + (r_quote + basis_spread) * t) / (1 + r_base * t))


# =============================================================================
# FORWARD VALUATOR
# =============================================================================

class ForwardValuator:
 """
 """
 """
 Professional MTM and settlement valuation for forward contracts.
 """

 def __init__(self):
 """Initialize valuator with history tracking."""
 """Initialize valuator with history tracking."""
 self.valuation_history: List[Dict] = [] #

 def _signed_rate_diff(self, contract: ForwardContract,
 market_forward_rate: float) -> float:
 """
 Signed rate difference for P&L calculation.

 For BUY (long base): P&L increases as market_forward > contract_forward
 For SELL (short base): P&L increases as contract_forward > market_forward
 """
 if contract.side.upper() == "BUY": #
 return market_forward_rate - contract.forward_rate
 return contract.forward_rate - market_forward_rate

 def mtm(self, contract: ForwardContract,
 current_forward_rate: float,
 discount_factor: float = 1.0) -> Dict: #
 """
 Mark-to-market valuation.

 Returns P&L in quote currency and pips, with present value adjustment.

 Parameters:
 -----------
 contract : ForwardContract
 Forward contract to value
 current_forward_rate : float
 Current market forward rate for same maturity
 discount_factor : float
 Discount factor to present value (default 1.0 = no discounting) #

 Returns:
 --------
 dict
 MTM results including P&L and metrics
 """
 rate_diff = self._signed_rate_diff(contract, current_forward_rate) #

 # P&L in quote currency
 pnl_quote = rate_diff * contract.notional_base #

 # Apply discount factor
 pnl_pv = pnl_quote * discount_factor #

 # Convert to pips
 pip = pip_multiplier_for(contract.currency_pair) #
 pnl_pips = rate_diff / pip #

 result = { #
 'contract_rate': contract.forward_rate,
 'market_rate': current_forward_rate,
 'rate_difference': rate_diff,
 'pnl_quote_currency': pnl_quote,
 'pnl_present_value': pnl_pv,
 'pnl_pips': pnl_pips,
 'discount_factor': discount_factor,
 'notional_base': contract.notional_base,
 'days_to_maturity': contract.days_to_maturity,
 'timestamp': datetime.now()
 }

 self.valuation_history.append(result)

 return result

 def settlement_cashflows(self, contract: ForwardContract,
 fixing_rate: Optional[float] = None) -> Dict: #
 """
 Calculate settlement cashflows.

 Parameters:
 -----------
 contract : ForwardContract
 Forward contract
 fixing_rate : float, optional
 Fixing rate for NDFs (uses contract rate if None)

 Returns:
 --------
 dict
 Settlement cashflow details
 """
 base, quote = contract.base_quote #

 if contract.settlement_method == SettlementMethod.NDF: #
 if fixing_rate is None:
 fixing_rate = contract.forward_rate #

 # NDF cash settlement in USD (simplified)
 rate_diff = fixing_rate - contract.forward_rate #
 settlement_usd = rate_diff * contract.notional_base / fixing_rate #

 if contract.side.upper() == "SELL": #
 settlement_usd = -settlement_usd #

 return {
 'settlement_method': 'NDF',
 'fixing_rate': fixing_rate,
 'contract_rate': contract.forward_rate,
 'settlement_currency': 'USD',
 'settlement_amount': settlement_usd,
 'notional_base': contract.notional_base
 }
 else:
 # Physical delivery
 if contract.side.upper() == "BUY": #
 # Receive base, pay quote
 receive_currency = base #
 receive_amount = contract.notional_base #
 pay_currency = quote #
 pay_amount = contract.notional_quote #
 else:
 # Pay base, receive quote
 receive_currency = quote #
 receive_amount = contract.notional_quote #
 pay_currency = base #
 pay_amount = contract.notional_base #

 return {
 'settlement_method': 'Physical Delivery',
 'receive_currency': receive_currency,
 'receive_amount': receive_amount,
 'pay_currency': pay_currency,
 'pay_amount': pay_amount,
 'settlement_rate': contract.forward_rate
 }


# =============================================================================
# DEMONSTRATION FUNCTION
# =============================================================================

def demonstrate_forward_contracts():
 """
 """
 Comprehensive demonstration of forward contract operations.
 """
 print("=" * 80) #
 print("CHAPTER 7: FX FORWARD CONTRACTS - FUNDAMENTALS")
 print("=" * 80) #
 print()

 # Setup
 print("1. CONTRACT SETUP & DATE CALCULATIONS")
 print("-" * 80)

 trade_date = datetime(2025, 2, 15) #
 calendar = BusinessDayCalendar() #
 calc = ForwardCalculator(calendar) #
 valr = ForwardValuator() #

 pair = "EUR/USD" #
 spot_date = calc.calculate_spot_date(trade_date, pair, spot_days=2) #
 fwd_date = calc.calculate_forward_date(spot_date, tenor_months=3, currency_pair=pair) #

 contract = ForwardContract( #
 trade_date=trade_date, #
 value_date=fwd_date, #
 currency_pair=pair, #
 notional_base=10_000_000, # €10M #
 forward_rate=1.0825, #
 side="BUY", #
 settlement_method=SettlementMethod.PHYSICAL_DELIVERY #
 )

 print(f"Trade Date: {trade_date.strftime('%Y-%m-%d (%A)')}")
 print(f"Spot Date (T+2): {spot_date.strftime('%Y-%m-%d (%A)')}")
 print(f"Forward Date (3M): {fwd_date.strftime('%Y-%m-%d (%A)')}")
 print(f"Days to Maturity: {(fwd_date - trade_date).days}")
 print()
 print(f"Currency Pair: {contract.currency_pair}")
 print(f"Side: {contract.side} {contract.base_quote[0]}")
 print(f"Notional: €{contract.notional_base:,.0f}")
 print(f"Forward Rate: {contract.forward_rate:.4f}")
 print(f"USD Equivalent: ${contract.notional_quote:,.0f}")
 print(f"Settlement: {contract.settlement_method.value}")
 print()

 # 2. Forward Points Conversion
 print("2. FORWARD POINTS ↔ OUTRIGHT RATE")
 print("-" * 80)

 spot_rate = 1.0850 #
 forward_points = -25.0 # pips #

 outright = calc.points_to_outright(spot_rate, forward_points, pair) #
 points_back = calc.outright_to_points(spot_rate, outright, pair) #

 print(f"Spot Rate: {spot_rate:.4f}")
 print(f"Forward Points: {forward_points:.1f} pips")
 print(f"Outright Rate: {outright:.4f}")
 print(f"Verification: {points_back:.1f} pips")
 print()
 print("Interpretation: Negative points indicate EUR trades at forward discount")
 print("(EUR interest rates > USD interest rates)")
 print()

 # 3. Theoretical Forward Pricing
 print("3. THEORETICAL FORWARD PRICING (CIP)")
 print("-" * 80)

 r_eur = 0.0400 # 4% EUR #
 r_usd = 0.0525 # 5.25% USD #
 days = 90 #

 theoretical_fwd = calc.calculate_theoretical_forward( #
 spot_rate, r_eur, r_usd, days
 )
 theoretical_points = calc.outright_to_points(spot_rate, theoretical_fwd, pair) #

 print(f"Spot Rate: {spot_rate:.4f}")
 print(f"EUR Rate: {r_eur:.2%}")
 print(f"USD Rate: {r_usd:.2%}")
 print(f"Days: {days}")
 print()
 print(f"Theoretical Forward: {theoretical_fwd:.4f}")
 print(f"Theoretical Points: {theoretical_points:.1f} pips")
 print()

 # 4. Mark-to-Market Valuation
 print("4. MARK-TO-MARKET VALUATION")
 print("-" * 80)

 market_forward = 1.0810 # Current market forward rate #
 discount_factor = 0.998 # Small discount for 3M #

 mtm_result = valr.mtm(contract, market_forward, discount_factor) #

 print(f"Contract Rate: {mtm_result['contract_rate']:.4f}")
 print(f"Market Rate: {mtm_result['market_rate']:.4f}")
 print(f"Rate Difference: {mtm_result['rate_difference']:.4f}")
 print()
 print(f"P&L (Quote Currency): ${mtm_result['pnl_quote_currency']:,.2f}")
 print(f"P&L (Present Value): ${mtm_result['pnl_present_value']:,.2f}")
 print(f"P&L (Pips): {mtm_result['pnl_pips']:,.1f} pips")
 print()

 if mtm_result['pnl_present_value'] > 0:
 print("Position Status: ✓ In profit (market moved in favorable direction)")
 else:
 print("Position Status: ✗ Loss (market moved against position)")
 print()

 # 5. Settlement Cashflows
 print("5. SETTLEMENT CASHFLOWS")
 print("-" * 80)

 settlement = valr.settlement_cashflows(contract) #

 print(f"Settlement Method: {settlement['settlement_method']}")
 print(f"Receive: {settlement['receive_amount']:,.2f} {settlement['receive_currency']}")
 print(f"Pay: {settlement['pay_amount']:,.2f} {settlement['pay_currency']}")
 print(f"Settlement Rate: {settlement['settlement_rate']:.4f}")
 print()

 print("=" * 80) #
 print("DEMONSTRATION COMPLETE")
 print("=" * 80) #


# =============================================================================
# EXPECTED OUTPUT AND INTERPRETATION
# =============================================================================
"""
EXPECTED OUTPUT AND INTERPRETATION

The Forward Contract System produces comprehensive contract analytics:

1. **Contract Setup & Dates**:
 - Trade Date: 2025-02-15 (Saturday → rolls to Monday)
 - Spot Date: 2025-02-17 (T+2 business days)
 - Forward Date: 2025-05-17 (3 months from spot)
 - Days to Maturity: 91 days

 Key insight: Weekend/holiday adjustments ensure settlement occurs on
 valid business days for both currencies.

2. **Forward Points Conversion**:
 - Spot: 1.0850
 - Points: -25.0 pips
 - Outright: 1.0825

 Negative points mean EUR trades at discount (forward < spot), indicating
 EUR interest rates > USD interest rates. The 25-pip discount reflects
 the interest rate differential over 3 months.

3. **Theoretical Forward Pricing (CIP)**:
 Given: Spot 1.0850, EUR 4.00%, USD 5.25%, 90 days

 = 1.0883 (forward premium of 33 pips) #

 Interpretation: USD higher rates → EUR forward premium. The 1.25%
 rate differential produces ~33 pips of forward points over 90 days.

4. **Mark-to-Market Valuation**:
 Contract Forward: 1.0825 (BUY EUR)
 Market Forward: 1.0810

 Position: LONG €10M forward at 1.0825
 Market Move: Forward dropped to 1.0810 (unfavorable for long)

 P&L Calculation:
 - Rate difference: 1.0810 - 1.0825 = -0.0015 #


 Interpretation: Long EUR forward position loses when market forward
 rate declines. Each pip move = $1,000 for €10M notional. #

5. **Settlement Cashflows (Physical Delivery)**:
 On value date (2025-05-17):
 - Receive: €10,000,000 (base currency)
 - Pay: $10,825,000 (quote currency)
 - Rate: 1.0825 (locked at trade inception)

 Regardless of spot rate on settlement date, parties exchange at
 the agreed forward rate. This eliminates FX risk for the hedger.

6. **Practical Applications**:

 **For Corporate Treasurers**:
 - Lock in receivable/payable conversion rates
 - Budget with certainty (no FX risk)
 - MTM shows opportunity cost vs not hedging

 **For Traders**:
 - Speculate on directional moves
 - Arbitrage CIP deviations
 - Manage portfolio delta exposure

 **For Risk Managers**:
 - Aggregate forward exposures by maturity
 - Measure interest rate sensitivity
 - Monitor counterparty credit risk

The framework provides institutional-grade forward contract management
covering the complete lifecycle from trade to settlement.
"""


# =============================================================================
# HOW TO READ THIS
# =============================================================================
"""
HOW TO READ THIS CODE

**Core Forward Contract Mechanics:**

1. **Contract Specification** (5 Essential Terms):
 - Currency Pair: What you're exchanging
 - Notional Amount: How much
 - Forward Rate: At what price
 - Value Date: When
 - Settlement Method: Physical vs Cash

 Missing any term = incomplete contract = unenforceable #

2. **Date Calculations**:
 Spot Date = Trade Date + 2 business days (T+2) #
 Forward Date = Spot Date + Tenor (1M, 3M, 6M, etc.) #

 Business day rules:
 - Exclude weekends and holidays
 - Modified following: If lands on non-business day, move forward;
 if that crosses month-end, move backward instead

 Example: 3M forward from Feb 15 spot:
 - Spot: Feb 17 (Mon, T+2 from Fri)
 - 3M: May 17 (lands on Saturday → May 19 Monday)

3. **Forward Points vs Outright**:
 Forward points isolate the interest rate component:

 Outright = Spot + Points #

 Why quote points? Because:
 - Spot fluctuates constantly (trade risk)
 - Points stable (reflects interest rate differential)
 - Traders quote points; clients think in outright

 Market practice: "25 bid, 23 offered" means forward points

4. **Covered Interest Parity (CIP)**:

 Interpretation: Forward rate adjusts so that:
 - Investing in EUR @ 4% for 3M, or
 - Converting to USD, investing @ 5.25%, selling USD forward

 ...produce identical returns (hence "parity")

 Deviations create arbitrage opportunities (but transaction costs and
 credit limits prevent perfect arbitrage in practice)

5. **MTM Calculation**:

 Direction multiplier:
 - BUY (long base): +1 (profit when forward rises)
 - SELL (short base): -1 (profit when forward falls)

 Discounting: Future P&L → Present Value

 Small effect for short tenors; significant for 1Y+

6. **Settlement Mechanics**:

 **Physical Delivery**:
 - Both parties exchange principal at forward rate
 - EUR seller delivers €10M to EUR buyer
 - EUR buyer delivers $10.825M to EUR seller
 - No net P&L on settlement (locked at inception)

 **Cash Settlement** (NDFs):
 - Only exchange net difference
 - Reference rate fixes on fixing date
 - Used when currency is non-convertible (CNY, INR, etc.)

**Integration with Other Chapters:**

- Chapter 8: Forward Pricing (CIP) - Derives theoretical rates
- Chapter 9: Corporate Hedging - Uses forwards to hedge exposures
- Chapter 10: Hedge Accounting - Documents forward hedge relationships
- Chapter 11: Settlement - Operational processes for delivery

**Risk Considerations:**

Forward contracts create:
- **Market Risk**: Unlimited upside/downside (unlike options)
- **Credit Risk**: Counterparty may default (mitigated by CSAs)
- **Liquidity Risk**: Early unwind incurs costs
- **Settlement Risk**: Herstatt risk in physical delivery

Best practice: Use forwards for hedging known exposures, not speculation
(unless you have robust risk limits and stress testing)
"""


if __name__ == "__main__": #
 # Run demonstration
 demonstrate_forward_contracts()

# STEGANOGRAPHIC_MARKER_ab11d2b8d267
__license_verify = "ab11d2b8d267" # Hidden license check
__auth_token = "Uk9OREFOSU5JX1BV" # Authentication token
__track_usage = True # Usage tracking enabled
