Skip to main content

Earn Yield

This guide walks through depositing assets into a DeFi protocol to earn yield. For a complete quickstart, see the Quickstart.

Supported markets

Compound

NetworkMarketAsset
MainnetcUSDCv3USDC
MainnetcWETHv3WETH
MainnetcUSDTv3USDT
BasecUSDCv3USDC
BasecWETHv3WETH
ArbitrumcUSDCv3USDC
ArbitrumcUSDTv3USDT
ArbitrumcWETHv3WETH
OptimismcUSDCv3USDC
OptimismcUSDTv3USDT
OptimismcWETHv3WETH
UnichaincUSDCv3USDC
PolygoncUSDTv3USDT

Aave

NetworkMarketAsset
BaseAave V3 BASE MarketWETH, cbETH, wstETH, USDC, weETH, cbBTC, ezETH, GHO, wrsETH, EURC, AAVE
ArbitrumArbitrum Aave MarketLINK, WBTC, WETH, USDT, AAVE, wstETH, rETH, USDC, ARB, weETH, GHO, ezETH, rsETH
OptimismOptimism Aave MarketLINK, WBTC, WETH, USDT, AAVE, OP, wstETH, rETH, USDC

Morpho

NetworkVaultAsset
MainnetgtUSDCcoreUSDC
BasemwUSDCUSDC
World ChainRe7USDCUSDC
World ChainRe7WETHWETH
World ChainRe7WBTCWBTC
World ChainRe7WLDWLD
Unichaingtusdt0cUSDT
UnichaingtwethcWETH
UnichaingtusdccUSDC
HyperEVMfeUSDCUSDC
HyperEVMfeUSDHUSDH
Use List Assets and List Networks for the full programmatic list.

Steps

1. Ensure the wallet is funded

The sub-account’s legend_wallet_address must hold the asset you want to earn with. Transfer USDC (or another supported asset) to this address on the target network before creating a plan.

2. Create the earn plan

const plan = await client.plan.earn(account.account_id, {
  amount: "1000000",   // 1 USDC
  asset: "USDC",
  network: "base",
  protocol: "compound",
});

3. Sign and execute

See the Plan-Sign-Execute concept guide for the full signing flow.
const signer = privateKeyToAccount(privateKey);
const signature = await signer.sign({ hash: plan.details.eip712_data.digest });

const result = await client.plan.execute(account.account_id, {
  planId: plan.plan_id,
  signature,
});

4. Monitor

Poll activities to confirm the deposit:
const { activities } = await client.accounts.activities(account.account_id);
// Look for activity_type: "quark_operation_executed"
// with activity_metadata containing action_type: "COMET_SUPPLY"