> 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/decision-making.md).

# Decision Making

Determine the profitability of moving funds from one network to another.

1. Calculates yield difference (for example, 8% on one protocol vs 5% on another).
2. Evaluates gas costs and slippage (if token swaps are needed).
3. If the benefit exceeds a set threshold (for example, 0.5-1% APR), form a transaction for the On-chain Interaction Module.

{% @mermaid/diagram content="sequenceDiagram
participant DMM as Decision Making Module
participant DB as Database
participant OIM as On-chain Interaction Module
DMM->>DB: Get latest APY data<br/>and current positions
DMM->>DMM: Calculate Delta\_Profit = (APY\_target - APY\_current) - Gas Cost
alt Delta\_Profit > Threshold
DMM->>OIM: Call to action (move funds)
else No sufficient profit
DMM->>DMM: Ignore, wait for next run
end" %}
