Skip to main content

Lifinity DEX API

Lifinity Trades in Real-Time​

The below query gets real-time information whenever there's a new trade on the Lifinity DEX including detailed information about the trade, including the buy and sell details, the block information, and the transaction specifics. You can run the query here

subscription {
Solana {
DEXTrades(
where: {Trade: {Dex: {ProtocolFamily: {is: "Lifinity"}}}}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency:Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}

Average Price and Trade Volume of a Token on Lifinity​

Trading parameters like the average and volume are important factors for determining entry and exit points of a trade.

Here is the query to get these parameters for a selected token based on the last 24 hours activity.

query TradeParameters {
Solana {
DEXTrades(
where: {Trade: {Dex: {ProtocolFamily: {is: "Lifinity"}}, Buy: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}, Sell: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Block: {Time: {after: "2024-06-11T00:00:00Z", before: "2024-06-12T00:00:00Z"}}}
) {
Volume: sum(of: Trade_Sell_Amount)
AveragePrice: average(of: Trade_Sell_Price)
}
}
}

Video Tutorial | Average and Trade Volume of a Pair using Bitquery API​