Repository navigation
fix(keeper): fetch sequence via getLedgerEntries and honor bps thresholds - #1352
Merged
Merged
Conversation
Refs 1240 fix(keeper): fetch account sequence with getLedgerEntries Stellar RPC has no getAccount method, so every sequence fetch returned "method not found" and set_prices/execute_* failed before signing (SO4-Markets#1241). Encode the keeper account as a LedgerKey::Account, call getLedgerEntries, decode LedgerEntryData::Account.seq_num, and return seq + 1. Integration mocks now serve real account-entry XDR. Refs SO4-Markets#1241 fix(keeper): compare submit thresholds in bps by lookup_key Thresholds were keyed by symbol while prices are keyed by the lowercased stellar address, so every lookup missed and fell back to 0. Even on a hit, a raw 1e30-scaled delta was compared against a bps count (SO4-Markets#1242). Key the map by TokenConfig::lookup_key() and apply |median - last| * 10_000 > |last| * bps with checked math. Add regression tests for a 5 bps move (skipped) and an 11 bps move (submitted). Refs SO4-Markets#1242
|
@Praise14 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.
closes #1241 - Fetch the keeper sequence number via getLedgerEntries using a LedgerKey::Account and decode LedgerEntryData::Account.seq_num; the non-existent getAccount RPC method is gone, and mocks now serve real XDR.
closes #1242 - Look up submit_threshold_bps by TokenConfig::lookup_key() and compare moves relatively (change * 10_000 > |last| * bps, checked); a 5 bps move no longer submits at a 10 bps threshold.
closes #1240 - No change required: CLAUDE.md is already a 146-byte one-line pointer to AGENTS.md on main (commit 061751b), so it is not zero-byte.