Description: Introduce flash loan capabilities to the TradeFlow liquidity pools. Users should be able to borrow arbitrary amounts of an asset in a single transaction, provided the borrowed amount plus a 0.05% protocol fee is returned by the end of the invocation.
Context / Motivation: Flash loans increase capital efficiency, empower arbitrageurs to keep TradeFlow prices aligned with the broader Stellar ecosystem, and generate additional passive yield for our Liquidity Providers.
Acceptance Criteria: - [ ] Create a flash_loan function that accepts a receiver contract address, asset, and amount.
Description: Introduce flash loan capabilities to the TradeFlow liquidity pools. Users should be able to borrow arbitrary amounts of an asset in a single transaction, provided the borrowed amount plus a 0.05% protocol fee is returned by the end of the invocation.
Context / Motivation: Flash loans increase capital efficiency, empower arbitrageurs to keep TradeFlow prices aligned with the broader Stellar ecosystem, and generate additional passive yield for our Liquidity Providers.
Acceptance Criteria: - [ ] Create a
flash_loanfunction that accepts a receiver contract address, asset, and amount.execute_operationfunction.initial_balance + fee.Technical Pointers: Leverage Soroban's
temporarystorage for the reentrancy guard. The receiver contract must implement a specific interface trait to handle the callback; define this interface clearly in the project'sinterfaces/module.