build_deposit
Turns a chosen market into signed-ready calldata: an ordered list of transactions to deposit into it or leave it, across Morpho vaults, Aave reserves, Moonwell markets and this project's staking pools — three different protocol interfaces behind one call. The approve step is included only when the current allowance does not already cover the amount, read on-chain at request time.
Use this once a market has been chosen and the decision is made.
Use something else when: still choosing (list_lending_vaults, best_yield); weighing whether to go ahead (market_profile, yield_history).
Nothing is signed or sent — the caller holds the keys. Simulate before sending. amount: "all" on a withdrawal exits by share rather than by figure, so interest accruing between the call and the block is not left behind.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pool": "<pool>",
"amount": "<amount>",
"from": "<from>"
},
"name": "build_deposit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | The address that will sign and hold the position | |
| pool | Yes | Market id from list_lending_vaults, e.g. 'sparkusdc', 'aave-usdc', 'mUSDC' | |
| action | No | Defaults to deposit | |
| amount | Yes | Whole asset units, e.g. '25.5' — or 'all' to exit a position completely |