building-blocks

Explain DeFi composability with Uniswap V3/V4, Aave V3, and ERC-4626 vaults.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/andginja/ethskills --skill building-blocks-andginja
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: building-blocks
Source: https://github.com/andginja/ethskills/tree/main/skills/building-blocks
Command: npx skills add https://github.com/andginja/ethskills --skill building-blocks-andginja

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides essential knowledge and code examples for interacting with and composing core DeFi protocols like Uniswap V3/V4, Aave V3, and ERC-4626 vaults, addressing common pitfalls and enabling advanced financial strategies.

Core Features & Use Cases

  • Protocol Interaction: Learn how to swap on Uniswap V3/V4, supply/borrow/flash loan on Aave V3, and build/compose ERC-4626 vaults.
  • Composability Patterns: Understand how to combine these protocols for strategies like flash loan arbitrage, leveraged yield farming, and more.
  • Use Case: Automatically execute a flash loan arbitrage strategy by borrowing USDC from Aave, swapping it for ETH on Uniswap, and then swapping ETH back to USDC on another DEX, repaying the loan with profit, all within a single transaction.

Quick Start

Use the building-blocks skill to get the address for the Uniswap V3 SwapRouter on Ethereum mainnet.

Frequently Asked Questions about building-blocks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I execute a flash loan arbitrage strategy across Aave and Uniswap?

Flash loan arbitrage involves borrowing assets from Aave V3, executing swaps on Uniswap V3/V4, and repaying the loan within a single transaction. You compose smart contracts to handle atomic borrowing, swapping, and repayment logic securely.

What is DeFi composability and how does it combine Uniswap and Aave?

DeFi composability combines protocols like Uniswap and Aave into complex financial strategies. It works by chaining smart contract interactions, such as using borrowed assets from Aave to supply liquidity or swap on Uniswap.

How do I build a custom ERC-4626 yield vault?

Building an ERC-4626 vault involves implementing the standard interface for tokenized yield-bearing shares. You write smart contracts that accept asset deposits, issue shares, and deploy assets into strategies like Aave lending to generate returns.

How do I get the correct mainnet addresses for Uniswap and Aave smart contracts?

Getting correct mainnet addresses requires overcoming stale training data issues by verifying protocol addresses on-chain. You can use fork testing examples to simulate mainnet conditions and validate Uniswap and Aave contract addresses before deployment.

What are the guardrails when composing Aave V3 flash loans?

Guardrails when composing Aave V3 flash loans include ensuring the loan amount plus fees is repaid by the end of the transaction. Smart contracts must handle revert conditions if swap slippage on Uniswap prevents profitable repayment.

Can I use Uniswap V4 hooks with ERC-4626 vaults?

You can compose Uniswap V4 hooks with ERC-4626 vaults by integrating custom swap logic within the vault strategy. This allows the vault to dynamically manage assets or execute specific trading behaviors when interacting with the DEX.