Skip to content

feat: pool_fail event, factory analytics, lock bonus in calculate_credits, compound function - #750

Merged
ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
Emeka-12:fix/factory-failure-event-analytics-compound-lock-credits
Nov 23, 2026
Merged

ritaifeoluwa merged 2 commits into
SmartDropLabs:mainfrom
Emeka-12:fix/factory-failure-event-analytics-compound-lock-credits

Conversation

@Emeka-12

Copy link
Copy Markdown
Contributor

Summary

  • factory: create_pool doesn't emit event on validation failure #606 — soroban/contracts/factory/src/lib.rs: Emit a (factory, pool_fail) event with the error code when create_pool_inner returns an error. Indexers can now observe rejected creation attempts without parsing diagnostic events from the transaction.

  • farming-pool: calculate_credits doesn't account for lock period #607 — soroban/contracts/farming-pool/src/lib.rs: Apply a 50% credit bonus in calculate_credits when the user's position is still within its lock period (current_ledger < unlock_ledger). Aligns the displayed credit value with the economic incentive for locking.

  • farming-pool: no compound interest support #610 — soroban/contracts/farming-pool/src/lib.rs: Add a compound(env, user) function that re-checkpoints the caller's position — banking accrued credits into total_credits and resetting checkpoint_ledger — and emits a (pool, compound) event. Prevents integer-overflow drift on long-running positions.

  • factory: no pool analytics query #611 — soroban/contracts/factory/src/lib.rs: Add a get_pool_analytics(env, pool_id) function returning a PoolMetrics struct with the pool's TVL, credit rate, global multiplier, deprecation status, snapshot count and last snapshot ledger from factory-owned storage only (no cross-contract calls).

Closes #606
Closes #607
Closes #610
Closes #611

🤖 Generated with Claude Code

…culate_credits, compound function

Closes SmartDropLabs#606
Closes SmartDropLabs#607
Closes SmartDropLabs#610
Closes SmartDropLabs#611

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

👷 Deploy request for sdcontracts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 63937ce

@drips-wave

drips-wave Bot commented Nov 22, 2026

Copy link
Copy Markdown

@Emeka-12 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

@ritaifeoluwa
ritaifeoluwa merged commit d529cb0 into SmartDropLabs:main Nov 23, 2026
1 of 2 checks passed
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