Skip to content

feat: implement flash loan provider#56

Merged
Ceejaytech25 merged 2 commits intoceejaylaboratory:mainfrom
Vivian-04:feat/flash-loan-provider
Mar 30, 2026
Merged

feat: implement flash loan provider#56
Ceejaytech25 merged 2 commits intoceejaylaboratory:mainfrom
Vivian-04:feat/flash-loan-provider

Conversation

@Vivian-04
Copy link
Copy Markdown
Contributor

PR #22 # Pull Request: Soroban Flash Loan Provider

Description

This PR implements a basic Flash Loan Provider smart contract for Soroban tokens, as requested in issue #22.

The contract allows borrowers to take out instantaneous loans of any supported Soroban token, provided they return the principal plus a fixed fee within the same transaction.

Key Features

  • Flash Loan Mechanism: Implements flash_loan(receiver, token, amount) which handles the funds transfer and external contract invocation.
  • Repayment Enforcement: Atomic balance verification ensures that the contract's balance is restored with the required fee (0.05%) by the end of the execution logic.
  • Event Emission: Publishes a flash_ln event upon every successful loan execution for transparency and tracking.
  • Unit Testing: Includes a comprehensive test suite (tests.rs) with mock receivers to validate both successful repayments and failed (reverted) loans.

Implementation Details

  • Location: src/flash_loan/
  • Fee Structure: Fixed at 5 basis points (0.05%).
  • Receiver Interface: Borrowers must implement the FlashLoanReceiver trait's execute_loan method.

Verification

I have manually verified the implementation logic against Soroban SDK standards and existing patterns in the AnchorPoint repository. The code structures and dependency management match the project's architecture.

Fixes #22
Soroban Flash Loan Provider Implementation

Description

This PR implements a basic Flash Loan Provider smart contract for Soroban tokens, as requested in issue #22.

The contract allows borrowers to take out instantaneous loans of any supported Soroban token, provided they return the principal plus a fixed fee within the same transaction.

Key Features

  • Flash Loan Mechanism: Implements flash_loan(receiver, token, amount) which handles the funds transfer and external contract invocation.
  • Repayment Enforcement: Atomic balance verification ensures that the contract's balance is restored with the required fee (0.05%) by the end of the execution logic.
  • Event Emission: Publishes a flash_ln event upon every successful loan execution for transparency and tracking.
  • Unit Testing: Includes a comprehensive test suite (tests.rs) with mock receivers to validate both successful repayments and failed (reverted) loans.

Implementation Details

  • Location: src/flash_loan/
  • Fee Structure: Fixed at 5 basis points (0.05%).
  • Receiver Interface: Borrowers must implement the FlashLoanReceiver trait's execute_loan method.

Verification

I have manually verified the implementation logic against Soroban SDK standards and existing patterns in the AnchorPoint repository. The code structures and dependency management match the project's architecture.

Closes #22

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 28, 2026

@Vivian-04 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ceejaytech25
Copy link
Copy Markdown
Contributor

@Vivian-04 , pls resolve conflict

@Vivian-04
Copy link
Copy Markdown
Contributor Author

Kindly confirm..Thanksss

@Ceejaytech25 Ceejaytech25 merged commit 5051ee0 into ceejaylaboratory:main Mar 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart Contract: Soroban Flash Loan Provider

2 participants