Skip to content

[Feature] Multi-Asset Collateral Vaults for Borrowing #175

Description

@AlAfiz

Description: Build a standalone Vault contract allowing users to lock XLM or stablecoins (USDC) as collateral to mint a synthetic stablecoin (e.g., tfUSD).
Context / Motivation: This transforms TradeFlow from a simple DEX into a comprehensive DeFi ecosystem by introducing debt markets.
Acceptance Criteria: - [ ] Contract must accept multiple Stellar assets as collateral.

  • Implement borrowing logic restricted by a global COLLATERALIZATION_RATIO (e.g., 150%).
  • Include a liquidate function allowing third parties to repay debt and seize collateral at a discount if a vault falls below the maintenance margin.
  • Read prices securely (mock an oracle interface for now, preparing for the TWAP integration).
    Technical Pointers: State management is crucial here. Use Map or separate storage entries for individual user debt and collateral balances. Ensure arithmetic does not suffer from precision loss (use Soroban's fixed-point math conventions).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaignhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions