Conversation
M4 milestone: the get_prices RPC method (public, no auth). Fetches order book (limit=1), feed history, and dynamic global properties from steemd in parallel via steemgosdk wrappers (GetOrderBook, GetFeedHistory, GetDynamicGlobalProperties — all condenser_api). Then calls steemutil's ComputePrices (int64 + math/big arithmetic) and converts the result to the schema's three float64 fields: steem_sbd: SteemSbd.Asset.Amount / 10^3 (already averaged) steem_usd: SteemUsd.Price.Convert(1 STEEM).Amount / 10^3 steem_vest: SteemVest.Price.Convert(1 STEEM).Amount / 10^6 Note: Go uses int64 math (steemutil design) vs TS float64; may differ in last-digit precision. Documented as acceptable in REWRITE_PLAN. Tests: fixture-based ComputePrices test verifying all three values (0.5 SBD, 0.5 USD, 42000 VESTS) + JSON tag verification. All green.
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.
Summary
M4 milestone — the
conveyor.get_pricesRPC method (public, no auth). Fetches market data from steemd in parallel and computes three price values using steemutil's integer-arithmeticComputePrices.Implementation
GetOrderBook(1)+GetFeedHistory()+GetDynamicGlobalProperties()via goroutines +sync.WaitGroup(matching TSPromise.all)steemutil.ComputePrices(ob, fh, dgp)— int64 + math/big arithmeticsteem_sbd:SteemSbd.Asset.Amount / 10^3(already the averaged conversion)steem_usd:SteemUsd.Price.Convert(1 STEEM).Amount / 10^3(raw Price, needs conversion)steem_vest:SteemVest.Price.Convert(1 STEEM).Amount / 10^6(raw Price, VESTS has 6 decimals)Note on precision
Go uses int64 + math/big (steemutil's design) vs the TS original's float64. May differ in last-digit precision — documented as acceptable in
REWRITE_PLAN.md.Verification
go build ./...✅go vet ./...✅go test ./...✅ — 2 new tests (fixture-based ComputePrices: 0.5 SBD, 0.5 USD, 42000 VESTS + JSON tags) + all M0-M3 tests pass