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

John-peterson-coinbase and others added 30 commits February 1, 2025 05:50
* 0.1.0 initial scaffolding (#175)

* chore: fix lint (#177)

* chore: migrate basename action (#176)

* chore: CDP, Farcaster, ERC721 action providers (#181)

* CDP, Farcaster, ERC721 ActionProvider

* README erc721

* chore: migrate erc20 action (#182)

* 0.1.0(ts): morpho actions (#184)

* chore: migrate erc20 getBalance (#186)

* chore: fix npm scripts, linting and bump lint packages (#179)

* chore: migrate erc721 getBalance (#188)

* chore: migrate wrap eth action (#189)

* chore: langchain helper to convert actions to tools (#190)

* 0.1.0(ts): wow actions (#191)

* chore: migrate get wallet details (#192)

* 0.1.0(ts): twitter actions (#193)

* chore: eslint import order (#194)

* chore: map chainId to networkId (#196)

* chore: fix typo (#197)

* chore: migrate deploy token (#198)

* 0.1.0(ts): deploy contract (#201)

* first pass adding deploy contract cdp action

* linting

* the lost file

* tests

* 0.1.0(ts): adding eth balance to wallet details (#199)

* feat: Client side metrics (#195)

* 0.1.0(ts): deploy nft (#200)

* chore: rename typescript files and folders (#203)

* chore: split out cdp wallet and cdp api actions (#204)

* chore: migrate trade action (#208)

* twitter chatbot example (#205)

* 0.1.0(ts): farcaster example (#206)

* chore: cdpApiActionProvider usage (#211)

* chore: prefix action name (#210)

* chore: set default action provider to wallet action provider (#212)

* 0.1.0(ts): wallet native token transfer (#213)

Co-authored-by: John Peterson <98187317+John-peterson-coinbase@users.noreply.github.com>

* fix: use prefix notation that plays nicely with langchain (#217)

* feat: support custom action provider (#214)

* 0.1.0(ts): cdp wallet provider (#218)

Co-authored-by: John Peterson <98187317+John-peterson-coinbase@users.noreply.github.com>

* feat: CdpWalletProvider sendTransaction

* fix cdp provider config fields

* docs + dir structure refactor

* add language level readmes

* release ready!

* fix agentkit-langchain unit tests

* fix python unit test GHA poetry relative paths

* update poetry lock files

---------

Co-authored-by: Ryan Gilbert <ryangilbert7926@gmail.com>
Co-authored-by: Chris Gerber <csgerber@gmail.com>
disambuguates -> disambiguates
…d protocols (#256)

@murrlincoln 
Co-authored-by: Lincoln Murr <lincoln.murr@coinbase.com>
* add moonwell action providers

Signed-off-by: Elliot <elliotfriedman3@gmail.com>

* update: lint, update nomenclature, fix tests, add new constants

Signed-off-by: Elliot <elliotfriedman3@gmail.com>

---------

Signed-off-by: Elliot <elliotfriedman3@gmail.com>
* Update README.md

* Update README.md

* Add files via upload

* Update README.md

* Update README.md
Co-authored-by: Christopher Gerber <christopher.gerber@coinbase.com>
Co-authored-by: Ryan Gilbert <ryangilbert7926@gmail.com>
@pcminh0505 pcminh0505 requested a review from murrlincoln as a code owner May 1, 2025 12:23
@cb-heimdall
Copy link

cb-heimdall commented May 1, 2025

🟡 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
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 1
Sum 2

@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!

@phdargen
Copy link
Contributor

Hi @pcminh0505, thanks for the contribution! Looks pretty good, please rebase against main, then I will do some testing.

A few initial comments:

})
async getPortfolioOverview(args: z.infer<typeof GetWalletPortfolioSchema>): Promise<string> {
try {
const address = args.walletAddress || "";
Copy link
Contributor

@phdargen phdargen Jul 25, 2025

Choose a reason for hiding this comment

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

this should fall back to walletProvider.address as states in schema. same for other action

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @phdargen , imo it should be wallet-free tool (llke OpenSea). I already have an error check for Invalid wallet address below. My initial intention for Zerion API is portfolio check (with DeFi/fungible positions) for any wallet

@@ -0,0 +1,182 @@
/**
Copy link
Contributor

@phdargen phdargen Jul 25, 2025

Choose a reason for hiding this comment

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

remove l1-9 to fit existing code style

* Replace or modify this with your actual action.
*
* @description
* This is a template action that demonstrates the basic structure.
Copy link
Contributor

Choose a reason for hiding this comment

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

replace template description with actual action description

@github-actions github-actions bot added wallet provider New wallet provider example New example agent framework extension New framework extension python labels Aug 5, 2025
@pcminh0505 pcminh0505 requested a review from phdargen August 5, 2025 05:06
@phdargen
Copy link
Contributor

phdargen commented Aug 5, 2025

Hi @pcminh0505, thanks for the update! Unfortunately the rebasing didnt work out as intended, it shows 71 commits now and hundreds of changed files. Could you please try to clean-up the commit history? Also your first 2 commits are still unsigned

@pcminh0505 pcminh0505 closed this Aug 5, 2025
@github-actions github-actions bot removed documentation Improvements or additions to documentation action provider New action provider wallet provider New wallet provider example New example agent framework extension New framework extension python typescript labels Aug 5, 2025
@pcminh0505
Copy link
Contributor Author

Hi @phdargen , my bad in rebasing the branch :( moved my changes to #816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.