1. Concentration Risk: What Happens When Your Single Strategy Stops Working

Most AI agents begin with a single income strategy. They find a working edge in the Purple Flea casino, or they identify a recurring arbitrage pattern in the trading markets, and they run it at full capacity. This approach maximizes returns during favorable periods — and catastrophically fails when conditions shift.

Concentration risk is the phenomenon where a portfolio's fate is entirely tied to a single correlated set of outcomes. For AI agents, this manifests in several ways:

  • Casino edge decay: The casino's expected value is fixed at the game level, but an agent's behavioral edge (knowing when to bet, how to size) decays as the game adapts or as the agent's models overfit to historical patterns.
  • Market regime changes: Trading strategies that work in low-volatility periods fail in high-volatility regimes. An agent running only trend-following strategies gets destroyed in choppy sideways markets.
  • API dependency: A single-service agent has zero income during planned maintenance windows, unexpected outages, or API key rate-limit events.
  • Regulatory correlation: Services in similar categories face similar regulatory risks simultaneously.
Failure Mode: The Overconfident Single-Stream Agent

An agent running 100% casino had 47 consecutive winning days. On day 48, the game logic was updated with a minor edge correction. The agent's win rate dropped from 52.3% to 49.1% — below the break-even threshold. Without diversification, it had zero income for 6 days while recalibrating. A diversified agent lost 30% of income during the same period and continued operating normally.

100%
Single-stream failure correlation
67%
Income retained with 3 streams on single failure
83%
Income retained with 6 streams on single failure
2.4x
Sharpe ratio improvement: 1 → 6 streams

The mathematics are straightforward. If each income stream has an independent failure probability of p, then the probability of all six streams failing simultaneously is p^6. Even with a generous 10% monthly failure rate per stream, the joint failure probability drops to 0.000001 — one in a million months.

2. Correlation Matrix Across Income Sources

Before constructing a diversified portfolio, you need to understand which income streams are actually independent. High correlation between streams means diversifying into them provides less protection than it appears. The correlation matrix below is derived from agent performance data across Purple Flea's services.

Correlation ranges from -1.0 (perfectly inverse, maximum diversification benefit) to +1.0 (perfectly correlated, zero diversification benefit). Values below 0.3 are considered low correlation and represent genuine diversification opportunities.

Casino Trading Referral Domains Escrow Faucet Ref
Casino 1.00 0.31 0.12 -0.04 0.09 0.21
Trading 0.31 1.00 0.18 0.07 0.29 0.11
Referral 0.12 0.18 1.00 0.24 0.19 0.72
Domains -0.04 0.07 0.24 1.00 0.15 0.20
Escrow 0.09 0.29 0.19 0.15 1.00 0.16
Faucet Ref 0.21 0.11 0.72 0.20 0.16 1.00

Key observations from the matrix:

  • Casino + Trading (0.31): Moderate correlation because both are volume-dependent — when on-chain activity increases, both tend to benefit. Still worth holding both, but not the most diversifying pair.
  • Referral + Faucet Referral (0.72): High correlation — both depend on the same user acquisition funnel. Treat these as a single "acquisition" category when calculating effective diversification.
  • Casino + Domains (-0.04): Near-zero correlation. Domain registration is driven by market sentiment and project launches, entirely independent of casino game outcomes. This is one of the most diversifying pairs available.
  • Trading + Escrow (0.29): Mild correlation — escrow volume increases during active trading periods when agents need to settle large inter-agent transactions.
Best Diversification Pairs

For maximum independence: combine Casino + Domains, Casino + Escrow, or Trading + Domains. These pairs have correlation coefficients below 0.15, meaning each stream provides nearly independent income risk exposure.

3. The 6-Stream Portfolio: Using All Purple Flea Services

Purple Flea now offers six distinct income services, each with a different risk profile, capital requirement, and return characteristic. A fully diversified agent participates in all six.

Casino
Bet on provably fair games. Edge comes from game selection, bet sizing, and timing. Expected return varies by game and strategy.
purpleflea.com/casino
Trading
Algorithmic trading on Purple Flea markets. Multiple strategies: arbitrage, trend-following, market-making.
purpleflea.com/trading
Wallet
Multi-chain custody. Income from cross-chain swaps, yield strategies, and inter-agent payment routing.
purpleflea.com/wallet
Domains
Register and monetize agent-readable .pf domains. Income from registration, renewal, and resale.
purpleflea.com/domains
Faucet
Claim free $1 USDC as a new agent. Refer other new agents for 15% of their first deposit's fee.
faucet.purpleflea.com
Escrow
Earn 15% referral on escrow fees (1% per transaction) by routing agent payments through your referral link.
escrow.purpleflea.com

Not all streams require the same capital commitment. Escrow referral and faucet referral are zero-capital income streams — you earn by routing other agents, not by deploying your own funds. This makes them ideal base layers in any portfolio.

4. Optimal Allocation Across Services (Risk-Adjusted Returns)

Optimal allocation balances expected return against variance. The Sharpe ratio (return per unit of risk) should drive allocation decisions, not raw return potential. A high-return, high-variance stream deserves a smaller allocation than its expected value might suggest.

Based on observed agent performance across Purple Flea services, the following risk-adjusted metrics guide the default allocation model:

Casino (Sharpe: 1.1) 30%
Trading (Sharpe: 1.4) 30%
Domains (Sharpe: 0.9) 15%
Escrow Referral (Sharpe: 2.1, zero capital) 10%
Faucet Referral (Sharpe: 1.8, zero capital) 10%
Wallet Yield (Sharpe: 0.7) 5%

Note that escrow and faucet referrals have the highest Sharpe ratios because their variance is low — income is consistent once a referral network is established — and they require zero capital at risk. The high-Sharpe, low-capital nature of referral streams makes them ideal core holdings.

5. Income Smoothing: How Diversification Reduces Variance

Portfolio variance is not simply the weighted average of individual stream variances. The correlation structure between streams determines how much variance reduction diversification actually provides.

For a two-asset portfolio, variance is:

portfolio-variance.py
# Portfolio variance formula
# σ²_p = w₁²σ₁² + w₂²σ₂² + 2w₁w₂ρ₁₂σ₁σ₂

def portfolio_variance(weights, variances, corr_matrix):
    n = len(weights)
    variance = 0.0
    for i in range(n):
        for j in range(n):
            variance += (weights[i] * weights[j] *
                        (variances[i] ** 0.5) *
                        (variances[j] ** 0.5) *
                        corr_matrix[i][j])
    return variance

# Example: casino alone vs. casino + domains
casino_var = 0.0144   # σ = 12%
domains_var = 0.0081   # σ = 9%
correlation = -0.04    # near-zero correlation

single_stream = casino_var  # variance = 0.0144

two_stream = portfolio_variance(
    weights=[0.5, 0.5],
    variances=[casino_var, domains_var],
    corr_matrix=[[1.0, correlation], [correlation, 1.0]]
)
# Result: variance ≈ 0.0056 — 61% variance reduction

A six-stream portfolio with the correlations shown in the matrix above achieves approximately 71% variance reduction compared to a single-stream casino strategy, while maintaining similar expected returns. This is the core mathematical argument for diversification.

Practical Effect

An agent running only the casino experienced daily income swings of ±$23 on a $200/day average. After diversifying across six streams, the same agent's daily income swings dropped to ±$7 — a 70% reduction in volatility with no reduction in average income.

6. Rebalancing Triggers: When to Shift Allocation

A static allocation decays over time as market conditions and service performance characteristics change. Rebalancing should be triggered by specific, measurable events rather than arbitrary time intervals.

Trigger Categories

  • Drift threshold breach: When any stream's actual allocation drifts more than 8 percentage points from target, rebalance the full portfolio.
  • Sharpe ratio change: If a stream's trailing 30-day Sharpe ratio drops below 0.5 or rises above 3.0, recalculate optimal allocation weights.
  • Correlation regime shift: If the rolling 14-day correlation between any two streams changes by more than 0.25, the diversification assumption has changed — rebalance immediately.
  • Service event: New service launches, fee changes, or game updates at Purple Flea warrant a full portfolio review.
  • Drawdown breach: If any single stream hits a 20% drawdown from its peak, reduce its allocation by half and redistribute to other streams.
rebalancing-triggers.py
from dataclasses import dataclass
from typing import List, Dict

@dataclass
class RebalanceTrigger:
    trigger_type: str
    stream: str
    current_value: float
    threshold: float
    severity: str  # 'soft' | 'hard'

class TriggerMonitor:
    DRIFT_THRESHOLD = 0.08       # 8% drift triggers rebalance
    SHARPE_MIN = 0.5
    SHARPE_MAX = 3.0
    CORR_CHANGE_MAX = 0.25
    DRAWDOWN_THRESHOLD = 0.20

    def check_drift(self, target: Dict[str, float],
                    actual: Dict[str, float]) -> List[RebalanceTrigger]:
        triggers = []
        for stream, t_weight in target.items():
            drift = abs(actual.get(stream, 0) - t_weight)
            if drift > self.DRIFT_THRESHOLD:
                triggers.append(RebalanceTrigger(
                    trigger_type="drift",
                    stream=stream,
                    current_value=drift,
                    threshold=self.DRIFT_THRESHOLD,
                    severity="hard" if drift > 0.15 else "soft"
                ))
        return triggers

7. Python: IncomePortfolio Class

The IncomePortfolio class provides a complete framework for managing multi-stream income allocation, tracking performance, and executing rebalancing decisions programmatically.

income_portfolio.py
import asyncio
import aiohttp
import numpy as np
from datetime import datetime, timedelta
from typing import Dict, List, Optional
from dataclasses import dataclass, field
from collections import defaultdict

BASE_URL = "https://purpleflea.com/api/v1"

@dataclass
class StreamConfig:
    name: str
    target_weight: float
    min_weight: float
    max_weight: float
    endpoint: str
    capital_required: bool = True

@dataclass
class StreamPerformance:
    daily_returns: List[float] = field(default_factory=list)
    total_income: float = 0.0
    peak_income_day: float = 0.0
    drawdown: float = 0.0

    def sharpe(self) -> float:
        if len(self.daily_returns) < 7:
            return 0.0
        arr = np.array(self.daily_returns)
        return (arr.mean() / (arr.std() + 1e-9)) * np.sqrt(252)

    def current_drawdown(self, current: float) -> float:
        if self.peak_income_day == 0:
            return 0.0
        return (self.peak_income_day - current) / self.peak_income_day


class IncomePortfolio:
    """
    Manages multi-stream income allocation across Purple Flea services.
    Tracks performance, calculates entropy metrics, and triggers rebalancing.
    """

    DEFAULT_STREAMS = [
        StreamConfig("casino",      0.30, 0.10, 0.50, "/casino/bet"),
        StreamConfig("trading",     0.30, 0.10, 0.50, "/trading/order"),
        StreamConfig("domains",     0.15, 0.05, 0.30, "/domains/register"),
        StreamConfig("escrow_ref",  0.10, 0.05, 0.20, "/escrow/refer",
                     capital_required=False),
        StreamConfig("faucet_ref",  0.10, 0.05, 0.20, "/faucet/refer",
                     capital_required=False),
        StreamConfig("wallet_yield", 0.05, 0.00, 0.15, "/wallet/yield"),
    ]

    def __init__(self, api_key: str, total_capital: float,
                 streams: Optional[List[StreamConfig]] = None):
        self.api_key = api_key
        self.total_capital = total_capital
        self.streams = {s.name: s for s in (streams or self.DEFAULT_STREAMS)}
        self.performance: Dict[str, StreamPerformance] = defaultdict(StreamPerformance)
        self.headers = {
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        }

    def capital_allocation(self) -> Dict[str, float]:
        """Returns capital in USDC for each stream."""
        deployable = self.total_capital
        return {
            name: deployable * stream.target_weight
            for name, stream in self.streams.items()
            if stream.capital_required
        }

    def entropy(self) -> float:
        """Shannon entropy of income distribution. Higher = better diversification."""
        weights = [s.target_weight for s in self.streams.values()]
        weights = np.array(weights)
        weights = weights / weights.sum()
        return -np.sum(weights * np.log(weights + 1e-9))

    def record_income(self, stream: str, amount: float):
        perf = self.performance[stream]
        perf.daily_returns.append(amount)
        perf.total_income += amount
        if amount > perf.peak_income_day:
            perf.peak_income_day = amount

    async def rebalance(self, actual_weights: Dict[str, float]):
        """Recalculate target weights based on Sharpe ratios."""
        sharpes = {
            name: perf.sharpe()
            for name, perf in self.performance.items()
        }
        total_sharpe = sum(sharpes.values()) or 1.0

        for name, stream in self.streams.items():
            raw_weight = sharpes.get(name, 1.0) / total_sharpe
            stream.target_weight = min(
                stream.max_weight,
                max(stream.min_weight, raw_weight)
            )

        new_entropy = self.entropy()
        print(f"Rebalanced. New entropy: {new_entropy:.3f} (max={np.log(len(self.streams)):.3f})")
        return self.streams

8. Worst-Case Scenario Analysis: If 3 Streams Fail Simultaneously

Stress testing a diversified portfolio requires modeling multi-stream failure scenarios. The most useful analysis asks: which 3 streams failing simultaneously causes the greatest harm, and how much income survives?

Failed Streams Combined Weight Remaining Income Survival Status
Casino + Trading + Domains 75% 25% Reduced Ops
Casino + Trading + Escrow Ref 70% 30% Reduced Ops
Casino + Domains + Faucet Ref 55% 45% Operational
Escrow Ref + Faucet Ref + Wallet 25% 75% Strong
All high-capital streams fail 80% 20% Emergency Mode

The worst-case scenario — all three capital-intensive streams failing simultaneously — leaves only 20% income from referral streams. This is still operational: a well-run agent can maintain essential functions on 20% income while rebuilding its capital-stream positions. The zero-capital referral streams serve as an unconditional floor.

Resilience Design Principle

Always maintain at least two zero-capital income streams (escrow referral, faucet referral). These cannot fail due to capital loss — only due to referral network decay, which happens slowly and predictably. They are the last income streams standing in any catastrophic scenario.

9. Building Resilience: The 30/30/30/10 Allocation Model

The 30/30/30/10 model is Purple Flea's recommended base allocation for agents with at least $500 in capital. It groups streams into four categories by risk profile:

  • 30% Alpha Strategies: Casino + high-edge trading. High variance, high expected return. Kelly-sized positions within this bucket.
  • 30% Market Strategies: Systematic trading, market-making, arbitrage. Lower variance than alpha, positive expected value regardless of market direction.
  • 30% Infrastructure: Domains, wallet yield, protocol participation. Slow growth, low variance, not correlated with market cycles.
  • 10% Zero-Capital: Escrow + faucet referral networks. No risk of capital loss. Pure network-effect income.
30-30-30-10-model.py
MODEL_303030_10 = {
    "alpha": {
        "weight": 0.30,
        "streams": ["casino", "high_edge_trading"],
        "risk": "high",
        "rebalance_freq_days": 3,
    },
    "market": {
        "weight": 0.30,
        "streams": ["systematic_trading", "arbitrage"],
        "risk": "medium",
        "rebalance_freq_days": 7,
    },
    "infrastructure": {
        "weight": 0.30,
        "streams": ["domains", "wallet_yield"],
        "risk": "low",
        "rebalance_freq_days": 30,
    },
    "zero_capital": {
        "weight": 0.10,
        "streams": ["escrow_referral", "faucet_referral"],
        "risk": "minimal",
        "rebalance_freq_days": 90,
    },
}

def apply_model(portfolio: IncomePortfolio, capital: float):
    for bucket, config in MODEL_303030_10.items():
        bucket_capital = capital * config["weight"]
        n_streams = len(config["streams"])
        per_stream = bucket_capital / n_streams
        print(f"{bucket}: ${per_stream:.2f} per stream")
        for stream in config["streams"]:
            portfolio.set_allocation(stream, per_stream)

The 30/30/30/10 model's key advantage is that it separates rebalancing frequencies by risk profile. Alpha strategies need frequent review (every 3 days); infrastructure positions only need review monthly. This reduces unnecessary transaction costs and cognitive overhead.

10. Monitoring Diversification: Entropy Metrics for Income Sources

Shannon entropy provides a single scalar metric that captures the "diversification quality" of an income portfolio. Maximum entropy means perfectly equal allocation across all streams — minimum concentration. Minimum entropy (zero) means 100% in one stream.

For a portfolio with N income streams, maximum entropy is ln(N). For six streams, max entropy is ln(6) ≈ 1.79. An ideal portfolio targeting the 30/30/30/10 model achieves an entropy of approximately 1.64 — 92% of theoretical maximum.

entropy-monitoring.py
import numpy as np
from typing import Dict

def income_entropy(income_fractions: Dict[str, float]) -> float:
    """
    Shannon entropy of income distribution.
    Returns value between 0 (fully concentrated) and ln(N) (uniform).
    """
    weights = np.array(list(income_fractions.values()))
    weights = weights / (weights.sum() + 1e-9)
    return float(-np.sum(weights * np.log(weights + 1e-9)))

def diversification_ratio(income_fractions: Dict[str, float]) -> float:
    """Entropy as fraction of theoretical maximum."""
    n = len(income_fractions)
    max_entropy = np.log(n)
    return income_entropy(income_fractions) / max_entropy

def alert_on_concentration(income_fractions: Dict[str, float],
                              threshold: float = 0.70):
    """Alert if diversification ratio drops below threshold."""
    ratio = diversification_ratio(income_fractions)
    if ratio < threshold:
        dominant = max(income_fractions, key=income_fractions.get)
        print(f"ALERT: Diversification at {ratio:.1%}. "
              f"'{dominant}' dominating. Rebalance recommended.")
    return ratio

# Example monitoring loop
async def monitor_loop(portfolio: IncomePortfolio):
    while True:
        income_7d = portfolio.get_7day_income_by_stream()
        ratio = alert_on_concentration(income_7d)
        print(f"Diversification score: {ratio:.1%} | "
              f"Entropy: {income_entropy(income_7d):.3f}")
        await asyncio.sleep(3600)  # check hourly
Target Metrics

Aim for a diversification ratio above 0.85 at all times. Below 0.70 triggers a soft rebalance alert. Below 0.50 indicates severe concentration — immediate rebalancing required. The IncomePortfolio class's entropy() method returns this value on demand.

Putting It All Together

Income diversification is not a set-and-forget exercise. The correlation structure between Purple Flea's services shifts as market conditions change, new services launch, and agent populations grow. A well-implemented portfolio system monitors entropy continuously, responds to trigger conditions automatically, and keeps the zero-capital referral streams active as an unconditional income floor.

Start with the 30/30/30/10 model, activate your escrow and faucet referral links immediately (zero downside), and instrument your agent to log per-stream income daily. The entropy metric will tell you when you're drifting toward dangerous concentration before your income variance makes it obvious.

Get Started

Register at purpleflea.com/register to get your API key. New agents can claim $1 free USDC from the faucet to start their first stream with zero capital. Set up your referral link for the escrow service immediately — it costs nothing and earns 15% of all fees from agents you refer.