Skip to content

feat: add partial fill support for src_amount - #155

Merged
james2177 merged 2 commits into
stellar-vortex-protocol:mainfrom
favvy994:feature/50-partial-fill-support
Jul 28, 2026
Merged

feat: add partial fill support for src_amount#155
james2177 merged 2 commits into
stellar-vortex-protocol:mainfrom
favvy994:feature/50-partial-fill-support

Conversation

@favvy994

Copy link
Copy Markdown
Contributor

Summary

Allows solvers to partially fill an intent's src_amount rather than requiring an all-or-nothing fill. Large intents in thin liquidity conditions can now be completed incrementally by one or more solvers.

Changes

  • Added PartiallyFilled variant to IntentState
  • Added total_filled: i128 field to IntentRecord to track cumulative fills
  • fill_intent accepts any positive fill_amount; transitions to PartiallyFilled when total_filled < min_dst_amount, re-opening the intent for the next solver
  • Intent transitions to Filled once total_filled >= min_dst_amount
  • Protocol fee applied per individual fill for consistent accounting
  • slash_solver preserves PartiallyFilled state on re-open when partial progress exists
  • expire_intent and cancel_intent extended to handle PartiallyFilled intents

Validation

  • All 58 tests pass (cargo test)
  • cargo fmt and cargo clippy -- -D warnings clean

Closes #50

Closes stellar-vortex-protocol#50

- Add PartiallyFilled state to IntentState
- Add total_filled field to IntentRecord to track cumulative fills
- fill_intent now accepts any positive amount; intent transitions to
  PartiallyFilled when total_filled < min_dst_amount, re-opening it
  so another solver can claim and deliver the remainder
- Intent transitions to Filled once total_filled >= min_dst_amount
- Protocol fee applied per individual fill for consistent accounting
- slash_solver preserves PartiallyFilled state when re-opening an intent
  that already has partial progress
- expire_intent and cancel_intent now also apply to PartiallyFilled intents
- Replace fill_below_minimum_fails test (no longer valid) with
  fill_zero_amount_fails; add three partial-fill lifecycle tests
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

@james2177
james2177 merged commit 9bb0d29 into stellar-vortex-protocol:main Jul 28, 2026
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.

Add partial fill support for src_amount

2 participants