Skip to content

feat(ts): defillama action provider - #513

Merged
John-peterson-coinbase merged 2 commits into
mainfrom
defillama-action-provider
Mar 14, 2025
Merged

feat(ts): defillama action provider#513
John-peterson-coinbase merged 2 commits into
mainfrom
defillama-action-provider

Conversation

@stat

@stat stat commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

Description

expanding upon the defillama integration, refinements and testing. please find the original description below:

Added a new DefiLlama action provider to enable interaction with the DefiLlama API for fetching DeFi protocol information and token prices. This implementation addresses the wishlist item for DeFi data integration

The implementation includes three main actions:

get_token_prices: Fetches current prices for specified tokens with chain prefixes
get_protocol: Retrieves detailed information about specific DeFi protocols
search_protocols: Enables searching through DeFi protocols

Tests

Finding a Protocol

Prompt: can you search for an eigen protocol?

-------------------
[
  {
    "id": "3107",
    "name": "EigenLayer",
    "address": "0xec53bf9167f50cdeb3ae105f56099aaab9061f83",
    "symbol": "EIGEN",
    "url": "https://www.eigenlayer.xyz/",
    "description": "EigenLayer is a protocol built on Ethereum that introduces restaking, a new primitive in cryptoeconomic security. This primitive enables the reuse of ETH on the consensus layer",
    "chain": "Ethereum",
    "logo": "https://icons.llama.fi/eigenlayer.png",
    "audits": "2",
    "audit_note": null,
    "gecko_id": "eigenlayer",
    "cmcId": null,
    "category": "Restaking",
    "chains": [
      "Ethereum"
    ],
    "module": "eigenlayer/index.js",
    "twitter": "eigenlayer",
    "oracles": [],
    "forkedFrom": [],
    "audit_links": [
      "https://docs.eigenlayer.xyz/security/audits"
    ],
    "github": [
      "Layr-Labs"
    ],
    "listedAt": 1686776222,
    "slug": "eigenlayer",
    "tvl": 8951735130.458426,
    "chainTvls": {
      "Ethereum-staking": 522332864.5310426,
      "Ethereum": 8951735130.458426,
      "staking": 522332864.5310426
    },
    "change_1h": -0.8573676649778434,
    "change_1d": -11.65410033967217,
    "change_7d": -14.671214345715782,
    "tokenBreakdowns": {},
    "mcap": 336877554.1087164,
    "staking": 522332864.5310426
  },
  {
    "id": "4075",
    "name": "Eigenpie",
    "address": null,
    "symbol": "-",
    "url": "https://www.eigenlayer.magpiexyz.io",
    "description": "Eigenpie is an innovative SubDAO created by Magpie, focusing on the restaking of ETH LSTs via EigenLayer. As a liquid restaking platform for Ethereum, Eigenpie’s core mechanism enables users to convert their Liquid Staked ETH tokens into Isolated Liquid Restaked ETH tokens. These are restaked versions of ETH LSTs, created by Eigenpie. This process allows users to earn passive income from Ethereum staking and EigenLayer revenue simultaneously, without requiring a lockup period.",
    "chain": "Multi-Chain",
    "logo": "https://icons.llama.fi/eigenpie.jpg",
    "audits": "2",
    "audit_note": null,
    "gecko_id": null,
    "cmcId": null,
    "category": "Liquid Restaking",
    "chains": [
      "Zircuit",
      "Ethereum"
    ],
    "oracles": [
      "Chainlink"
    ],
    "forkedFrom": [],
    "module": "eigenpie/index.js",
    "twitter": "Eigenpiexyz_io",
    "parentProtocol": "parent#magpie-ecosystem",
    "audit_links": [
      "https://github.com/peckshield/publications/blob/master/audit_reports/PeckShield-Audit-Report-Eigenpie-v1.0.pdf"
    ],
    "listedAt": 1706537731,
    "slug": "eigenpie",
    "tvl": 552741078.9743935,
    "chainTvls": {
      "Zircuit": 341269361.5768466,
      "Ethereum": 211471717.39754686
    },
    "change_1h": 3.8755075071811547,
    "change_1d": -7.644740844217878,
    "change_7d": -13.991325628506374,
    "tokenBreakdowns": {},
    "mcap": null
  }
]
-------------------
I found two protocols related to "Eigen":

1. **EigenLayer**
   - **Description:** EigenLayer is a protocol built on Ethereum that introduces restaking, enabling the reuse of ETH on the consensus layer for cryptoeconomic security.
   - **Symbol:** EIGEN
   - **Chain:** Ethereum
   - **TVL:** $8,951,735,130.46
   - **Market Cap:** $336,877,554.11
   - **1h Change:** -0.86%
   - **1d Change:** -11.65%
   - **URL:** [EigenLayer](https://www.eigenlayer.xyz/)
   - **Logo:** ![EigenLayer Logo](https://icons.llama.fi/eigenlayer.png)
   - **Audit Information:** [Audit Links](https://docs.eigenlayer.xyz/security/audits)

2. **Eigenpie**
   - **Description:** Eigenpie is an innovative SubDAO created by Magpie, focusing on the restaking of ETH LSTs via EigenLayer, allowing users to earn passive income from both Ethereum staking and EigenLayer revenue.
   - **Chain:** Multi-Chain (Zircuit, Ethereum)
   - **TVL:** $552,741,078.97
   - **1h Change:** +3.88%
   - **1d Change:** -7.64%
   - **URL:** [Eigenpie](https://www.eigenlayer.magpiexyz.io)
   - **Logo:** ![Eigenpie Logo](https://icons.llama.fi/eigenpie.jpg)
   - **Audit Information:** [Audit Report](https://github.com/peckshield/publications/blob/master/audit_reports/PeckShield-Audit-Report-Eigenpie-v1.0.pdf)

Let me know if you would like more details on either protocol!
-------------------

Getting Protocol Details

Prompt: please use get_protocol for jito

-------------------
{
  "id": "2308",
  "name": "Jito",
  "address": "solana:jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL",
  "symbol": "JTO",
  "url": "https://jito.network",
  "description": "MEV-Boosted Staking Rewards",
  "chain": "Solana",
  "logo": "https://icons.llama.fi/jito.png",
  "audits": "2",
  "audit_note": null,
  "gecko_id": "jito-governance-token",
  "cmcId": null,
  "category": "Liquid Staking",
  "chains": [
    "Solana"
  ],
  "module": "jito/index.js",
  "twitter": "jito_sol",
  "forkedFrom": [
    "SPL Stake Pool"
  ],
  "audit_links": [
    "https://spl.solana.com/stake-pool#security-audits",
    "https://2926710696-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffrb9MGTK6eZJlEQJyylq%2Fuploads%2F1jfEDpGcd5YlnHusbKYO%2FNeodymeJito.pdf"
  ],
  "oracles": [],
  "oraclesBreakdown": [
    {
      "name": "Switchboard",
      "type": "Secondary",
      "proof": [
        "https://github.com/DefiLlama/defillama-server/pull/9193"
      ]
    }
  ],
  "listedAt": 1669265429,
  "github": [
    "jito-foundation"
  ],
  "chainTvls": {
    "Solana": {
      "tvl": [
        {
          "date": 1741842011,
          "totalLiquidityUSD": 2050645658.69502
        },
        {
          "date": 1741737600,
          "totalLiquidityUSD": 2073190249.57305
        },
        {
          "date": 1741651200,
          "totalLiquidityUSD": 1878593066.31107
        },
        {
          "date": 1741564800,
          "totalLiquidityUSD": 2060444245.39602
        },
        {
          "date": 1741478400,
          "totalLiquidityUSD": 2266226563.52507
        }
      ],
      "tokensInUsd": [
        {
          "date": 1741842011,
          "tokens": {
            "SOL": 2050645658.69502
          }
        },
        {
          "date": 1741737600,
          "tokens": {
            "SOL": 2073190249.57305
          }
        },
        {
          "date": 1741651200,
          "tokens": {
            "SOL": 1878593066.31107
          }
        },
        {
          "date": 1741564800,
          "tokens": {
            "SOL": 2060444245.39602
          }
        },
        {
          "date": 1741478400,
          "tokens": {
            "SOL": 2266226563.52507
          }
        }
      ],
      "tokens": [
        {
          "date": 1741842011,
          "tokens": {
            "SOL": 16533464.95763
          }
        },
        {
          "date": 1741737600,
          "tokens": {
            "SOL": 16582868.73759
          }
        },
        {
          "date": 1741651200,
          "tokens": {
            "SOL": 16441388.64267
          }
        },
        {
          "date": 1741564800,
          "tokens": {
            "SOL": 16502036.24376
          }
        },
        {
          "date": 1741478400,
          "tokens": {
            "SOL": 16556301.60378
          }
        }
      ]
    }
  },
  "tvl": [
    {
      "date": 1741842011,
      "totalLiquidityUSD": 2050645658.69502
    },
    {
      "date": 1741737600,
      "totalLiquidityUSD": 2073190249.57305
    },
    {
      "date": 1741651200,
      "totalLiquidityUSD": 1878593066.31107
    },
    {
      "date": 1741564800,
      "totalLiquidityUSD": 2060444245.39602
    },
    {
      "date": 1741478400,
      "totalLiquidityUSD": 2266226563.52507
    }
  ],
  "tokensInUsd": [
    {
      "date": 1741842011,
      "tokens": {
        "SOL": 2050645658.69502
      }
    },
    {
      "date": 1741737600,
      "tokens": {
        "SOL": 2073190249.57305
      }
    },
    {
      "date": 1741651200,
      "tokens": {
        "SOL": 1878593066.31107
      }
    },
    {
      "date": 1741564800,
      "tokens": {
        "SOL": 2060444245.39602
      }
    },
    {
      "date": 1741478400,
      "tokens": {
        "SOL": 2266226563.52507
      }
    }
  ],
  "tokens": [
    {
      "date": 1741842011,
      "tokens": {
        "SOL": 16533464.95763
      }
    },
    {
      "date": 1741737600,
      "tokens": {
        "SOL": 16582868.73759
      }
    },
    {
      "date": 1741651200,
      "tokens": {
        "SOL": 16441388.64267
      }
    },
    {
      "date": 1741564800,
      "tokens": {
        "SOL": 16502036.24376
      }
    },
    {
      "date": 1741478400,
      "tokens": {
        "SOL": 16556301.60378
      }
    }
  ],
  "currentChainTvls": {
    "Solana": 2050645658.69502
  },
  "raises": [],
  "metrics": {},
  "mcap": 642311894.5063655,
  "methodology": "Uses the SPL Stake Pool SDK to fetch the total supply of deposited SOL into the Jito Stake Pool"
}
-------------------
Here are the details for the Jito protocol:

- **Name:** Jito
- **Address:** [jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL](https://explorer.solana.com/address/jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL)
- **Symbol:** JTO
- **Description:** MEV-Boosted Staking Rewards
- **Category:** Liquid Staking
- **Chains:** Solana
- **Current TVL:** $2,050,645,658.70
- **Market Cap:** $642,311,894.51
- **Audits:** 2
- **Audit Links:**
  - [Audit 1](https://spl.solana.com/stake-pool#security-audits)
  - [Audit 2](https://2926710696-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ffrb9MGTK6eZJlEQJyylq%2Fuploads%2F1jfEDpGcd5YlnHusbKYO%2FNeodymeJito.pdf)
- **Twitter:** [@jito_sol](https://twitter.com/jito_sol)
- **Website:** [jito.network](https://jito.network)
  
![Jito Logo](https://icons.llama.fi/jito.png)

### Historical TVL Data:
- **Date:** 2023-08-07 - TVL: $2,050,645,658.70
- **Date:** 2023-08-06 - TVL: $2,073,190,249.57
- **Date:** 2023-08-05 - TVL: $1,878,593,066.31
- **Date:** 2023-08-04 - TVL: $2,060,444,245.40
- **Date:** 2023-08-03 - TVL: $2,266,226,563.53

For more technical inquiries, the protocol utilizes the SPL Stake Pool SDK for its operations.
-------------------

Getting Token Prices

Prompt: What is the current price of USDC and WETH on Ethereum? USDC's token address is: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48, WETH's token address is: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-------------------
{
  "coins": {
    "ethereum:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": {
      "decimals": 6,
      "symbol": "USDC",
      "price": 0.999958,
      "timestamp": 1741115101,
      "confidence": 0.99
    },
    "ethereum:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": {
      "decimals": 18,
      "symbol": "WETH",
      "price": 2154.41,
      "timestamp": 1741115124,
      "confidence": 0.99
    }
  }
}
-------------------
The current prices on Ethereum are as follows:
- USDC: approximately $0.999958
- WETH: approximately $2154.41
-------------------

Checklist

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

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

@cb-heimdall

cb-heimdall commented Mar 4, 2025

Copy link
Copy Markdown

✅ 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
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 needs triage labels Mar 4, 2025
@stat
stat force-pushed the defillama-action-provider branch 2 times, most recently from 72c3a3c to 495d576 Compare March 4, 2025 19:27
@stat
stat marked this pull request as ready for review March 4, 2025 19:30
@stat
stat requested a review from murrlincoln as a code owner March 4, 2025 19:30
@John-peterson-coinbase

Copy link
Copy Markdown
Contributor

@stat Please update PR description

Comment thread typescript/agentkit/src/action-providers/defillama/defillamaActionProvider.ts Outdated
@0xRAG 0xRAG removed the needs triage label Mar 7, 2025
@John-peterson-coinbase

Copy link
Copy Markdown
Contributor

@stat please fill out PR description

@stat
stat force-pushed the defillama-action-provider branch from 495d576 to caafddb Compare March 13, 2025 07:18
Comment thread typescript/agentkit/src/action-providers/defillama/README.md

@CarsonRoscoe CarsonRoscoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add entry to /typescript/agentkit/README.md's Action Providers table

@stat
stat requested a review from CarsonRoscoe March 13, 2025 17:21
CarsonRoscoe
CarsonRoscoe previously approved these changes Mar 13, 2025

@CarsonRoscoe CarsonRoscoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Code looks good and my tests are showing it working well

@cb-heimdall
cb-heimdall dismissed CarsonRoscoe’s stale review March 14, 2025 05:19

Approved review 2682999814 from CarsonRoscoe is now dismissed due to new commit. Re-request for approval.

@stat stat closed this Mar 14, 2025
@stat
stat force-pushed the defillama-action-provider branch from 122076d to cc66267 Compare March 14, 2025 05:24
@stat stat reopened this Mar 14, 2025
@github-actions github-actions Bot added the wallet provider New wallet provider label Mar 14, 2025
@stat
stat force-pushed the defillama-action-provider branch 2 times, most recently from 712f281 to 60a0bb4 Compare March 14, 2025 05:44
@github-actions github-actions Bot removed the wallet provider New wallet provider label Mar 14, 2025
@stat
stat requested a review from CarsonRoscoe March 14, 2025 05:44

@CarsonRoscoe CarsonRoscoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@John-peterson-coinbase
John-peterson-coinbase merged commit e826563 into main Mar 14, 2025
@John-peterson-coinbase
John-peterson-coinbase deleted the defillama-action-provider branch March 14, 2025 16:07
chenciao8 added a commit to TradeOnDESK/agentkit that referenced this pull request Mar 19, 2025
* feat: GHA Publish coinbase-agentkit-openai-agents-sdk to PyPI (coinbase#551)

* feat: python openai agents sdk support (coinbase#550)

* feat: initial commit

* chore: unit tests

* chore: updated readmes

* chore: updated to live openai-agents package

* fix: fix params schema to conform to openai requirements

* chore: updated README in /python

* chore: generated changelog changes (coinbase#552)

* chore: add next-template to workspaces (coinbase#544)

* chore: add next-template to workspaces

* chore: fix lint in next template

* chore: generated changeset

* chore: reverted img change

---------

Co-authored-by: CarsonRoscoe <carsonroscoe7@gmail.com>

* chore: python bump cdp sdk version (coinbase#554)

* chore: bump cdp-sdk version from 0.19.0 to 0.21.0 in python

* chore: generated changelog

* chore: generate changelog changes & bump coinbase-agentkit version

* Update README.md (coinbase#555)

* feat: model context protocol example (coinbase#546)

* feat: initial commit

* feat: working claude example

* chore: removed wallet read/writes

* chore: updated README

* chore: added examples to parent READMEs

* chore: format/lint

* chore: added build to ignore

* fix: package dependencies

* chore: change build folder to dist

* chore: package-lock

* chore: fixed package-lock.json

* chore: removed dotenv dependency

* chore: removed moduleResolution from tsconfig

* fix: package-lock

* pr feedback

* chore: lint format

* fix: package-lock

* fix: claud config arg for server location

* feat: pr feedback

* feat: npm cli - multi framework + Vercel AI SDK (coinbase#548)

* feat: initial commit

* fix: handleNextSelection call

* chore: format and lint

* chore: updated comments

* chore: changelog

* chore: updated readmes

* chore: added todo and removed MCP from Framework list for now

* chore: removed references to mcpServer and MCP. Will readd in its own PR

* chore: updated package-lock

* chore: removed missed mcpServer reference

* chore: lint

* chore: infer types from constants (coinbase#559)

* feat(python): add allora network price inference (coinbase#110)

* fix typo: OpenSeas to OpenSea (coinbase#564)

* fix typo (coinbase#563)

* feat: pipx cli - multi framework support + OpenAI Agents + Beginner template (coinbase#557)

* chore: refactored chatbot into prepare_agent, create_agent and chatbot

* feat: added openai agents sdk

* chore: pyproject.toml dependencies depends on framework selected

* fix: openai agents sdk dependencies

* feat: added paymaster comment to smart wallet scenario

* feat: added introduction template

* feat: cleaned up beginner template

* feat: changed --mode=beginnner arg to --beginner flag

* feat: improved wallet persistance and beginner flag

* chore: changelog

* chore: updated README

* chore: lint

* chore: updated beginner README

* feat(ts): defillama action provider (coinbase#513)

* feat(ts): defillama action provider (coinbase#316)

* feat(ts): defillama action provider refinements (coinbase#513)

---------

Co-authored-by: bilgin-kocak <kocakbilgin@gmail.com>

* chore: rm changelog workflow (coinbase#570)

* chore: add mcp template (coinbase#568)

* fix: readded missing .env.local file (coinbase#567)

* feat(py): hyperbolic action provider (coinbase#531)

* feat(py): hyperbolic action provider (coinbase#154)

* feat(py): hyperbolic action provider 0.1.0 migration (coinbase#509)

* feat(py): hyperbolic action provider refinements (coinbase#531)

---------

Co-authored-by: Kai Huang <kaihuang724@gmail.com>
Co-authored-by: Amr Elhady <theamrelhady@gmail.com>

* chore: fix nightly (coinbase#571)

* feat(create-onchain-agent): add mcp to typescript cli (coinbase#569)

* fix: Morpho Deposit Atomic Unit Conversion (coinbase#573)

* fix: Morpho Deposit Atomic Unit Conversion

* changesets

* chore: rm allora-sdk from example deps (coinbase#574)

* chore: added readme tip to surpress warning (coinbase#575)

* chore: added readme tip to surpress warning

* chore: added tip to agents example readme

* chore: version typescript packages (coinbase#576)

* chore: version python packages (coinbase#577)

* New SVGs in readme (coinbase#578)

* Add files via upload

* Add files via upload

* Update README.md

* Update README.md

* Update defillama.svg

* chore: add changesets action to automate version and publish (coinbase#582)

* feat: added gasless transfers for USDC/CBBTC on Base/Base-Sepolia (coinbase#584)

* docs: update broken links (coinbase#586)

---------

Co-authored-by: John Peterson <98187317+John-peterson-coinbase@users.noreply.github.com>
Co-authored-by: Carson Roscoe <CarsonRoscoe7@gmail.com>
Co-authored-by: Ryan Gilbert <ryangilbert7926@gmail.com>
Co-authored-by: Olexandr88 <radole1203@gmail.com>
Co-authored-by: fernandofcampos <fernandofcampos@gmail.com>
Co-authored-by: Oğuzhan Oğuz <46710637+ozzy35410@users.noreply.github.com>
Co-authored-by: Chris Gerber <csgerber@gmail.com>
Co-authored-by: bilgin-kocak <kocakbilgin@gmail.com>
Co-authored-by: Kai Huang <kaihuang724@gmail.com>
Co-authored-by: Amr Elhady <theamrelhady@gmail.com>
Co-authored-by: murrlincoln <65836530+murrlincoln@users.noreply.github.com>
Co-authored-by: Cypher Pepe <125112044+cypherpepe@users.noreply.github.com>
EdsonAlcala pushed a commit to EdsonAlcala/agentkit that referenced this pull request Mar 21, 2025
* feat(ts): defillama action provider (coinbase#316)

* feat(ts): defillama action provider refinements (coinbase#513)

---------

Co-authored-by: bilgin-kocak <kocakbilgin@gmail.com>
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.

7 participants