feat: implement token transfers, risk-priced premiums, and governance docs - #579
Merged
Levi-Ojukwu merged 1 commit intoJul 26, 2026
Conversation
|
@oomokaro1 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! 🚀 |
… docs (Invoice-Liquidity-Network#527, Invoice-Liquidity-Network#526, Invoice-Liquidity-Network#528, Invoice-Liquidity-Network#543) # Conflicts: # sdk/src/index.ts # sdk/src/methods/insurance.ts
oomokaro1
force-pushed
the
feat/insurance-pool-improvements
branch
from
July 26, 2026 11:25
aac9afc to
565ab2f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #527, Closes #526, Closes #528, Closes #543
Type of Change
Summary
This PR implements three major improvements to the insurance pool contract:
Issue Implement actual token transfers in insurance pool #527 - Token Transfers: Added real token transfers to the insurance pool using Soroban's token interface.
deposit_premiumnow transfers tokens from LP to pool, andclaimtransfers tokens from pool to LP. Uses checks-effects-interactions pattern for reentrancy protection.Issue Implement risk-priced insurance premiums #528 - Risk-Priced Premiums: Implemented risk-based premium calculation where higher-risk LPs pay higher premiums. Added tiered coverage caps based on premiums paid (50%-150% of base coverage). Includes governance parameters for base rate and risk multiplier configuration.
Issue Update
docs/events.mdwith all governance events #526 - Governance Events Documentation: Added comprehensive event schemas for all governance contract events includingGovernanceInitialized,GovernanceParameterUpdated,ProposalCreated,VoteCast,ProposalExecuted,ProposalVetoed,VotesDelegated,VotesUndelegated, andVetoPowerDisabled.Issue Implement on-chain mechanism to update insurance pool coverage cap #543 - Coverage Cap Update: Verified existing timelock mechanism for coverage cap updates is already implemented and working.
Motivation / Context
These changes make the insurance pool production-ready by:
docs/events.mdwith all governance events #526)Changes
Smart Contract (Rust)
TokenAddressstorage key andinitializenow accepts token parameterdeposit_premiumcallstoken.transfer()to move tokens from LP to poolclaimnow acceptslpparameter and callstoken.transfer()to compensate LPcalculate_premium_rate_bps(),calculate_premium_amount()get_tiered_coverage()based on premiums paidset_base_premium_rate_bps(),set_risk_multiplier()increment_default_count(),get_default_count()SDK (TypeScript)
claimInsurance()to acceptlpAddressparameterinitializeInsurancePool()with token address parametergetTokenAddress()read methodcalculatePremiumRate()andgetTieredCoverage()read methodsCLI
claimcommand to require--lp <address>optionDocumentation