feat: add translation blueprints for Soroswap Router and Blend Pool - #385
Merged
Osuochasam merged 1 commit intoJul 26, 2026
Conversation
Soroswap (primary DEX) and Blend (primary lending protocol) generate the majority of DeFi event traffic on Stellar/Soroban but currently render as Cryptic in the feed. Adds two new blueprints following the established pattern (see SDEX/SAC), registered in buildRegistry() with documented mainnet/testnet contract IDs sourced from the soroswap/core and blend-capital/blend-utils deployment manifests. - soroswap-router.ts: handles add/remove liquidity and swap events, whose data payload is a struct (XDR Map) per the real event.rs schema. - blend-pool.ts: handles supply/withdraw/borrow/repay (tuple/Vec-encoded data) plus liquidate, mapped from the real fill_auction(auction_type=0) event emitted for user liquidations. - Adds soroswap/blend namespaces to TranslationMap and all four locales (en/es/fr/zh). - Test fixtures use real stellar-sdk XDR encoders (matching the pattern in decode-map-vec.test.ts) rather than hand-typed hex, since both schemas carry composite (Map/Vec) data payloads. Closes Open-audit-foundation#378 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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 #378
Summary
Implements translation blueprints for the Soroswap Router and Blend Protocol pools—the two primary DeFi event sources on Stellar/Soroban—to translate raw event logs into human-readable descriptions across all four supported languages (
en,es,fr,zh).Key Changes
1. Soroswap Router Blueprint (
lib/translator/blueprints/soroswap-router.ts)swap,add_liquidity, andremove_liquidityevent payloads.event.rsschema.nullfor unrecognized event topics.2. Blend Pool Blueprint (
lib/translator/blueprints/blend-pool.ts)supply,withdraw,borrow,repay(tuple/Vec-encoded payloads), andliquidate(fill_auctionauction_type=0) events.3. Localization & Type Schema (
lib/translator/types.ts&lib/translator/locales/*)soroswapandblendnamespaces toTranslationMap.en.ts,es.ts,fr.ts,zh.ts).4. Registry Integration (
lib/translator/registry.ts)buildRegistry()with official Mainnet and Testnet contract IDs sourced from Soroswap Core and Blend Capital deployment manifests.Verification
npm run lint:registrypassed cleanly.@stellar/stellar-sdkXDR encoders.matches()filtering for contract IDs.nullreturns for unknown event topics.en,es,fr,zh).