Use subgraphs to query data about transfers and swaps executed via the LI.FI Smart Contract and collected fees by integrators 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-diamond-v2-' + chainKey
const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-diamond-v2-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-diamond-v2-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-diamond-v2-pol';
const query = `
query () {
liFiSwaps() {
id
timestamp
toUser {
id
}
}
}`;
const result = await axios.post(url, {
query
});
Fee Collection Playground
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-fee-collection-' + chainKey
const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-fee-collection-pol';
const query = `
query () {
integrators() {
id
address
tokens {
id
}
}
}`;
const result = await axios.post(url, {
query
});
const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-fee-collection-pol';
const query = `
query () {
tokenBalances() {
id
address
integrator {
id
}
balance
}
}`;
const result = await axios.post(url, {
query
});
const url = 'https://api.thegraph.com/subgraphs/name/lifinance/lifi-fee-collection-pol';
const query = `
query () {
feeCollectionEvents() {
id
integratorFee
integrator{
id
address
}
}
}`;
const result = await axios.post(url, {
query
});