Coinbase AgentKit

repository·main·Indexed 22 days ago

https://github.com/coinbase/agentkit

A framework-agnostic and wallet-agnostic toolkit from the Coinbase Developer Platform that enables AI agents to possess crypto wallets and perform onchain interactions. It includes various action providers for interacting with the CDP API, EVM and Smart Wallets, Aave V3, Compound V3, the Base Name Service (BNS), and ERC20 tokens across networks including Base and Ethereum.

Tokens
73.5K
Snippets
169
Records
450
Agent score
77%

What's inside coinbase-agentkit

  1. Overview of Superfluid Action Provider

    main

    The SuperfluidActionProvider enables blockchain interactions with the Superfluid protocol. It is designed to work specifically with EvmWalletProvider and provides capabilities for managing streams, pools, and SuperTokens.

    Key Capabilities

    • Streams: Create, update flow rates, and close streams.
    • Pools: Create pools and update member units.
    • SuperTokens: Create SuperToken wrappers for existing ERC20s, wrap existing ERC20s into SuperTokens, and query open streams.

    Important Considerations

    • Network Support: Currently supports Base Mainnet.
    • Flow Rates: When creating or updating a stream, ensure the flowRate is accurately calculated in wei per second.
    • Contract Addresses: Most Superfluid contracts are deployed at the same addresses across different chains. Always verify the correct address for your target chain using the Superfluid Deployments documentation.
  2. Overview of the coinbase_agentkit Python package

    main

    The coinbase_agentkit package is organized into several specialized subpackages for building onchain agents. Key functional areas include:

    • action_providers: For defining and providing tools/actions the agent can perform.
    • analytics: For tracking agent performance and data.
    • network: For handling blockchain network interactions.
    • validators: For ensuring data integrity and security.
    • wallet_providers: For managing agent wallets and signing capabilities.
  3. Overview of AgentKit TypeScript packages

    main

    AgentKit TypeScript provides core primitives and framework-agnostic actions for onchain workflows. It is designed to be composable through various framework extensions.

    Core Package

    • @coinbase/agentkit: Contains the core primitives and actions. This is the foundation used by all extensions.

    Framework Extensions

    These extensions allow agentic workflows to interact with onchain actions within specific developer ecosystems:

    • @coinbase/agentkit-langchain: For LangChain-based workflows.
    • @coinbase/agentkit-vercel-ai-sdk: For Vercel AI SDK-based workflows.
    • @coinbase/agentkit-model-context-protocol: For Anthropic Model Context Protocol (MCP) workflows.
  4. Overview of AgentKit Python packages and extensions

    main

    AgentKit Python is composed of a core package and several framework-specific extensions that allow agentic workflows to interact with onchain actions.

    Core Package

    • coinbase-agentkit: Contains the core primitives and framework-agnostic actions. These are designed to be composable and are intended to be used through one of the framework extensions.

    Framework Extensions

    These extensions enable AgentKit actions to work within specific agent frameworks:

    • coinbase-agentkit-langchain: For LangChain workflows.
    • coinbase-agentkit-openai-agents-sdk: For OpenAI Agents SDK workflows.
    • coinbase-agentkit-strands-agents: For Strands Agents workflows.
    • coinbase-agentkit-pydantic-ai: For PydanticAI workflows.
    • coinbase-agentkit-autogen: For Microsoft Autogen workflows.
  5. Overview of AgentKit

    main
    AgentKit is a toolkit from the Coinbase Developer Platform designed to provide AI agents with crypto wallets and onchain interaction capabilities. It is built to be framework-agnostic (compatible with various AI frameworks) and wallet-agnostic (compatible with various wallet providers). Key use cases include enabling fee-free stablecoin payments and agent monetization.
  6. Use the EnsoActionProvider for DeFi routing and swaps

    main

    The EnsoActionProvider allows agents to interact with the Enso API to execute complex DeFi routes and token swaps across multiple blockchain networks. It is primarily used to find optimal paths for entering or exiting DeFi positions or swapping between ERC20 tokens.

    const ensoProvider = new EnsoActionProvider({
      apiKey: "your-enso-api-key"
    });
  7. Use the OpenseaActionProvider to interact with OpenSea

    main

    The OpenseaActionProvider allows agents to interact with the OpenSea NFT marketplace. It provides capabilities for listing NFTs for sale and querying NFTs owned by specific wallet addresses.

    Available Actions

    • list_nft: List an NFT for sale on OpenSea.
    • get_nfts_by_account: Fetch NFTs owned by a specific wallet address.

    Supported Networks

    The provider supports the following networks:

    • Ethereum Mainnet
    • Ethereum Sepolia
    • Base
    • Arbitrum
    • Optimism
  8. Use the AaveActionProvider to interact with Aave V3

    main

    The AaveActionProvider allows an agent to interact with the Aave V3 protocol on the Base network. It provides a set of predefined actions for managing liquidity, borrowing, and collateral.

    Available Actions

    • supply: Supply assets to the Aave V3 pool.
    • withdraw: Withdraw assets from the Aave V3 pool.
    • borrow: Borrow assets from the Aave V3 pool.
    • repay: Repay borrowed assets.
    • get_portfolio: Retrieve the user's current supply and borrow positions.
    • set_as_collateral: Enable or disable a specific asset to be used as collateral.
  9. Use CDP Action Providers in Python

    main

    CDP (Coinbase Developer Platform) Action Providers allow your agent to interact with the CDP API and various wallet services. There are three primary provider types available in the coinbase-agentkit Python package:

    1. CDPApiActionProvider: For interacting with CDP API services (e.g., reputation, faucets).
    2. CDPEVMWalletActionProvider: For EVM-based wallet operations (e.g., swaps).
    3. CDPSmartWalletActionProvider: For Smart Wallet-specific operations (e.g., swaps).

    Prerequisites: You must have CDP API credentials (API Key ID and Secret). You can obtain these from the CDP Portal.

  10. Use the SuperfluidActionProvider for streaming payments

    main

    The SuperfluidActionProvider allows an agent to interact with the Superfluid Protocol to manage streaming payments and token operations. It supports any EVM-compatible network.

    Available actions include:

    • create_flow: Create a money flow to a specified token recipient.
    • update_flow: Update an existing money flow.
    • delete_flow: Delete an existing money flow.
  11. Use the Sushi Action Provider for token discovery and swaps

    main

    The Sushi Action Provider provides two main providers that wrap Sushi APIs, allowing agents to discover tokens and execute swaps on EVM-compatible networks:

    1. SushiRouterActionProvider: Handles router-related actions like fetching quotes and executing swaps.
    2. SushiDataActionProvider: Handles data-related actions like searching for token information.

    These providers enable agents to interact with the Sushi Swap ecosystem directly through the AgentKit framework.