Links
💠

LI.FI Subgraphs

Use subgraphs to query data about transfers and swaps executed via the LI.FI Smart Contract on all supported chains.

Supported Chains

Chain
Chain Key
Playground
Aurora
AUR
URL
Boba
BOB
URL
Harmony
ONE
URL
Fuse
FUS
URL
Moonbeam
MOO
URL
Celo
CEL
URL
Moonriver
MOR
URL
Polygon (MATIC)
POL
URL
Optimism
OPT
URL
Fantom
FTM
URL
Ethereum
ETH
URL
Gnosis (xDAI)
DAI
URL
Binance Smart Chain
BSC
URL
Avalanche
AVA
URL
Arbitrum-One
ARB
URL

Endpoint Format

The endpoint is composed of the base URL and the chain key. Chain keys can be found in the table above. Example for Polygon:
const chainKey = 'pol'
const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-' + chainKey

Usage Examples

const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-pol';
const query = `
query () {
liFiTransfers() {
id
bridge
fromUser {
id
}
fromAddress
}
}`;
const result = await axios.post(url, {
query
});
const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-pol';
const query = `
query () {
liFiTransferDestinationSides() {
id
timestamp
toUser {
id
}
toAddress
}
}`;
const result = await axios.post(url, {
query
});
const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-pol';
const query = `
query () {
liFiSwaps() {
id
timestamp
toUser {
id
}
}
}`;
const result = await axios.post(url, {
query
});
The full type description of the possible GraphQL queries can be viewed by accessing the above-listed URLs in a Browser.