Tools: Lending
Supply, withdraw, borrow, repay, and read lending positions across Aave, Compound, Kamino, and Marginfi.
Lending tools manage positions across multiple DeFi protocols. All write tools require policy approval. Protocol is auto-selected by chain when omitted (EVM defaults to Aave, Solana defaults to Kamino).
lend_tokens
Supply tokens to a lending protocol. Supports native execution for Aave v3 (EVM), Compound v3 (EVM), Kamino (Solana), and Marginfi (Solana).
Parameters
Prop
Type
Transaction Envelope (Fallback)
When native parameters are insufficient, you can provide a transaction envelope.
EVM envelope:
Prop
Type
Solana envelope:
Prop
Type
Adapter:
Prop
Type
Per-Protocol Behavior
- Default protocol for EVM chains - Native execution: Seashail calls Aave v3
Pool directly - Supports supply, withdraw, borrow, repay -
pool_addressoverride available for testing -amount=maxNOT supported for supply operations
- Set
protocol: "compound"explicitly - Native execution via Compound v3 Comet -comet_addressoverride for non-default markets - Usetoken: "base"to supply the base token (baseToken()) -amount=maxNOT supported for native path
- Default protocol for Solana chains - Native execution via Kamino lending -
marketoverride for non-default markets - Supports supply, withdraw, borrow, repay
- Set
protocol: "marginfi"explicitly - Native execution via Marginfi -groupoverride available - Ifmarginfi_accountis omitted, uses most recently created account
Response
{
"signature": "5UfD...txid",
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "1000",
"status": "confirmed"
}Response shape is representative; actual fields may vary.
Examples
{
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "1000",
"amount_units": "ui"
}{
"chain": "solana",
"protocol": "kamino",
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "500",
"amount_units": "ui"
}Notes
- Requires policy approval — lending operations may be auto-approved, require confirmation, or be blocked depending on your policy configuration and USD value.
- Protocol is auto-selected by chain: EVM chains default to Aave, Solana defaults to Kamino.
amount=maxis NOT supported for native Aave/Compound supply paths.- If no native parameters are provided, falls back to transaction envelope mode (requires
to/datafor EVM ortx_b64for Solana). - See also: DeFi Guide
withdraw_lending
Withdraw supplied tokens from a lending protocol. Supports native execution for Aave v3 (EVM), Compound v3 (EVM), Kamino (Solana), and Marginfi (Solana).
Parameters
Prop
Type
Transaction Envelope (Fallback)
See lend_tokens for transaction envelope parameters (EVM: to, data, value_wei; Solana: tx_b64, allowed_program_ids; Adapter: asset).
Per-Protocol Behavior
See Per-Protocol Behavior above for protocol-specific details. Key differences for withdraw:
- Aave:
amount="max"supported but requiresusd_valuefor policy enforcement - Compound:
amount="max"NOT supported for native path - Kamino/Marginfi: Follow standard Solana withdraw patterns
Response
{
"signature": "5UfD...txid",
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "500",
"status": "confirmed"
}Response shape is representative; actual fields may vary.
Examples
{
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "max",
"amount_units": "ui",
"usd_value": 500.0
}{
"chain": "base",
"protocol": "compound",
"token": "base",
"amount": "100",
"amount_units": "ui"
}Notes
- Requires policy approval.
- Protocol is auto-selected by chain: EVM chains default to Aave, Solana defaults to Kamino.
amount="max"behavior varies by protocol: Aave supports it (requiresusd_value), Compound does not.- See also: DeFi Guide
borrow_tokens
Borrow tokens from a lending protocol against collateral. Supports native execution for Aave v3 (EVM), Compound v3 (EVM), Kamino (Solana), and Marginfi (Solana).
Parameters
Prop
Type
Transaction Envelope (Fallback)
See lend_tokens for transaction envelope parameters (EVM: to, data, value_wei; Solana: tx_b64, allowed_program_ids; Adapter: asset).
Per-Protocol Behavior
See Per-Protocol Behavior above for protocol-specific details. Key differences for borrow:
- Aave: Supports
interest_rate_mode(variable or stable) - Compound: Use
token="base"to borrow the market's base token - All protocols:
amount=maxNOT supported for native paths
Response
{
"signature": "5UfD...txid",
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "200",
"interest_rate_mode": "variable",
"status": "confirmed"
}Response shape is representative; actual fields may vary.
Examples
{
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "200",
"amount_units": "ui",
"interest_rate_mode": "variable"
}{
"chain": "base",
"protocol": "compound",
"token": "base",
"amount": "50",
"amount_units": "ui"
}Notes
- Requires policy approval.
- Protocol is auto-selected by chain: EVM chains default to Aave, Solana defaults to Kamino.
amount=maxis NOT supported for native paths.- Aave supports both variable and stable interest rate modes via
interest_rate_mode. - For Compound v3,
tokenmust be the market's base token. Usetoken="base"as shorthand for baseToken(). - See also: DeFi Guide
repay_borrow
Repay a borrow on a lending protocol. Supports native execution for Aave v3 (EVM), Compound v3 (EVM), Kamino (Solana), and Marginfi (Solana).
Parameters
Prop
Type
Transaction Envelope (Fallback)
See lend_tokens for transaction envelope parameters (EVM: to, data, value_wei; Solana: tx_b64, allowed_program_ids; Adapter: asset).
Per-Protocol Behavior
See Per-Protocol Behavior above for protocol-specific details. Key differences for repay:
- Aave:
amount="max"supported but requiresusd_valuefor policy enforcement; supportsinterest_rate_mode - Compound:
amount="max"NOT supported for native path; usetoken="base"for base token - Kamino/Marginfi: Follow standard Solana repay patterns
Response
{
"signature": "5UfD...txid",
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "200",
"interest_rate_mode": "variable",
"status": "confirmed"
}Response shape is representative; actual fields may vary.
Examples
{
"chain": "ethereum",
"protocol": "aave",
"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"amount": "max",
"amount_units": "ui",
"usd_value": 200.0,
"interest_rate_mode": "variable"
}{
"chain": "solana",
"protocol": "kamino",
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "100",
"amount_units": "ui"
}Notes
- Requires policy approval.
- Protocol is auto-selected by chain: EVM chains default to Aave, Solana defaults to Kamino.
amount="max"behavior varies by protocol: Aave supports it (requiresusd_value), Compound does not.- Aave supports both variable and stable interest rate modes via
interest_rate_mode. - For Compound v3,
tokenmust be the market's base token. Usetoken="base"as shorthand for baseToken(). - See also: DeFi Guide
get_lending_positions
Read-only lending/borrowing positions. Supports native reads for Aave v3 (EVM), Compound v3/Comet (EVM), Kamino (Solana), and Marginfi (Solana). Falls back to a configured DeFi adapter for other protocols.
Parameters
Prop
Type
Response
{
"protocol": "aave",
"chain": "ethereum",
"positions": [
{
"token": "0xA0b8...",
"symbol": "USDC",
"supplied": "1000.0",
"supplied_usd": 1000.0,
"borrowed": "0",
"borrowed_usd": 0,
"apy_supply": 3.2,
"apy_borrow": null
}
],
"health_factor": 2.5
}Response shape is representative; actual fields may vary.
Examples
{
"chain": "ethereum",
"protocol": "aave"
}{
"chain": "solana",
"protocol": "kamino"
}Notes
- This is a read-only tool; no policy approval required.
- Protocol-specific overrides (
pool_address,comet_address,market,group,marginfi_account) are primarily useful for testing or non-default deployments. - Protocol is auto-selected by chain: EVM chains default to Aave, Solana defaults to Kamino.
- For Marginfi, if
marginfi_accountis omitted, Seashail uses the most recently created account (best-effort). - See also: DeFi Guide