Skip to content

feat: integrate yield distribution with Soroban liquidity pools - #1183

Open
ChukwuebukaJohnDev wants to merge 2 commits into
Fracverse:masterfrom
ChukwuebukaJohnDev:feat/issue-1143-contract-implement-yield-distribution
Open

feat: integrate yield distribution with Soroban liquidity pools#1183
ChukwuebukaJohnDev wants to merge 2 commits into
Fracverse:masterfrom
ChukwuebukaJohnDev:feat/issue-1143-contract-implement-yield-distribution

Conversation

@ChukwuebukaJohnDev

Copy link
Copy Markdown

Overview

This PR adds a Soroban Yield Distribution Integration system that deposits idle XLM/USDC from inheritance-plan vaults into Soroban liquidity pools, tracks yield token shares per plan, and enables real yield generation on testnet assets.

Related Issue

Closes #

Changes

🏦 Yield Pool Deposit Integration

  • [MODIFY] contracts/inheritance-contract/src/lib.rs
    • Implements deposit_to_yield_pool(env: Env, pool_address: Address, amount: i128) using the Soroban token client.
    • Handles token approval and transfers idle XLM/USDC from the plan vault into the target Soroban liquidity pool.
    • Invokes existing yield_math.rs formulas to compute share entitlement during deposit.

📊 Per-Plan Yield Share Tracking

  • [MODIFY] contracts/inheritance-contract/src/lib.rs
    • Adds persistent per-plan yield share accounting via StorageMap<(Address, Address), i128> mapped by (plan, pool_address).
    • Updates share balances on deposit so each plan’s yield is tracked independently and accurately.

✅ Test Coverage

  • [ADD] #[cfg(test)] module in contracts/inheritance-contract/src/lib.rs
    • Covers deposit_to_yield_pool with mocked Soroban token/pool clients.
    • Verifies per-plan share balance updates and consistency with yield_math.rs.

Verification Results

cargo test -p inheritance-contract
✅ 18/18 passed

Testnet acceptance check:
✅ deposit_to_yield_pool executes via Soroban token client
✅ Idle XLM/USDC deposited into Soroban liquidity pool
✅ Yield token shares tracked per plan
✅ yield_math.rs share math verified against live pool result
Acceptance Criteria Status
Deposit idle XLM/USDC into Soroban yield pools ✅ Cross-contract deposit implemented and testnet-verified
Yield token shares balance tracked per plan ✅ Per-plan storage map updated on every deposit
Real yield generation on testnet assets ✅ Verified against testnet XLM/USDC pool
yield_math.rs connected to live pool invocation ✅ Share math invoked from deposit_to_yield_pool

Closes #1143

@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

@ONEONUORA

Copy link
Copy Markdown
Contributor

@ChukwuebukaJohnDev
Run cargo fmt --all -- --check and clippy also

@ONEONUORA

Copy link
Copy Markdown
Contributor

@ChukwuebukaJohnDev
Pls update on this pr

@ONEONUORA

Copy link
Copy Markdown
Contributor

@ChukwuebukaJohnDev
Pls update on this PR

@ONEONUORA

Copy link
Copy Markdown
Contributor

@ChukwuebukaJohnDev
Pls fix conflict

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.

Contract: Implement Yield Distribution Integration with Soroban Liquidity Pools

2 participants