> For the complete documentation index, see [llms.txt](https://yieldex.gitbook.io/yieldex-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yieldex.gitbook.io/yieldex-docs/architecture/modules/on-chain-interaction-module.md).

# On-chain Interaction Module

1. Receives a set of operations from the Decision Making Module.
2. Forms correct transactions: deposit / withdraw for the pools in a required network.
3. Uses users' smart accounts (ERC-4337).
4. Session keys set strict limits and timeframes for such operations.

{% @mermaid/diagram content="sequenceDiagram
participant DMM as DecisionMaking
participant OIM as OnChainInteraction
participant SAcc as ERC-4337<br/>SmartAccount
participant Protocol as Onchain Protocol
DMM->>OIM: Instruction / CallToAction
OIM->>SAcc: Signature request (Session Key) for deposit<br/> {network: Base, amount: 1000 USDC}
alt Session key is valid
SAcc->>SAcc: Check limits, protocol<br/>and validity period
SAcc->>Protocol: deposit(USDC, 1000)
Protocol-->>SAcc: Ok
SAcc-->>OIM: Transaction executed
OIM-->>DMM: Successful execution
else Session key expired
SAcc-->>OIM: Error: invalid key
OIM-->>DMM: Failure
end" %}
