Skip to content

backend: Implement Loan Lifecycle & Collateral Management Endpoints #1035

Description

@ONEONUORA

Problem Description

To support yield-bearing inheritance vaults integrated with Soroban lending pools, the frontend API service defines functions (freezeLoans, recallLoans, liquidateAndSettle) that call:

  • POST /api/plans/{id}/freeze-loans
  • POST /api/plans/{id}/recall-loans
  • POST /api/plans/{id}/liquidate-settle

None of these routes are registered in backend/src/api.rs or connected to the Soroban lending contract.

Missing Endpoints & Specs

  • Implement POST /api/plans/{id}/freeze-loans to halt new borrowing against vault collateral when a plan enters the triggered state.
  • Implement POST /api/plans/{id}/recall-loans to invoke Soroban cross-contract calls recalling loaned capital and accrued yield back into the inheritance contract vault.
  • Implement POST /api/plans/{id}/liquidate-settle to trigger collateral liquidation if loan recall fails or defaults during settlement.
  • Include proper authorization checking (Signature or JWT Auth) and emit status update events over WebSocket.

Affected Files

  • backend/src/api.rs
  • frontend/app/lib/api/plans.ts
  • backend/src/stellar_submit.rs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions