💠
LI.FI Subgraphs
Use subgraphs to query data about transfers and swaps executed via the LI.FI Smart Contract on all supported chains.
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
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.