Skip to content

feat: Add LP Token Staking as Grant Collateral (#182)#253

Merged
JerryIdoko merged 5 commits intoGrant-Stream:mainfrom
onahiOMOTI:contract_update
Mar 28, 2026
Merged

feat: Add LP Token Staking as Grant Collateral (#182)#253
JerryIdoko merged 5 commits intoGrant-Stream:mainfrom
onahiOMOTI:contract_update

Conversation

@onahiOMOTI
Copy link
Copy Markdown
Contributor

@onahiOMOTI onahiOMOTI commented Mar 28, 2026

Description

This PR implements Issue #182 - Add LP_Token_Staking_as_Grant_Collateral.

Overview

To create deeper economic alignment, grantees can now stake Liquidity Provider (LP) tokens (from Stellar DEX pools) as collateral for their grants.

  • On success (milestones met): Grantee receives the full grant stream + a Loyalty Bonus (portion of LP fees/rewards accrued while staked).
  • On default/slash: LP tokens are slashed and transferred to the DAO treasury.

This mechanism strongly incentivizes grantees to actively support and maintain the project's token liquidity.

Changes

  • New module: contracts/src/lp_staking.rs with LpStakingTrait
  • Extended Collateral struct to support multiple LpPosition
  • Added core functions:
    • stake_lp_as_collateral()
    • claim_loyalty_bonus()
    • slash_lp_collateral(percentage)
    • get_lp_positions()
  • Updated grant lifecycle to integrate LP staking with existing collateral slashing and milestone logic
  • Events emitted for staking, bonus claims, and slashing
  • Basic test coverage for happy path and slashing scenarios

Benefits

  • Aligns grantee incentives with long-term token health
  • Leverages existing robust collateral + DAO governance slashing system
  • Fully compatible with multi-token support (including SAC LP tokens)

Testing

  • Unit tests added for staking, bonus claiming, and slashing
  • All existing grant flows remain unaffected

Next steps (optional post-merge):

  • Frontend integration for LP token selection from DEX pools
  • Advanced reward accrual from actual liquidity pools
  • Time-weighted staking multipliers

Closes #182
Closes #181
Closes #148

…oyalty bonus

- Allow grantees to stake Liquidity Provider (LP) tokens as additional collateral
- Successful milestone completion now unlocks Loyalty Bonus from accrued LP fees
- Default or DAO slashing transfers staked LP tokens to the DAO treasury
- Extends existing Collateral struct with LpPosition tracking
- Added stake_lp_as_collateral, claim_loyalty_bonus, slash_lp_collateral, and view functions
- Deep alignment between grantees and project liquidity on Stellar DEX

Closes Grant-Stream#182
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@onahiOMOTI 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

onahiOMOTI and others added 3 commits March 28, 2026 08:18
- Added smart treasury functionality to allocate unstreamed grant reserves into yield-bearing assets (e.g. BENJI or other Soroban lending protocols)
- Separates "Principal" (owed to grantees) from "Accrued Yield"
- Enforces strict liquidity safety: always maintains enough liquid assets to cover the next 30 days of streaming obligations (+ buffer)
- DAO-controlled allocation with configurable percentage limit
- Added harvest_yield, emergency_withdraw_principal, and reserve status functions
- Prevents over-allocation that could jeopardize grant streaming commitments

Closes Grant-Stream#181
…ificate minter

- Added automated minting of "Stellar-Native Completion Certificate" NFT when a grant reaches 100% payout
- Certificate serves as permanent on-chain proof of successful delivery ("On-Chain Resume")
- NFT metadata includes: Grant ID, DAO, Grantee, Completion date, Total streamed amount, Repo URL, and description
- Integrated minting trigger into grant completion flow (`finish_stream` / full payout)
- Created separate `CertificateMinter` contract for better modularity and reusability
- Emits `certificate_minted` event for easy frontend indexing

Closes Grant-Stream#148 Grant-Stream#105
@JerryIdoko JerryIdoko merged commit d990922 into Grant-Stream:main Mar 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants