{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/theblueprint-xyz/json-schema/theblueprint-xyz-staking-summary-response-schema.json",
  "title": "StakingSummaryResponse",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/theblueprint-xyz-openapi.json#/components/schemas/StakingSummaryResponse",
  "type": "object",
  "properties": {
    "walletAddress": {
      "type": "string",
      "description": "Solana wallet address for this portfolio summary"
    },
    "portfolio": {
      "type": "object",
      "description": "Wallet portfolio breakdown — liquid balance, staked balance, and allocation percentage",
      "properties": {
        "liquidBalanceSol": {
          "type": "number",
          "description": "Unstaked SOL in wallet"
        },
        "totalStakedSol": {
          "type": "number",
          "description": "Total SOL in stake accounts"
        },
        "totalValueSol": {
          "type": "number",
          "description": "Liquid + staked combined"
        },
        "stakedPercentage": {
          "type": "number",
          "description": "Percentage of total value that is staked"
        }
      }
    },
    "accounts": {
      "type": "array",
      "description": "Individual stake accounts with state, balance, and action guidance",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/StakeAccountInfo"
          },
          {
            "type": "object",
            "properties": {
              "estimatedDailyRewardSol": {
                "type": "number",
                "description": "Estimated daily reward for active stakes"
              }
            }
          }
        ]
      }
    },
    "apy": {
      "type": "object",
      "description": "Current APY breakdown — base staking yield plus Jito MEV rewards",
      "properties": {
        "stakingApy": {
          "type": "number",
          "description": "Base staking APY percentage"
        },
        "jitoMevApy": {
          "type": "number",
          "description": "Additional APY from Jito MEV rewards"
        },
        "totalApy": {
          "type": "number",
          "description": "Combined staking + Jito MEV APY percentage"
        }
      }
    },
    "epochTiming": {
      "$ref": "#/$defs/EpochTiming"
    },
    "recommendedAction": {
      "type": "object",
      "description": "Intelligent next-step recommendation based on wallet state and balance",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "STAKE",
            "FUND",
            "HOLD",
            "WAIT",
            "WITHDRAW"
          ],
          "description": "Recommended next action"
        },
        "reason": {
          "type": "string",
          "description": "Why this action is recommended"
        },
        "toolCall": {
          "type": "object",
          "description": "Endpoint (REST) and tool name (MCP) to execute the recommended action",
          "properties": {
            "rest": {
              "type": "string",
              "description": "REST API endpoint to call"
            },
            "mcp": {
              "type": "string",
              "description": "MCP tool name to invoke"
            }
          }
        }
      }
    },
    "_meta": {
      "$ref": "#/$defs/ResponseMeta"
    }
  },
  "$defs": {
    "EpochTiming": {
      "type": "object",
      "description": "Current epoch timing information with estimated end time",
      "properties": {
        "currentEpoch": {
          "type": "integer",
          "description": "Current Solana epoch number"
        },
        "slotsRemaining": {
          "type": "integer",
          "description": "Slots remaining in current epoch"
        },
        "estimatedSecondsRemaining": {
          "type": "integer",
          "description": "Estimated seconds until epoch end"
        },
        "estimatedEpochEnd": {
          "type": "string",
          "format": "date-time",
          "description": "Estimated epoch end timestamp"
        },
        "note": {
          "type": "string",
          "description": "Explanation of epoch timing relevance"
        }
      }
    },
    "ResponseMeta": {
      "type": "object",
      "description": "Navigation metadata included in most responses",
      "properties": {
        "endpoint": {
          "type": "string",
          "description": "The endpoint that generated this response"
        },
        "description": {
          "type": "string",
          "description": "Brief description of the response"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when this response was generated"
        },
        "relatedEndpoints": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Related REST endpoints for next actions"
        },
        "relatedTools": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Related MCP tool names (MCP responses only)"
        },
        "nextSteps": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Contextual next steps based on response data"
        },
        "verifyThisCode": {
          "type": "string",
          "description": "Endpoint to verify code integrity"
        },
        "cacheTtlSeconds": {
          "type": "integer",
          "description": "Cache TTL for this response"
        },
        "documentation": {
          "type": "string",
          "description": "Link to documentation"
        },
        "support": {
          "type": "object",
          "description": "Optional donation info — Blueprint is free, donation-supported infrastructure",
          "properties": {
            "address": {
              "type": "string",
              "description": "Solana address for donations"
            },
            "message": {
              "type": "string",
              "description": "Context about why donations help"
            },
            "donate": {
              "type": "string",
              "description": "How to build a donation transaction via API/MCP"
            }
          }
        }
      }
    },
    "StakeAccountInfo": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "Stake account address (base58)"
        },
        "lamports": {
          "type": "integer",
          "description": "Balance in lamports"
        },
        "sol": {
          "type": "number",
          "description": "Balance in SOL"
        },
        "state": {
          "type": "string",
          "description": "Account state: delegated, inactive, activating, deactivating"
        },
        "voter": {
          "type": "string",
          "description": "Validator vote account this stake is delegated to"
        },
        "stakeAuthority": {
          "type": "string",
          "description": "Public key authorized to stake/unstake (should be your wallet)"
        },
        "withdrawAuthority": {
          "type": "string",
          "description": "Public key authorized to withdraw (should be your wallet)"
        },
        "activationEpoch": {
          "type": "string",
          "description": "Epoch when stake was activated"
        },
        "deactivationEpoch": {
          "type": [
            "string",
            "null"
          ],
          "description": "Epoch when deactivation was requested, or null if still active"
        },
        "action": {
          "type": "string",
          "description": "Suggested next action based on account state (e.g., unstake, withdraw, wait for cooldown)"
        }
      }
    }
  }
}