Skip to content

Conversation

@pcminh0505
Copy link
Contributor

Description

  • Integrate 2 Zerion API endpoints for portfolio fetching
    • get_portfolio_overview: Get aggregated USD balance of a wallet address
    • get_fungible_positions: Get aggregated token positions (wallet and DeFi) of a wallet address

Requirement: Zerion API key

Example

  • get_portfolio_overview
Wallet Portfolio Overview:
- Total Value: $3267.53
- 24h Change: -0.63%
- Position Types: wallet: $497.17, deposited: $2138.66, staked: $631.65
- Top Chains: unichain: $2179.59, base: $815.98, ethereum: $270.11, polygon: $0.85, abstract: $0.58
  • get_fungible_positions
Total Value: $3762.01

Token Positions (>$1):
- ETH (Ethereum) on unichain — $1134.21 [deposit via Uniswap V4]
- USD₮0 (USD₮0) on unichain — $1004.22 [deposit via Uniswap V4]
- WELL (WELL) on base — $630.55 [staked via Moonwell]
- MORPHO (Morpho Token) on base — $497.49 [deposit via Moonwell]
- ETH (Ethereum) on ethereum — $268.30 [wallet]
- ETH (Ethereum) on base — $182.84 [wallet]
- ETH (Ethereum) on unichain — $40.94 [wallet]
- UNI (Uniswap) on ethereum — $1.92 [wallet]
- ALCH (Alchemist Accelerate) on base — $1.54 [wallet]

Tests

 PASS  src/action-providers/zerion/zerionActionProvider.test.ts (8.381 s)
  ZerionActionProvider
    ✓ should throw if no API key is provided (10 ms)
    ✓ should use provided API key from config
    ✓ should support the protocol family
    ✓ should not support other protocol families
    ✓ should handle invalid network objects
    getPortfolioOverview
      ✓ returns error for invalid address
      ✓ returns formatted data for valid address (1 ms)
      ✓ returns error on fetch failure
    getFungiblePositions
      ✓ returns error for invalid address (1 ms)
      ✓ returns formatted data for valid address
      ✓ returns error on fetch failure

Checklist

A couple of things to include in your PR for completeness:

  • Added documentation to all relevant README.md files
  • Added a changelog entry

@pcminh0505 pcminh0505 requested a review from murrlincoln as a code owner August 5, 2025 15:13
@cb-heimdall
Copy link

cb-heimdall commented Aug 5, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@github-actions github-actions bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Aug 5, 2025
@phdargen
Copy link
Contributor

phdargen commented Aug 6, 2025

This is a continuation of #696

@phdargen
Copy link
Contributor

phdargen commented Aug 6, 2025

Hi @pcminh0505, thanks for the update! Looks good and I tested it without issues. Just a few more cosmetic changes, see below

@@ -0,0 +1,5 @@
---
"@coinbase/agentkit": minor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor -> patch
Add -> Added


## Overview

The ZerionActionProvider is designed to work with EvmWalletProvider for blockchain interactions. It provides a set of actions that enable [describe the main purpose/functionality].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace placeholder with description.

Also add to the README that a Zerion api key is required and where to get one

walletAddress: z
.string()
.describe(
"The wallet address to fetch portfolio for (defaults to connected wallet if not provided)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to remove "(defaults to connected wallet if not provided)"

*
* @description
* This provider is designed to provide blockchain-agnostic operations.
* It supports all blockchain networks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It supports all EVM networks.

@pcminh0505
Copy link
Contributor Author

Hi @phdargen , resolved minor comments you added. Please check again.

@phdargen
Copy link
Contributor

phdargen commented Aug 7, 2025

Thanks for the quick changes @pcminh0505!

This is tested and good to go @CarsonRoscoe

Copy link
Contributor

@CarsonRoscoe CarsonRoscoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution and review :)

@CarsonRoscoe CarsonRoscoe merged commit 1b1db57 into coinbase:main Aug 8, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

4 participants