Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lfg.rich/llms.txt

Use this file to discover all available pages before exploring further.

Use the protocol examples when building bots, dashboards, custom launch pages, trading tools, or wallet integrations.

Protocol Contract Examples

See Viem, Ethers, and Python/Web3.py examples for estimates, buys, sells, borrowing, borrowMore, and repay.

Contract Reference

View deployed contract addresses and ABI pages.

API Reference

Review the public REST API endpoints for tokens, trades, candles, and protocol configuration.

Fetch latest tokens

const res = await fetch('https://lfg.rich/api/bsc/tokens?sort=latest&page=1&limit=20');
const json = await res.json();

if (!json.success) {
  throw new Error('Failed to fetch tokens');
}

console.log(json.data);

Fetch a token and its trades

const tokenAddress = '0x29Ede1E1254419Fe5a3c803fC2b015042075A49A';

const [tokenRes, tradesRes] = await Promise.all([
  fetch(`https://lfg.rich/api/bsc/tokens/${tokenAddress}`),
  fetch(`https://lfg.rich/api/bsc/tokens/${tokenAddress}/trades?page=1&limit=25`)
]);

const token = await tokenRes.json();
const trades = await tradesRes.json();

console.log(token.data);
console.log(trades.data);

Fetch candles

const tokenAddress = '0x29Ede1E1254419Fe5a3c803fC2b015042075A49A';

const res = await fetch(
  `https://lfg.rich/api/bsc/tokens/${tokenAddress}/candles?interval=5m&limit=100`
);

const json = await res.json();
console.log(json.data);

Fetch protocol config

const res = await fetch('https://lfg.rich/api/bsc/tokens/config/contracts');
const json = await res.json();

console.log(json.data);