Skip to main content
POST
/
clients
/
me
/
integrations
/
lifi
/
quote
Get a Li.Fi swap/bridge quote
curl --request POST \
  --url https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fromChain": "<string>",
  "toChain": "<string>",
  "fromToken": "<string>",
  "toToken": "<string>",
  "fromAmount": "<string>",
  "fromAddress": "<string>",
  "toAddress": "<string>",
  "fromAmountForGas": "<string>",
  "integrator": "<string>",
  "fee": 123,
  "maxPriceImpact": 123,
  "slippage": 123,
  "referrer": "<string>",
  "allowBridges": [
    "<string>"
  ],
  "denyBridges": [
    "<string>"
  ],
  "preferBridges": [
    "<string>"
  ],
  "allowExchanges": [
    "<string>"
  ],
  "denyExchanges": [
    "<string>"
  ],
  "preferExchanges": [
    "<string>"
  ],
  "svmSponsor": "<string>"
}
'
import requests

url = "https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote"

payload = {
    "fromChain": "<string>",
    "toChain": "<string>",
    "fromToken": "<string>",
    "toToken": "<string>",
    "fromAmount": "<string>",
    "fromAddress": "<string>",
    "toAddress": "<string>",
    "fromAmountForGas": "<string>",
    "integrator": "<string>",
    "fee": 123,
    "maxPriceImpact": 123,
    "slippage": 123,
    "referrer": "<string>",
    "allowBridges": ["<string>"],
    "denyBridges": ["<string>"],
    "preferBridges": ["<string>"],
    "allowExchanges": ["<string>"],
    "denyExchanges": ["<string>"],
    "preferExchanges": ["<string>"],
    "svmSponsor": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    fromChain: '<string>',
    toChain: '<string>',
    fromToken: '<string>',
    toToken: '<string>',
    fromAmount: '<string>',
    fromAddress: '<string>',
    toAddress: '<string>',
    fromAmountForGas: '<string>',
    integrator: '<string>',
    fee: 123,
    maxPriceImpact: 123,
    slippage: 123,
    referrer: '<string>',
    allowBridges: ['<string>'],
    denyBridges: ['<string>'],
    preferBridges: ['<string>'],
    allowExchanges: ['<string>'],
    denyExchanges: ['<string>'],
    preferExchanges: ['<string>'],
    svmSponsor: '<string>'
  })
};

fetch('https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'fromChain' => '<string>',
    'toChain' => '<string>',
    'fromToken' => '<string>',
    'toToken' => '<string>',
    'fromAmount' => '<string>',
    'fromAddress' => '<string>',
    'toAddress' => '<string>',
    'fromAmountForGas' => '<string>',
    'integrator' => '<string>',
    'fee' => 123,
    'maxPriceImpact' => 123,
    'slippage' => 123,
    'referrer' => '<string>',
    'allowBridges' => [
        '<string>'
    ],
    'denyBridges' => [
        '<string>'
    ],
    'preferBridges' => [
        '<string>'
    ],
    'allowExchanges' => [
        '<string>'
    ],
    'denyExchanges' => [
        '<string>'
    ],
    'preferExchanges' => [
        '<string>'
    ],
    'svmSponsor' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote"

	payload := strings.NewReader("{\n  \"fromChain\": \"<string>\",\n  \"toChain\": \"<string>\",\n  \"fromToken\": \"<string>\",\n  \"toToken\": \"<string>\",\n  \"fromAmount\": \"<string>\",\n  \"fromAddress\": \"<string>\",\n  \"toAddress\": \"<string>\",\n  \"fromAmountForGas\": \"<string>\",\n  \"integrator\": \"<string>\",\n  \"fee\": 123,\n  \"maxPriceImpact\": 123,\n  \"slippage\": 123,\n  \"referrer\": \"<string>\",\n  \"allowBridges\": [\n    \"<string>\"\n  ],\n  \"denyBridges\": [\n    \"<string>\"\n  ],\n  \"preferBridges\": [\n    \"<string>\"\n  ],\n  \"allowExchanges\": [\n    \"<string>\"\n  ],\n  \"denyExchanges\": [\n    \"<string>\"\n  ],\n  \"preferExchanges\": [\n    \"<string>\"\n  ],\n  \"svmSponsor\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"fromChain\": \"<string>\",\n  \"toChain\": \"<string>\",\n  \"fromToken\": \"<string>\",\n  \"toToken\": \"<string>\",\n  \"fromAmount\": \"<string>\",\n  \"fromAddress\": \"<string>\",\n  \"toAddress\": \"<string>\",\n  \"fromAmountForGas\": \"<string>\",\n  \"integrator\": \"<string>\",\n  \"fee\": 123,\n  \"maxPriceImpact\": 123,\n  \"slippage\": 123,\n  \"referrer\": \"<string>\",\n  \"allowBridges\": [\n    \"<string>\"\n  ],\n  \"denyBridges\": [\n    \"<string>\"\n  ],\n  \"preferBridges\": [\n    \"<string>\"\n  ],\n  \"allowExchanges\": [\n    \"<string>\"\n  ],\n  \"denyExchanges\": [\n    \"<string>\"\n  ],\n  \"preferExchanges\": [\n    \"<string>\"\n  ],\n  \"svmSponsor\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.portalhq.io/api/v3/clients/me/integrations/lifi/quote")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"fromChain\": \"<string>\",\n  \"toChain\": \"<string>\",\n  \"fromToken\": \"<string>\",\n  \"toToken\": \"<string>\",\n  \"fromAmount\": \"<string>\",\n  \"fromAddress\": \"<string>\",\n  \"toAddress\": \"<string>\",\n  \"fromAmountForGas\": \"<string>\",\n  \"integrator\": \"<string>\",\n  \"fee\": 123,\n  \"maxPriceImpact\": 123,\n  \"slippage\": 123,\n  \"referrer\": \"<string>\",\n  \"allowBridges\": [\n    \"<string>\"\n  ],\n  \"denyBridges\": [\n    \"<string>\"\n  ],\n  \"preferBridges\": [\n    \"<string>\"\n  ],\n  \"allowExchanges\": [\n    \"<string>\"\n  ],\n  \"denyExchanges\": [\n    \"<string>\"\n  ],\n  \"preferExchanges\": [\n    \"<string>\"\n  ],\n  \"svmSponsor\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "rawResponse": {}
  }
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

Client API Key or Client Session Token (CST). Pass as a Bearer token in the Authorization header.

Body

application/json
fromChain
string
required

Source chain ID in CAIP-2 format (e.g. eip155:1).

toChain
string
required

Destination chain ID in CAIP-2 format (e.g. eip155:137).

fromToken
string
required

Source token address or symbol.

toToken
string
required

Destination token address or symbol.

fromAmount
string
required

Amount to swap in the smallest unit of the source token.

fromAddress
string
required

Sender address. Must be a valid address for the source chain.

toAddress
string

Recipient address. Defaults to fromAddress when omitted.

fromAmountForGas
string

Amount of the source token to swap into destination-chain gas before bridging.

integrator
string

Override the integrator identifier for this request.

fee
number

Integrator fee as a decimal (e.g. 0.005 for 0.5%).

maxPriceImpact
number

Maximum acceptable price impact as a decimal.

order
enum<string>

Route ordering preference.

Available options:
RECOMMENDED,
FASTEST,
CHEAPEST
slippage
number

Maximum slippage as a decimal (e.g. 0.01 for 1%).

referrer
string

Referrer address for fee attribution.

allowBridges
string[]

Bridges to include.

denyBridges
string[]

Bridges to exclude.

preferBridges
string[]

Bridges to prefer when ranking routes.

allowExchanges
string[]

Exchanges to include.

denyExchanges
string[]

Exchanges to exclude.

preferExchanges
string[]

Exchanges to prefer when ranking routes.

svmSponsor
string

Solana (SVM) only. Public key used as the transaction fee payer and the funder for in-route account creation (e.g. the intermediate WSOL account), so a wallet holding no SOL does not fail on rent. When omitted, Portal fills it with the environment's Solana gas sponsor (if enabled) for Solana source chains. Must be a valid Solana address; invalid values fall back to the environment gas sponsor.

Response

Quote retrieved successfully

data
object