LFJ Router API (1.0.0)

Download OpenAPI specification:

LFJ Router Public API: [email protected] URL: https://router-api.lfj.dev License: Apache 2.0

Discover DeFi with LFJ, a leading decentralized exchange. Trade a wide variety of tokens, earn rewards, and engage in secure, peer-to-peer transactions. LFJ makes DeFi easy and accessible.

(Required) add http request header x-lfj-api-key: {your-key}

Get routes for a token swap

One of amountIn or amountOut is required. Exact out calculation is not supported by some aggregators.

path Parameters
chain
required
string
Value: "avalanche"

Chain identifier

agg
required
string
Enum: "flytrade" "jar" "kyber" "odos" "okx"

Aggregator identifier

query Parameters
tokenIn
required
string

Input token address

tokenOut
required
string

Output token address

amountIn
string

Input token amount

amountOut
string

Output token amount

Responses

Response samples

Content type
application/json
{
  • "tokenIn": {
    },
  • "tokenOut": {
    },
  • "amountIn": "string",
  • "amountOut": "string",
  • "aggregator": "string"
}

Get transaction data for a token swap

path Parameters
chain
required
string
Value: "avalanche"

Chain identifier

agg
required
string
Enum: "flytrade" "jar" "kyber" "odos" "okx"

Aggregator identifier

query Parameters
tokenIn
required
string

Input token address

tokenOut
required
string

Output token address

amountIn
required
string

Input token amount

userAddress
required
string

User's wallet address

slippageBps
required
integer <= 10000

Maximum slippage tolerance in basis points (1 bps = 0.01%)

feeBps
required
integer <= 10000

Fee in basis points (1 bps = 0.01%). Fees can be charged on either the input or output token.

tokenInFeeRecipientAddress
string

Fee recipient's wallet address. Required if fee is taken from the input token.

tokenOutFeeRecipientAddress
string

Fee recipient's wallet address. Required if fee is taken from the output token.

Responses

Response samples

Content type
application/json
{
  • "from": "string",
  • "to": "string",
  • "data": "string",
  • "value": "string",
  • "gas": "string",
  • "gasPrice": "string",
  • "amountIn": "string",
  • "amountOut": "string"
}

Health check

Responses