Skip to content

Automated Loan Liquidation Monitor #118

@anonfedora

Description

@anonfedora

Description: A background service must monitor the value of collateralized assets and trigger liquidations if the Loan-to-Value (LTV) ratio exceeds the threshold.
Technical Context: Use blockchain.service.ts and contract.service.ts.
Tasks:

  • Create a LiquidationWorker in server/src/services/liquidation.service.ts.
  • Implement a cron-based loop (every 5–15 minutes) to fetch real-time asset prices from the Stellar DEX.
  • For each active loan, calculate current collateral_value / loan_amount.
  • If LTV > threshold (e.g., 85%), trigger the liquidate function on the EscrowManager contract.
  • Send push notifications to both borrower and lender via websocketService.
    Acceptance Criteria:
  • Successfully triggers a mock liquidation on testnet when price drops.
  • Worker handles network timeouts and retries gracefully.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions