Skip to content

fix(keeper): fetch sequence via getLedgerEntries and honor bps thresholds - #1352

Merged
SteffQing merged 1 commit into
SO4-Markets:mainfrom
Praise14:main
Oct 21, 2026
Merged

SteffQing merged 1 commit into
SO4-Markets:mainfrom
Praise14:main

Conversation

@Praise14

Copy link
Copy Markdown
Contributor

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.

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
@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants