DeFi Agent

DeFi Agent

The DeFi Agent is ADAS's blockchain operations specialist for the Aptos ecosystem. It handles all on-chain actions across various Aptos DeFi protocols, including token transfers, swaps, lending/borrowing, and staking operations.

Overview

Primary Role: Execute blockchain operations on Aptos

Plugin: @elizaos-plugins/plugin-aptos

Character File: eliza/characters/defi-agent.character.json

Knowledge Base: eliza/characters/knowledge/protocols/

Capabilities

The DeFi Agent can perform a wide range of operations on the Aptos blockchain:

Core Aptos Operations

Category
Capabilities
Status

Token Operations

Transfer APT and other tokens

✅ Implemented

Check balances

✅ Implemented

Get token details

✅ Implemented

Get token prices

✅ Implemented

Token Management

Create new tokens

✅ Implemented

Mint tokens

✅ Implemented

Burn tokens

✅ Implemented

NFT Operations

Create NFTs

✅ Implemented

Transfer NFTs

⚠️ Partial

Burn NFTs

⚠️ Partial

Account Info

Get account details

✅ Implemented

Look up transactions

✅ Implemented

Show account modules

✅ Implemented

Portfolio

View token and NFT holdings

✅ Implemented

Track token values

✅ Implemented

Protocol-Specific Operations

Joule Finance

Operation
Description
Status

Deposit

Supply assets to Joule lending pools

✅ Implemented

Borrow

Borrow assets against collateral

✅ Implemented

Repay

Repay borrowed assets

✅ Implemented

Withdraw

Withdraw supplied assets

✅ Implemented

Claim Rewards

Claim JOY token rewards

✅ Implemented

Check Position

View current lending/borrowing position

✅ Implemented

Pool Information

Get details about lending pools

✅ Implemented

Amnis Finance

Operation
Description
Status

Stake

Stake APT to receive stAPT

✅ Implemented

Unstake

Unstake APT from stAPT

✅ Implemented

Liquidswap

Operation
Description
Status

Swap

Swap tokens on Liquidswap

✅ Implemented

Add Liquidity

Provide liquidity to pools

⚠️ Partial

Remove Liquidity

Remove liquidity from pools

⚠️ Partial

Create Pool

Create new liquidity pools

⚠️ Partial

Thala Labs

Operation
Description
Status

Swap

Swap tokens on Thala DEX

✅ Implemented

Add Liquidity

Provide liquidity to Thala pools

✅ Implemented

Remove Liquidity

Remove liquidity from Thala pools

✅ Implemented

Stake

Stake tokens on Thala Protocol

✅ Implemented

Unstake

Unstake tokens from Thala Protocol

✅ Implemented

Merkle Trade

Operation
Description
Status

Get Positions

View current trading positions

✅ Implemented

Place Limit Order

Create limit orders at specified price

✅ Implemented

Place Market Order

Execute trades at current market price

✅ Implemented

Close Position

Close existing trading positions

✅ Implemented

Aries Protocol

Operation
Description
Status

Create Profile

Create a user profile on Aries Protocol

✅ Implemented

Lend

Lend tokens to Aries lending pools

✅ Implemented

Borrow

Borrow tokens against collateral

✅ Implemented

Repay

Repay borrowed tokens

✅ Implemented

Withdraw

Withdraw lent tokens

✅ Implemented

Implementation Details

The DeFi Agent leverages the Aptos plugin to interact with the Aptos blockchain. The plugin provides a comprehensive set of actions that the agent can use to execute various operations.

Action Flow

  1. User sends a request to the DeFi Agent

  2. Agent parses the request to identify the intended operation

  3. Agent retrieves relevant information (e.g., token prices, gas estimates)

  4. Agent presents transaction details to the user for confirmation

  5. Upon confirmation, agent executes the transaction

  6. Agent monitors transaction status and reports results

Security Measures

  • Private keys are stored securely and never exposed

  • All transactions require explicit user confirmation

  • Risk assessments are provided before executing operations

  • Comprehensive error handling and recovery mechanisms

Testing

Test Prompts

Use these prompts to test the DeFi Agent's capabilities:

Core Aptos Actions

Token Management

NFT Operations

Joule Finance

Amnis Finance

Liquidswap

Thala Labs

Merkle Trade

Aries Protocol

Future Development

The DeFi Agent is continuously being enhanced with new capabilities:

Short-term Priorities

  1. Comprehensive testing of all implemented protocol integrations

  2. Error handling improvements for complex transactions

  3. Performance optimization for chain operations

  4. Enhanced user feedback for transaction status

Long-term Goals

  1. Support for additional Aptos protocols

  2. Advanced portfolio management strategies

  3. Automated yield optimization

  4. Cross-protocol operations

Resources

Last updated