Skip to main content

Contract Interaction Flow

Use contract-interaction flows when an EVM wallet should approve and deposit ERC-20 funds through the SDK.

Requirements

RequirementWhy
evmRpcUrl or evmPublicClientThe SDK needs public ERC-20 reads
Wallet adapter with sendEthTransactionThe SDK asks the wallet to broadcast approval and deposit transactions
Token base-unit amountThe SDK sends protocol amounts as integers

Shape

const supplyFlow = await client.lending.supply({
mechanism: "contractInteraction",
profileId,
poolId,
action: "deposit",
walletAdapter,
account: evmAddress,
amount,
});

console.log("Deposit txid", supplyFlow.txid);

Use this for account-based ETH stablecoin flows. Instant loans return their own deposit and repayment targets.