docs(lore-0173): the oracle feed every USD price depends on was never justified - #192
Merged
Merged
Conversation
… justified The Reflector contract address has been a bare constant since ffc07e4 with no ADR behind it. 0048 recorded that four live oracle feeds exist - two other Reflector feeds plus RedStone - and 0039 recorded that we call one of them. Neither records a decision, so alternatives were observed and never evaluated. Also worth stating plainly: Reflector is NOT an official Stellar oracle. SDF does not operate one. SEP-40 is a standard, and 'SEP-40 compliant' reads as endorsement if you are not looking closely. The alternative worth assessing is CALI2BYU (Reflector - Stellar on-chain assets), which keys prices by token contract address rather than global ticker. That answers a different question than ours does, and it bears on the unmarked symbol->issuer assumption in reflector_key_to_identity - 0165 measured 56 other issuers using the code USDC, about which our feed can say nothing. It may also be informative for 0172. Filed now because 0167 is about to snapshot these readings into a forever-retained table. Sanity-checking the source belongs before it becomes permanent history, and it is cheap while the table is still empty. Explicitly not a proposal to switch feeds - the deliverable is a decision on the record.
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.
Raised while walking through the oracle path for 0167. The question "why this contract?" has no answer anywhere in the repo.
A bare constant since
ffc07e4, with no ADR behind it — and there are nine ADRs covering backfill strategy, PK design, the runtime framework and the CH host, but not the single external dependency the entire USD estate rests on.Alternatives were observed, never evaluated
0048 sampled real Soroban events and found four live feeds:
CALI2BYU…LE6MCBKGPWGK…CJZCCAFJZQWS…4DLNCA526Y2N…XUSG0048 records that they exist; 0039 records that we call one. Neither records a decision.
The one worth assessing
CALI2BYU…LE6Mkeys by Stellar token contract address, not global ticker — a materially different question. Our feed says what "USDC the ticker" trades at externally; that one would say what a specific Stellar asset is worth.This bears on an unmarked assumption:
reflector_key_to_identityasserts Reflector'sUSDCmeans USDC at the canonical Circle issuer. Almost certainly right — but 0165 measured 56 other issuers using the codeUSDC, about which our feed can say nothing. No test, no comment marking it as an assumption.It may also be informative for 0172 (USDT/USDC at ~0.14 on SDEX): a Stellar-native oracle would corroborate or contradict the local market, and either answer tells us something.
This is not a proposal to switch. The current feed is plausibly right for a USD reference — you want the real-world dollar value, not a thin local market's opinion. The deliverable is a decision on the record.
Why now
0167 is about to snapshot these readings into a forever-retained table. Sanity-checking the source belongs before it becomes permanent history — and it's cheap while
usd_rateis still empty and unconsumed.Also in scope
REFLECTOR_CONTRACTandSOROBAN_RPC_URLare both overridable, so we have the mechanism to switch and no documented answer to when.oracle_pricesis keyed onoracle_nameand could hold both, but 0167'susd_ratehas no oracle column, so two feeds disagreeing at one timestamp needs a precedence rule first or the snapshot winner is arbitrary.REFLECTOR_DECIMALS = 14is another undocumented external assumption that happens to line up exactly with ourDecimal(38,14).