Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.
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
29 changes: 28 additions & 1 deletion app-developers/guides/configuring-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,31 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid
};
```

</Step>
<Step title="Configure Swap Providers">
Configure which swap protocols you want to support. You can enable one or multiple providers:

```typescript title="actions.ts"
// Additional config from previous steps...

import type { SwapConfig } from "@eth-optimism/actions-sdk";

const swapConfig: SwapConfig = {
uniswap: {
// Uniswap V3 configuration
enabled: true,
},
aerodrome: {
// Aerodrome (Base L2 optimized)
enabled: true,
},
velodrome: {
// Velodrome (Optimism L2 optimized)
enabled: true,
},
};
```

</Step>
<Step title="Configure supported chains">
Configure supported chains:
Expand Down Expand Up @@ -259,6 +284,7 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid
wallet: walletConfig,
assets: assetsConfig,
lend: lendConfig,
swap: swapConfig,
chains,
});
```
Expand All @@ -273,7 +299,8 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid
// Use actions anywhere in your app
const market = await actions.lend.getMarket({ ... });
const wallet = await actions.wallet.createSmartWallet({ ... });
const receipt = await wallet.lend.openPosition({ ... });
const lendReceipt = await wallet.lend.openPosition({ ... });
const swapReceipt = await wallet.swap.execute({ ... });
```

</Step>
Expand Down
43 changes: 36 additions & 7 deletions app-developers/quickstarts/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -410,20 +410,20 @@ const lendPosition = await wallet.lend.getPosition(market);
// Fetch wallet balance
const balance = await wallet.getBalance();

// Swap tokens using Uniswap
const swapReceipt = await wallet.swap.execute({
amountIn: 1,
assetIn: USDC,
assetOut: ETH,
});

// ⚠️ COMING SOON
const borrowReceipt = await wallet.borrow.openPosition({
amount: 1,
asset: USDT,
...market,
});

// ⚠️ COMING SOON
const swapReceipt = await wallet.swap.execute({
amountIn: 1,
assetIn: USDC,
assetOut: ETH,
});

// ⚠️ COMING SOON
const sendReceipt = await wallet.send({
amount: 1,
Expand All @@ -432,6 +432,35 @@ const sendReceipt = await wallet.send({
});
```

## Swap Tokens

Actions SDK supports token swaps through multiple providers:

```typescript
import { USDC, ETH } from "@eth-optimism/actions-sdk/assets";

// Get swap quote
const quote = await wallet.swap.getQuote({
amountIn: 100,
assetIn: USDC,
assetOut: ETH,
});

// Execute swap
const receipt = await wallet.swap.execute({
amountIn: 100,
assetIn: USDC,
assetOut: ETH,
});
```

Supported swap providers:
- **Uniswap V3**: Available on Ethereum mainnet and most L2s
- **Aerodrome**: Optimized for Optimism (Base)
- **Velodrome**: Optimized for Optimism

See [Swap Documentation](/app-developers/reference/actions/swap-documentation) for full API reference.

## Next Steps

- [Configure Actions](/app-developers/guides/configuring-actions) to customize protocols, chains, and assets
Expand Down
9 changes: 9 additions & 0 deletions app-developers/reference/actions/swap-documentation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Swap Documentation
description: API reference for Actions SDK swap operations, functions, and parameters.
---

import WalletSwapNamespace from "/snippets/actions/wallet-swap-namespace.mdx";

{/* This component is generated by script: scripts/generate-actions-components.ts */}
<WalletSwapNamespace />
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,8 @@
"pages": [
"app-developers/reference/actions/integrating-wallets",
"app-developers/reference/actions/wallet-definitions",
"app-developers/reference/actions/lend-documentation"
"app-developers/reference/actions/lend-documentation",
"app-developers/reference/actions/swap-documentation"
]
},
{
Expand Down
1 change: 1 addition & 0 deletions scripts/generate-actions-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ACTIONS_COMPONENTS: Record<string, string> = {
WalletNamespace: "src/wallet/core/namespace/WalletNamespace.ts",
Wallet: "src/wallet/core/wallets/abstract/Wallet.ts",
WalletLendNamespace: "src/lend/namespaces/WalletLendNamespace.ts",
WalletSwapNamespace: "src/swap/namespaces/WalletSwapNamespace.ts",
};

// SDK metadata
Expand Down