Skip to content

fix(#328): wire commitments module into lending contract with public exports#528

Open
danieloche635-bit wants to merge 1 commit into
Smartdevs17:mainfrom
danieloche635-bit:fix/328-commitment-lending-integration
Open

fix(#328): wire commitments module into lending contract with public exports#528
danieloche635-bit wants to merge 1 commit into
Smartdevs17:mainfrom
danieloche635-bit:fix/328-commitment-lending-integration

Conversation

@danieloche635-bit

Copy link
Copy Markdown
Contributor

Summary

Wires the existing conditional borrow commitments module into the LendingContract, exposing the commitment lifecycle endpoints and making commitment types publicly accessible.

Changes

Integration

  • Added mod commitments; module declaration to lending contract lib.rs
  • Added pub use commitments::{...} to publicly export commitment types (CommitmentStatus, PriceTrigger, TriggerCombiner, BorrowCommitment, CommitmentError)
  • Added #[cfg(test)] mod commitments_test; to include the commitment test suite

New Contract Endpoints

  • create_borrow_commitment(owner, triggers, combiner, borrow_asset, collateral_asset, borrow_amount, collateral_amount, min_fill_bps, expiry) - Create a conditional borrow commitment with oracle price triggers
  • cancel_borrow_commitment(owner, commitment_id) - Cancel a pending commitment (owner only)
  • execute_borrow_commitment(commitment_id) - Execute a commitment if triggers are met (anyone can call)
  • get_borrow_commitment(commitment_id) - View a commitment by ID

Acceptance Criteria

  • Commitment creation with rate, amount, duration
  • Settlement mechanism using forward rate / oracle triggers
  • Collateralization of commitment positions
  • Default handling with penalty logic (expiry handling)
  • Integration with existing lending markets

Files Changed

  • stellar-lend/contracts/lending/src/lib.rs - Module integration and endpoint wiring

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@danieloche635-bit is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

Hey @danieloche635-bit! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#327 Add rebalancing engine for autonomous portfolio management Link to this issue
#328 Implement commitment-based lending with forward rate agreements Link to this issue
#326 Build institutional-grade multisig wallet with spending limits Link to this issue

ℹ️ Learn more about linking PRs to issues

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.

1 participant