Documentation
¶
Overview ¶
Package pancakeswap wraps the PancakeSwap V3 subgraph on BNB Chain. Same role as the uniswap client but for BSC sources — fills priceUsd / liquidity / primaryPoolAddr on each AssetSource issued on BNB. PancakeSwap V3's subgraph forks Uniswap V3's so the GraphQL schema lines up; only derivedETH → derivedBNB differs.
As of 2026 PancakeSwap publishes the V3 BSC subgraph at
https://api.studio.thegraph.com/query/45376/pancakeswap-v3-bsc/version/latest
— open access, no key. The Graph gateway also serves it behind a key; either URL is valid (pass via NewClient).
Index ¶
Constants ¶
const DefaultSubgraphURL = "https://api.studio.thegraph.com/query/45376/pancakeswap-v3-bsc/version/latest"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
ID string `json:"id"`
FeeTier string `json:"feeTier"`
Liquidity string `json:"liquidity"`
TotalValueLockedUSD string `json:"totalValueLockedUSD"`
Token0 struct {
Symbol string `json:"symbol"`
ID string `json:"id"`
} `json:"token0"`
Token1 struct {
Symbol string `json:"symbol"`
ID string `json:"id"`
} `json:"token1"`
}
type TokenInfo ¶
type TokenInfo struct {
ID string `json:"id"`
Symbol string `json:"symbol"`
Decimals string `json:"decimals"`
DerivedBNB string `json:"derivedBNB"` // string-encoded decimal
TotalValueLockedUSD string `json:"totalValueLockedUSD"` // string-encoded decimal
VolumeUSD string `json:"volumeUSD"`
WhitelistPools []*Pool `json:"whitelistPools,omitempty"`
}
TokenInfo mirrors Uniswap's TokenInfo shape — PancakeSwap V3's subgraph schema is forked from Uniswap V3 so field semantics are identical (derivedBNB instead of derivedETH for the chain-native quote, but the rest line up).