Repository navigation
Price CATs that trade on Forge when Dexie has no price for them - #892
Closed
awizardxch wants to merge 1 commit into
Closed
awizardxch wants to merge 1 commit into
awizardxch wants to merge 1 commit into
Conversation
Sage prices CATs from Dexie's v3/prices/tickers, which Dexie builds from offers completed on Dexie. A token that trades only through Forge's pools never appears there, so Sage shows it with no value. Forge now serves its own ticker list in Dexie's shape (/api/v1/prices/tickers): one ticker per CAT, the mid price of its deepest XCH pool, and none from a pool below a depth floor (1 XCH on mainnet, 0.01 on testnet) so a near-empty pool cannot set a displayed value. Sage fetches both lists in parallel. Dexie stays primary: Forge only fills tokens Dexie has no last price for, and either source failing leaves the other in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing for now: we need to settle the hosting for a price feed (caching, stable domain) before proposing it. Will reopen or replace it when that's in place. |
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.
Problem
Sage prices CATs from Dexie's
v3/prices/tickers, which Dexie builds from offers completed on Dexie. A token that trades only through Forge's AMM pools never appears in that list, so Sage shows it with no value however actively it trades. On testnet today Dexie's list holds 4 tokens.Change
Forge serves its own ticker list in Dexie's exact shape at
/api/v1/prices/tickers:last_priceis XCH per whole token, the mid price of the token's deepest XCH pool, with weighted pools priced by their weights.source: "forge",pool_id,depth_xch,state_as_of. The endpoint is public, read-only and answers any origin.PriceContextfetches Dexie and Forge in parallel withPromise.allSettled:last_price(orask) for.forgeApiUrl(path, isTestnet)is added tosrc/lib/urls.tsbeside the Dexie and MintGarden helpers.Merge behavior, checked in a browser engine:
tsc -p tsconfig.app.json,eslintandprettierpass on the touched files.Draft until the Forge endpoint is live on both networks. The hosts are Forge's routers (
forge-ui-production.up.railway.appfor mainnet,forge-responder.up.railway.appfor testnet), kept in one function so a custom domain is a one-line change.🤖 Generated with Claude Code