Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions typescript/agentkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,51 @@ const agent = createAgent({
</table>
</details>
<details>
<summary><strong>Aerodrome</strong></summary>
<table width="100%">
<tr>
<td width="200"><code>aerodrome_get_quote</code></td>
<td width="768">Gets a swap quote from Aerodrome Finance on Base.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_swap</code></td>
<td width="768">Swaps tokens on Aerodrome with slippage protection.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_add_liquidity</code></td>
<td width="768">Adds liquidity to an Aerodrome pool and receives LP tokens.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_remove_liquidity</code></td>
<td width="768">Removes liquidity from an Aerodrome pool with slippage protection.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_create_lock</code></td>
<td width="768">Locks AERO tokens to create a veAERO NFT for governance voting.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_vote</code></td>
<td width="768">Votes with a veAERO NFT to direct AERO emissions to pools.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_increase_amount</code></td>
<td width="768">Adds more AERO to an existing veAERO lock.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_increase_unlock_time</code></td>
<td width="768">Extends the lock duration of a veAERO position.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_withdraw</code></td>
<td width="768">Withdraws AERO from an expired veAERO lock.</td>
</tr>
<tr>
<td width="200"><code>aerodrome_claim_rewards</code></td>
<td width="768">Claims trading fees and bribes earned from veAERO voting.</td>
</tr>
</table>
</details>
<details>
<summary><strong>Base Account</strong></summary>
<table width="100%">
<tr>
Expand Down
57 changes: 57 additions & 0 deletions typescript/agentkit/src/action-providers/aerodrome/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Aerodrome Action Provider

This action provider integrates [Aerodrome Finance](https://aerodrome.finance/) with AgentKit, enabling AI agents to interact with the leading DEX on Base. Supports token swaps, liquidity management, veAERO governance locking, voting, reward claiming, and lock management.

## Directory Structure

```
aerodrome/
├── aerodromeActionProvider.ts # Main provider with all actions
├── aerodromeActionProvider.test.ts # Jest test suite (62 tests)
├── constants.ts # Contract addresses & ABIs
├── schemas.ts # Zod validation schemas
├── index.ts # Public exports
└── README.md # This file
```

## Actions

### Trading
- `aerodrome_get_quote`: Get a swap quote for a token pair (read-only)
- `aerodrome_swap`: Swap tokens with slippage protection (auto-calculates min output from quote)

### Liquidity
- `aerodrome_add_liquidity`: Add liquidity to a pool and receive LP tokens
- `aerodrome_remove_liquidity`: Remove liquidity with slippage protection via quoteRemoveLiquidity

### Governance (veAERO)
- `aerodrome_create_lock`: Lock AERO tokens to create a veAERO NFT for governance voting
- `aerodrome_vote`: Vote with veAERO NFT to direct AERO emissions to pools
- `aerodrome_increase_amount`: Add more AERO to an existing veAERO lock
- `aerodrome_increase_unlock_time`: Extend the lock duration of a veAERO position
- `aerodrome_withdraw`: Withdraw AERO from an expired veAERO lock

### Rewards
- `aerodrome_claim_rewards`: Claim trading fees and bribes earned from veAERO voting

## Network Support

- Base Mainnet only

## Design Decisions

- **Slippage-based swap**: Uses `slippageBps` (default 1%, max 10%) instead of raw `amountOutMin`. The action internally fetches a quote and computes the minimum output.
- **Safe LP removal**: Uses `quoteRemoveLiquidity` to estimate expected output, then applies slippage protection. Never uses zero minimums.
- **Token details via multicall**: Reuses `getTokenDetails` from the ERC20 action provider for efficient token info + balance fetching.
- **veAERO token ID extraction**: Parses the `Deposit` event log (filtered by contract address) from the `createLock` transaction to return the veAERO NFT token ID.
- **Pre-flight checks**: Vote verifies NFT ownership, voting power, and epoch status. Withdraw checks lock expiry and permanent lock status. increaseUnlockTime validates the 4-year ceiling.
- **Default deadline**: 10 minutes from execution time.
- **Gauge validation**: Vote and claimRewards validate gauge existence before submitting transactions.

## Notes

- Aerodrome uses a `Route` struct for swaps (not simple address paths). Each route specifies `from`, `to`, `stable`, and `factory`.
- Pools can be **stable** (correlated assets, Curve's x^3*y + y^3*x invariant) or **volatile** (standard x*y=k).
- veAERO voting directs AERO emissions to pools. Voters earn 100% of trading fees and bribes.
- Voting occurs per epoch (weekly, Thursday to Thursday UTC).
- Lock durations are rounded down to the nearest Thursday epoch boundary on-chain.
Loading
Loading