Replace starter GraphQL schema with SO4 protocol entities#189
Merged
Conversation
Decode transfer from/to/account as case-sensitive StrKey values instead of lowercasing them, so app filters match the real on-chain accounts. Emit the contract as its canonical C... StrKey to line up with config contract ids and the decoded addresses, and read the guaranteed event txHash directly so every MarketTokenTransfer records its transaction hash (now a required field).
|
@0xsteins is attempting to deploy a commit to the Ijai's projects Team on Vercel. A member of the Team first needs to authorize it. |
20 tasks
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
closes #182
Replaces the starter SubQuery schema (generic accounts, payments, credits,
debits, transfers) with SO4 protocol entities modelling markets, pools,
orders, positions, fees, referrals, and protocol events, and aligns the
indexer mappings with the new transfer entity.
Closes #<ISSUE_NUMBER>
What changed
Schema (
apps/s03-indexer/schema.graphql)ProtocolContract,Token,Market,MarketConfigSnapshot.Deposit,Withdrawal,PoolBalanceSnapshot,MarketTokenTransfer— covering create / execute / cancel.Order(create / update / freeze / execute /cancel),
Position,PositionChange(increase / decrease / close),Liquidation,AdlEvent.FeeClaim,UiFeeAccrual,FundingFeeClaim,ReferralCode,TraderReferral,ReferralOwnershipTransfer.account,market,key,status,ledger,timestamp, andtransaction-hash fields for app filtering.
deltas) stored as
String/BigIntto preserve precision — neverdowncast to JS numbers.
(
mkt_new,dep_*,wth_*,ord_*,pos_*,liq_*,adl_*, fee /referral events, token / faucet activity).
MarketTokenTransfer.Mappings (
apps/s03-indexer/src/mappings/mappingHandlers.ts)handleEventnow writesMarketTokenTransferfrom token / market-tokentransfer events, keeping amounts as decoded strings.
from/to/account(no lowercasing) so app filters match realon-chain accounts.
C...StrKey so it lines up with theconfigured contract ids and the decoded addresses.
txHashdirectly;transactionHashis now arequired field on
MarketTokenTransfer.Verification
bun run --cwd apps/s03-indexer codegen
bun run --cwd apps/s03-indexer build
Generated
src/typesandproject.yamlare gitignored per projectconvention (regenerated via the bun scripts), so they are not committed.