💠LI.FI Subgraphs

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.

Supported Chains

ChainChain KeyTransfers PlaygroundFee Collection Playground

Aurora

AUR

Boba

BOB

Harmony

ONE

Fuse

FUS

Moonbeam

MOO

Celo

CEL

Moonriver

MOR

Polygon (MATIC)

POL

Optimism

OPT

Fantom

FTM

Ethereum

ETH

Gnosis (xDAI)

DAI

Binance Smart Chain

BSC

Avalanche

AVA

Arbitrum-One

ARB

Transfers Playground

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-diamond-v2-' + chainKey

Usage Examples

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

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-fee-collection-' + chainKey

Usage Examples

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
});

The full type description of the possible GraphQL queries can be viewed by accessing the above-listed URLs in a Browser.

Last updated