{
  "description": "Shared calculator input schemas for the website and free MCP service. All eight calculators are available at https://pnltoolkit.com/mcp.",
  "units": "USD amounts; percentages use 1 for 1%; one basis point is 0.01%.",
  "calculators": {
    "past": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "asset": {
          "type": "string",
          "description": "Asset ticker. Available historical start dates vary by asset.",
          "default": "BTC",
          "enum": [
            "BTC",
            "ETH",
            "SOL",
            "SPY",
            "QQQ",
            "VTI",
            "VXUS",
            "GLD",
            "TLT",
            "AAPL",
            "MSFT",
            "NVDA",
            "TSLA"
          ]
        },
        "start": {
          "type": "string",
          "description": "Start month, YYYY-MM.",
          "default": "2016-10",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
        },
        "end": {
          "type": "string",
          "description": "End month, YYYY-MM. Must be within the installed data snapshot.",
          "default": "2026-09",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
        },
        "amount": {
          "type": "number",
          "description": "Dollar budget including fees, or coin/share quantity when unit is coins.",
          "default": 1000,
          "minimum": 0.000001,
          "maximum": 1000000000
        },
        "unit": {
          "type": "string",
          "description": "cash for a dollar budget; coins for a coin or share quantity.",
          "default": "cash",
          "enum": [
            "cash",
            "coins"
          ]
        },
        "returnBasis": {
          "type": "string",
          "description": "total reinvests distributions; price excludes distributions.",
          "default": "total",
          "enum": [
            "total",
            "price"
          ]
        },
        "buyFee": {
          "type": "number",
          "description": "Buying fee as a percentage, e.g. 0.1 means 0.1%.",
          "default": 0,
          "minimum": 0,
          "maximum": 20
        },
        "benchmark": {
          "type": "string",
          "description": "Optional benchmark asset.",
          "default": "none",
          "enum": [
            "none",
            "SPY",
            "QQQ",
            "BTC"
          ]
        }
      }
    },
    "dca": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "asset": {
          "type": "string",
          "description": "Asset ticker. Available historical start dates vary by asset.",
          "default": "QQQ",
          "enum": [
            "BTC",
            "ETH",
            "SOL",
            "SPY",
            "QQQ",
            "VTI",
            "VXUS",
            "GLD",
            "TLT",
            "AAPL",
            "MSFT",
            "NVDA",
            "TSLA"
          ]
        },
        "start": {
          "type": "string",
          "description": "Start month, YYYY-MM.",
          "default": "2016-10",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
        },
        "end": {
          "type": "string",
          "description": "End month, YYYY-MM. Must be within the installed data snapshot.",
          "default": "2026-09",
          "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
        },
        "monthly": {
          "type": "number",
          "description": "Contribution in dollars per chosen frequency (DCA), or per month (compound interest).",
          "default": 200,
          "minimum": 1,
          "maximum": 10000000
        },
        "initial": {
          "type": "number",
          "description": "Initial deposit in dollars.",
          "default": 0,
          "minimum": 0,
          "maximum": 1000000000
        },
        "frequency": {
          "type": "number",
          "description": "Contribution interval in months: 1, 3 or 12.",
          "default": 1,
          "enum": [
            1,
            3,
            12
          ]
        },
        "buyFee": {
          "type": "number",
          "description": "Buying fee as a percentage, e.g. 0.1 means 0.1%.",
          "default": 0,
          "minimum": 0,
          "maximum": 20
        },
        "returnBasis": {
          "type": "string",
          "description": "total reinvests distributions; price excludes distributions.",
          "default": "total",
          "enum": [
            "total",
            "price"
          ]
        },
        "benchmark": {
          "type": "string",
          "description": "Optional benchmark asset.",
          "default": "none",
          "enum": [
            "none",
            "SPY",
            "QQQ",
            "BTC"
          ]
        }
      }
    },
    "future": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "principal": {
          "type": "number",
          "description": "Initial investment, or peak account balance for recovery, in dollars.",
          "default": 10000,
          "minimum": 0,
          "maximum": 1000000000
        },
        "monthly": {
          "type": "number",
          "description": "Contribution in dollars per chosen frequency (DCA), or per month (compound interest).",
          "default": 200,
          "minimum": 0,
          "maximum": 10000000
        },
        "rate": {
          "type": "number",
          "description": "Assumed gross annual percentage return.",
          "default": 8,
          "minimum": -50,
          "maximum": 50
        },
        "years": {
          "type": "integer",
          "description": "Number of years, 1 to 40.",
          "default": 10,
          "minimum": 1,
          "maximum": 40
        },
        "timing": {
          "type": "string",
          "description": "Deposit at the beginning or end of each month.",
          "default": "end",
          "enum": [
            "end",
            "beginning"
          ]
        },
        "annualFee": {
          "type": "number",
          "description": "Annual asset fee in percent.",
          "default": 0,
          "minimum": 0,
          "maximum": 20
        },
        "inflation": {
          "type": "number",
          "description": "Assumed annual inflation in percent.",
          "default": 0,
          "minimum": -5,
          "maximum": 30
        },
        "contributionGrowth": {
          "type": "number",
          "description": "Annual increase in contributions, in percent.",
          "default": 0,
          "minimum": 0,
          "maximum": 50
        }
      }
    },
    "position": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "balance": {
          "type": "number",
          "description": "Account balance in dollars.",
          "default": 10000,
          "minimum": 1,
          "maximum": 1000000000
        },
        "risk": {
          "type": "number",
          "description": "Loss budget as a percentage of the account.",
          "default": 1,
          "minimum": 0.01,
          "maximum": 100
        },
        "entry": {
          "type": "number",
          "description": "Trade entry price.",
          "default": 100,
          "minimum": 0.000001,
          "maximum": 1000000000
        },
        "stop": {
          "type": "number",
          "description": "Stop price.",
          "default": 95,
          "minimum": 0.000001,
          "maximum": 1000000000
        },
        "target": {
          "type": "number",
          "description": "Trade target price, or target inventory percentage for inventory quotes.",
          "default": 110,
          "minimum": 0.000001,
          "maximum": 1000000000
        },
        "direction": {
          "type": "string",
          "description": "long or short.",
          "default": "long",
          "enum": [
            "long",
            "short"
          ]
        },
        "fee": {
          "type": "number",
          "description": "Fee per fill in basis points; negative maker fees are rebates in the spread model.",
          "default": 5,
          "minimum": 0,
          "maximum": 500
        },
        "slippage": {
          "type": "number",
          "description": "Slippage per side in basis points.",
          "default": 0,
          "minimum": 0,
          "maximum": 500
        },
        "unitStep": {
          "type": "number",
          "description": "Quantity increment; 0 disables rounding.",
          "default": 0.0001,
          "minimum": 0,
          "maximum": 1000000000
        },
        "maxLeverage": {
          "type": "number",
          "description": "Maximum notional exposure divided by equity.",
          "default": 1,
          "minimum": 0.01,
          "maximum": 100
        }
      }
    },
    "expectancy": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "balance": {
          "type": "number",
          "description": "Account balance in dollars.",
          "default": 10000,
          "minimum": 1,
          "maximum": 1000000000
        },
        "winRate": {
          "type": "number",
          "description": "Estimated win rate in percent.",
          "default": 55,
          "minimum": 0,
          "maximum": 100
        },
        "avgWin": {
          "type": "number",
          "description": "Average winning trade in R units.",
          "default": 1.5,
          "minimum": 0.001,
          "maximum": 100
        },
        "avgLoss": {
          "type": "number",
          "description": "Average losing trade in R units.",
          "default": 1,
          "minimum": 0.001,
          "maximum": 100
        },
        "cost": {
          "type": "number",
          "description": "Cost per trade in R units.",
          "default": 0.05,
          "minimum": 0,
          "maximum": 100
        },
        "fraction": {
          "type": "number",
          "description": "Kelly multiplier, e.g. 0.25 for quarter Kelly.",
          "default": 0.25,
          "minimum": 0,
          "maximum": 1
        },
        "winBuffer": {
          "type": "number",
          "description": "Conservative reduction in win rate, in percentage points.",
          "default": 0,
          "minimum": 0,
          "maximum": 100
        },
        "riskCap": {
          "type": "number",
          "description": "Maximum account risk in percent.",
          "default": 5,
          "minimum": 0,
          "maximum": 100
        }
      }
    },
    "spread": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "notional": {
          "type": "number",
          "description": "One-side trade notional in dollars.",
          "default": 10000,
          "minimum": 1,
          "maximum": 1000000000000
        },
        "spread": {
          "type": "number",
          "description": "Full quoted spread in basis points.",
          "default": 12,
          "minimum": 0,
          "maximum": 2000
        },
        "fee": {
          "type": "number",
          "description": "Fee per fill in basis points; negative maker fees are rebates in the spread model.",
          "default": 2,
          "minimum": -100,
          "maximum": 500
        },
        "adverse": {
          "type": "number",
          "description": "Adverse-selection cost in basis points.",
          "default": 3,
          "minimum": 0,
          "maximum": 2000
        }
      }
    },
    "inventory": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "mid": {
          "type": "number",
          "description": "Market mid price.",
          "default": 100,
          "minimum": 0.000001,
          "maximum": 1000000000
        },
        "current": {
          "type": "number",
          "description": "Current base inventory percentage, or current balance in dollars in recovery.",
          "default": 70,
          "minimum": 0,
          "maximum": 100
        },
        "target": {
          "type": "number",
          "description": "Trade target price, or target inventory percentage for inventory quotes.",
          "default": 50,
          "minimum": 0,
          "maximum": 100
        },
        "spread": {
          "type": "number",
          "description": "Full quoted spread in basis points.",
          "default": 12,
          "minimum": 0.01,
          "maximum": 2000
        },
        "skew": {
          "type": "number",
          "description": "Quote shift in basis points per 10 percentage points of inventory deviation.",
          "default": 2,
          "minimum": 0,
          "maximum": 100
        },
        "tickSize": {
          "type": "number",
          "description": "Price tick size; 0 disables rounding.",
          "default": 0.01,
          "minimum": 0,
          "maximum": 100000000
        },
        "skewCap": {
          "type": "number",
          "description": "Maximum quote-center shift in basis points.",
          "default": 20,
          "minimum": 0,
          "maximum": 1000
        }
      }
    },
    "recover": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "principal": {
          "type": "number",
          "description": "Initial investment, or peak account balance for recovery, in dollars.",
          "default": 10000,
          "minimum": 1,
          "maximum": 1000000000000
        },
        "scenario": {
          "type": "string",
          "description": "drawdown, balance or streak.",
          "default": "drawdown",
          "enum": [
            "drawdown",
            "balance",
            "streak"
          ]
        },
        "loss": {
          "type": "number",
          "description": "Drawdown in percent, from 0 to 100.",
          "default": 30,
          "minimum": 0,
          "maximum": 100
        },
        "current": {
          "type": "number",
          "description": "Current base inventory percentage, or current balance in dollars in recovery.",
          "default": 7000,
          "minimum": 0,
          "maximum": 1000000000000
        },
        "riskPerTrade": {
          "type": "number",
          "description": "Loss per trade as a percentage of remaining equity.",
          "default": 2,
          "minimum": 0,
          "maximum": 100
        },
        "losses": {
          "type": "integer",
          "description": "Number of consecutive losing trades.",
          "default": 10,
          "minimum": 1,
          "maximum": 500
        },
        "monthlyReturn": {
          "type": "number",
          "description": "Assumed net monthly return in percent; not a forecast.",
          "default": 2,
          "minimum": -20,
          "maximum": 30
        },
        "monthlyDeposit": {
          "type": "number",
          "description": "New monthly deposit in dollars.",
          "default": 0,
          "minimum": 0,
          "maximum": 1000000000
        },
        "targetMonths": {
          "type": "integer",
          "description": "Recovery target horizon in months.",
          "default": 12,
          "minimum": 1,
          "maximum": 120
        }
      }
    }
  }
}
