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>"
}Get a Li.Fi swap/bridge quote
Retrieves a quote for a cross-chain or same-chain swap via Li.Fi, including the transaction request to execute.
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
Client API Key or Client Session Token (CST). Pass as a Bearer token in the Authorization header.
Body
Source chain ID in CAIP-2 format (e.g. eip155:1).
Destination chain ID in CAIP-2 format (e.g. eip155:137).
Source token address or symbol.
Destination token address or symbol.
Amount to swap in the smallest unit of the source token.
Sender address. Must be a valid address for the source chain.
Recipient address. Defaults to fromAddress when omitted.
Amount of the source token to swap into destination-chain gas before bridging.
Override the integrator identifier for this request.
Integrator fee as a decimal (e.g. 0.005 for 0.5%).
Maximum acceptable price impact as a decimal.
Route ordering preference.
RECOMMENDED, FASTEST, CHEAPEST Maximum slippage as a decimal (e.g. 0.01 for 1%).
Referrer address for fee attribution.
Bridges to include.
Bridges to exclude.
Bridges to prefer when ranking routes.
Exchanges to include.
Exchanges to exclude.
Exchanges to prefer when ranking routes.
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
Show child attributes
Show child attributes
Was this page helpful?