Skip to content

[Low] portfolio defi response shape does not match schema — undocumented summary field #177

@Nicolai1205

Description

@Nicolai1205

Summary

nansen research portfolio defi returns a response with a top-level summary object that is not present in the schema definition. The schema documents per-protocol fields but the actual response is wrapped in a different structure.

Repro

nansen research portfolio defi --wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --pretty

Actual response shape:

{
  "success": true,
  "data": {
    "summary": {
      "total_value_usd": 0,
      "total_assets_usd": 0,
      "total_debts_usd": 0,
      "total_rewards_usd": 0,
      "token_count": 0,
      "protocol_count": 0
    },
    "protocols": []
  }
}

The summary object and its fields (total_value_usd, total_assets_usd, total_debts_usd, total_rewards_usd, token_count, protocol_count) are absent from the schema returns array for this command.

Impact

Low. Agents using the schema as a contract to know what fields to expect will miss the summary block. The summary contains aggregated portfolio metrics that are likely the most useful part of the response for agent reasoning.

Fix

Add summary and its sub-fields to the schema returns definition for portfolio defi.

Found during

Clawfooding session on v1.10.1. Referenced in PR #167.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions