Skip to content

lending:withdraw

Withdraw a supplied token from a lending market. Pass max as the amount to withdraw the full balance, accrued interest included.

⚗️ Experimental — available at next.evmcrispr.com.

Supports runtime fields inside smart blocks. Use explicit @helper! expressions or captured outputs; other fields are evaluated at build time.

lending:withdraw <amount> <token>
NameTypeEvaluationDescription
amountcommand | numberRuntime in smart blocksAmount to withdraw in base units (wei), or the keyword max for the full balance
tokenaddressBuild timeSupplied token to withdraw (use @token(SYM))
NameTypeEvaluationDescription
--usinglending-adapterBuild timeLending protocol: AaveV3, Spark or CompoundV3 (default: the best available on the chain)
--toaddressRuntime in smart blocksRecipient of the withdrawn tokens (defaults to the connected account)
# Withdraw 50 WXDAI from Aave v3 on Gnosis
lending:withdraw 50e18 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d
# Withdraw the full WXDAI balance, accrued interest included
lending:withdraw max 0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d