Aave V3 Stata
Supply or redeem Aave static shares using the USDC fork route or the Sepolia WETH/native-ETH manifests.
Choose the Aave deployment#
The USDC fork route uses Aave's existing StataTokenV2 ERC-4626 wrapper around the V3 USDC aToken. Queue deploys a Fuyu Pool and an AaveV3StataAdapter for that fork. The adapter inherits the fixed-share supply/redeem code; the external Aave contracts are left as deployed.
The USDC fork and Sepolia WETH/native-ETH paths use different configurations and adapters. Their operations are supply and redeem, without borrowing, leverage or reward claims. External Aave activity is public. Inside Fuyu, store the number of static shares and calculate their redemption value when needed.
USDC fork addresses#
The fork profile records Ethereum block 26,038,058 and its block hash. It also records proxy runtimes, implementation slots and implementation runtimes for the addresses below. Use this snapshot to reproduce the fixture. For another block or deployment, check implementation and liquidity again.
| Contract | Ethereum address in the fixture | Use |
|---|---|---|
| USDC | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 | 6-decimal underlying |
| StataTokenV2 | 0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E | 6-decimal fixed shares |
| Aave V3 Pool | 0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2 | Underlying reserve protocol |
| USDC aToken | 0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c | Interest-bearing token wrapped by Stata |
Check the Stata wrapper links#
The constructor checks vault.asset(), Stata POOL() and aToken(), and the aToken's POOL() and UNDERLYING_ASSET_ADDRESS(). Compare each result with the configuration. Also check bytecode and proxy implementations: getters can return the expected address even when the underlying contract is wrong.
AaveV3StataAdapter checks those links at construction and does not recheck proxy implementation pins inside execute. The API, browser worker and relay check them before use. An upgrade between preflight and inclusion can still change execution. Onchain, the adapter enforces the amount pulled, actual output, positive minimum and deadline.
// Read-only relationship check with ethers v5. provider is your reviewed RPC.
const stata = new ethers.Contract(
'0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E',
[
'function asset() view returns (address)',
'function POOL() view returns (address)',
'function aToken() view returns (address)',
'function previewDeposit(uint256) view returns (uint256)',
'function maxDeposit(address) view returns (uint256)',
], provider,
);
const blockTag = 26038058;
const asset = await stata.asset({ blockTag });
const aavePool = await stata.POOL({ blockTag });
const aToken = await stata.aToken({ blockTag });
// Compare these to the profile and separately check runtime/proxy pins.Use the right units for each direction#
Admit USDC and stataUSDC, then register aave-usdc-supply with operation 0 and aave-usdc-redeem with operation 1. Both require zero actionData. The Pool stores the adapter runtime code hash under each action key.
For a 10 USDC supply, amountIn is 10000000 atomic units. Do not reuse that number as the expected shares: get previewDeposit at the quote block, check maxDeposit for the Pool, and calculate minOut in share units. Redemption takes shares as input and uses USDC units for its quote and floor.
| Route | Operation | Private input → private settlement |
|---|---|---|
| aave-usdc-supply | 0 | USDC (6 decimals) → stataUSDC (6 decimals) |
| aave-usdc-redeem | 1 | stataUSDC (6 decimals) → USDC (6 decimals) |
Recover the shares after settlement#
The Pool verifies the private spend proof and action fields. The adapter pulls the input, grants the vault only the supply allowance it needs, and calls deposit or redeem with the Pool as receiver. It clears the temporary allowance and measures the Pool's output increase. A vault revert or short output rolls back the action.
Stage 1 reserves the shares or USDC. The default router finalizes in the same transaction. If the user chooses two stages, retain the action identifier until ActionFinalized, then scan authenticated history to recover the output. Keep it pending in the UI until the note is spendable, and recover any change from the input notes too.
Sepolia WETH and native ETH#
queue-sepolia-aave-manifest.ts accepts chain 11155111 only for the WETH/static-share pair listed below. This path uses the generic guarded ERC-4626 adapter and a release manifest digest. It checks the Fuyu Pool identity, asset/share runtimes, proxy implementations and five Aave relationship calls. Load the manifest for that deployment before offering the route.
The WETH route IDs are aave-weth-supply and aave-weth-redeem. With nativeUnderlying: true, they become aave-eth-supply and aave-eth-redeem. The Pool represents ETH as address(0), while the adapter trades its configured WETH. WETH and stataEthWETH both use eighteen decimals. The native route also needs the Pool's wrapping/unwrapping path and balance checks. See the deployment guide for Pool, adapter, domain and release digest.
| Sepolia contract | Address in the manifest |
|---|---|
| Aave WETH | 0xC558DBdd856501FCd9aaF1E62eae57A9F0629a3c |
| stataEthWETH | 0x162B500569F42D9eCe937e6a61EDfef660A12E98 |
| Aave Pool | 0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951 |
| WETH aToken | 0x5b071b590a59395fE4025A0Ccc1FcC931AAc1830 |
When redemption fails#
Aave can reject redemption when paused, short of underlying or upgraded. Estimate the complete Pool transaction after the venue diagnostics and check quote expiry again after proving. InsufficientOutput means the Pool received too little; InvalidDeployment points to a constructor address or relationship that failed its checks.
A screened withdrawal can send stataUSDC shares to a permitted public destination without using the redeem action. That wallet redeems through Aave later, subject to its liquidity and permissions. An emergency exit reveals the deposit source and returns an eligible Pending deposit. Check your deployment's funding-asset catalog and exit support. This path cannot redeem earned share notes.
AaveMainnetFork and the yield-adapter tests cover the USDC fixture. For your deployment, record the profile, adapter artifact/runtime, route registrations, quote block, execution and finalization receipts, and recovered shares. Recheck these after an Aave implementation change.