Summary
The sell flow should apply an optimistic update to the holdings cache immediately on submission, decrementing the held quantity. Unit tests should confirm the decrement is applied correctly, that the entry is removed when the result reaches zero, and that the update is rolled back on failure.
Scope
- Seed the cache with a holding of 3 keys for a creator
- Submit a sell of 2 keys and assert the cache shows 1 key remaining
- Submit a sell of 1 key (the last) and assert the holding entry is removed from the cache
- Simulate a failure on the second sell and assert the cache is restored to 2 keys
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
The sell flow should apply an optimistic update to the holdings cache immediately on submission, decrementing the held quantity. Unit tests should confirm the decrement is applied correctly, that the entry is removed when the result reaches zero, and that the update is rolled back on failure.
Scope
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram