Conversation
…otocol#368, stellar-vortex-protocol#369, stellar-vortex-protocol#370 stellar-vortex-protocol#367 - Exposure-weighted bonding - Add `accepted_notional` exposure tracking to SolverRecord via DataKey::SolverExposure(Address) - Add ExposureExceeded error (code 68) - accept_intent: compute notional at 1.0x weight (oracle-ready), check new_exposure <= bond * coverage_multiplier, persist to SolverExposure - fill_intent: release exposure on fill (full notional on complete fill, proportional on partial) - slash_solver: release unfilled notional on slash - Add get_solver_exposure(solver) -> (used, capacity) view - Add coverage_multiplier field to ProtocolConfig (default 10x) stellar-vortex-protocol#368 - Oracle adapter - New intent_settlement/src/oracle.rs module with SEP-40-compatible OracleAdapterClient interface (lastprice -> Option<PriceData>) - Staleness guard (MAX_PRICE_AGE_SECS = 300s) and deviation guard (MAX_PRICE_DEVIATION_BPS = 200bps) with fail-closed OracleFault enum - Timelocked admin setter: propose_oracle / execute_oracle (48h delay) - get_oracle() view; DataKey::OracleAddr + PendingOracle - Error variants: OraclePriceStale, OraclePriceInvalid, OracleNotConfigured, OracleTimelockNotElapsed, NoPendingOracle stellar-vortex-protocol#369 - Harden claim_backstop_compensation - Eligible states: Slashed OR (Open/PartiallyFilled with slash_cycles > 0) - Per-intent cap: MAX_BACKSTOP_INTENT_BPS (10%) of min_dst_amount - Per-user epoch cap: MAX_BACKSTOP_USER_EPOCH_CLAIM per 24h epoch via DataKey::UserEpochClaim(Address, u64) - Pro-rata when pool is short: payout = min(intent_cap, epoch_remaining, pool) - Idempotent double-claim guard via BackstopClaimed key - Add slash_cycles: u32 field to IntentRecord (incremented in slash_solver) - Collusion analysis: docs/369-backstop-collusion-analysis.md stellar-vortex-protocol#370 - Backstop LP vault - New backstop_vault/ crate (vortex-backstop-vault) - deposit/withdraw with 48h cooldown (deposit-delay front-run protection) - Virtual shares/assets seed at init for inflation-attack resistance - cover(intent_id, amount, recipient): settlement-only, loss socialized - receive_income(amount): routes fee/slash share, increases TotalAssets - Emergency withdrawal-queue mode (set_emergency_mode + process_queued_withdrawal) - get_vault_state() and get_lp_position() views - DataKey::BackstopVault + BackstopVaultShareBps in intent_settlement - backstop_vault_share_bps in ProtocolConfig; slash_solver routes vault share to DataKey::BackstopPool when configured Also fixes all pre-existing compilation errors: - Remove 14 duplicate const declarations (DISPUTE_WINDOW, ARBITER_WINDOW, SLASH_COOLDOWN, CANCEL_COOLDOWN, MAX_BATCH_SIZE, MAX_EXTENSION_DURATION, DEFAULT_MIN_BOND, DEFAULT_FILL_WINDOW, DEFAULT_INTENT_EXPIRY, DEFAULT_PROTOCOL_FEE_BPS, MAX_PROTOCOL_FEE_BPS, MIN_FILL_WINDOW_SECS, MIN_INTENT_EXPIRY_SECS, MIN_BOND_FLOOR) - Add 31 missing DataKey variants (SolverBond, AllowedBondToken, MinBond, SolverIntents, TotalBonded, TokenVolume, TokenFees, FeeDiscountTiers, OpenIntentList, SolverRegistry, SolverRoutes, SolverReputation, PendingUpgrade, MigrationVersion, BidWindowEnabled, BestBid, Arbiter, BackstopPool, BackstopClaimed, SolverExposure, OracleAddr, PendingOracle, UserEpochClaim, BackstopVault, BackstopVaultShareBps, and others) - Add 31 missing Error variants (InvalidConfig, TimelockNotElapsed, NoPendingAdminTransfer, NoPendingDstTokenChange, CancelCooldownNotExpired, AmountTooLarge, ImplausibleDstAmount, MaxActiveIntentsCapReached, BondTokenNotAllowed, ExtensionAlreadyGranted, AlreadyMigrated, BidWindowClosed, BidWindowStillOpen, BidNotHigher, IntentNotBidding, IntentNotFilling, IntentNotDisputed, NotArbiter, ArbiterWindowExpired, DisputeWindowStillOpen, DisputeWindowExpired, DisputeWindowClosed, NoFillEscrowed, NoPendingUpgrade, IntentNotAcceptedForFill, TooManyBondTokens, TooManyRouteEntries, BatchTooLarge, NoDisputeOpen, BackstopPoolEmpty, BackstopAlreadyClaimed, ExposureExceeded) - Add referrer: Option<Address> and slash_cycles: u32 to IntentRecord - Add max_slash_cycles, referral_share_bps, backstop_vault_share_bps, coverage_multiplier to ProtocolConfig - Add missing constants: DEFAULT_MAX_ACTIVE_INTENTS_PER_SOLVER, BID_WINDOW, MAX_BACKSTOP_INTENT_BPS, MAX_BACKSTOP_USER_EPOCH_CLAIM, BACKSTOP_EPOCH_SECS, MAX_WHOLE_UNITS, MAX_REFERRAL_SHARE_BPS, MAX_FILL_HISTORY, etc. - Fix duplicate accept_intent_inner: rename inner body to accept_intent_inner_body - Fix fill_intent_inner: remove duplicate premature token transfer and duplicate fee calculation; add require_proof parameter - Fix slash_solver: replace undefined fee_recipient_share/caller_rebate/caller variables with proper vault-routing logic - Fix set_config: remove stale referral_share_bps guard using undefined var Updates .gitignore: backstop_vault/target/, coverage artifacts (lcov.info, coverage/, tarpaulin-report.html), profiling artifacts (*.profdata, *.profraw), backstop_vault/Cargo.lock
|
@kurehkim334-lang 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! 🚀 |
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.
#367 - Exposure-weighted bonding
accepted_notionalexposure tracking to SolverRecord via DataKey::SolverExposure(Address)#368 - Oracle adapter
#369 - Harden claim_backstop_compensation
#370 - Backstop LP vault
Also fixes all pre-existing compilation errors:
Updates .gitignore: backstop_vault/target/, coverage artifacts (lcov.info, coverage/, tarpaulin-report.html), profiling artifacts (*.profdata, *.profraw), backstop_vault/Cargo.lock
Summary
Related issue
Type of change
Component
vortex-contract)vortex-backend)vortex-frontend)Checklist
Screenshots / notes
CLOSES
closes #367
closes #368
closes #369
closes #370