Skip to content

feat(TS): Integrate Zerion API for agentkit #696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pcminh0505
Copy link

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 May 1, 2025 12:23
@cb-heimdall
Copy link

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 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 May 1, 2025
@chungquantin
Copy link

Looks good, hope this is merged!

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.

3 participants