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": {
"type": "lifi",
"id": "1a37d20d-c7c2-4db1-a4b5-96b7f1e7d99b:0",
"tool": "relay",
"integrator": "YOUR_INTEGRATOR_ID",
"action": {
"fromChainId": "eip155:8453",
"toChainId": "eip155:42161",
"fromAddress": "0x3fa7bc5cf02f07ed174d124a72fcf8d5276df546",
"toAddress": "0x3fa7bc5cf02f07ed174d124a72fcf8d5276df546",
"slippage": 0.001
},
"estimate": {
"fromAmount": "100000",
"toAmount": "98800",
"toAmountMin": "98500",
"executionDuration": 13,
"approvalAddress": "0x026F252016A7C47CDEf1F05a3Fc9E20C92a49C37",
"feeCosts": [
{
"name": "LIFI Fixed Fee",
"amount": "750",
"percentage": "0.0075",
"included": true,
"feeSplit": {
"lifiFee": "250",
"integratorFee": "500",
"recipients": [
{
"name": "lifi",
"type": "FIXED",
"fee": "250"
},
{
"name": "YOUR_INTEGRATOR_ID",
"type": "FIXED",
"fee": "500"
}
]
}
}
],
"gasCosts": [
{
"type": "SEND",
"estimate": "583000",
"amount": "84535000000000000",
"amountUSD": "0.0018"
}
]
},
"transactionRequest": {
"from": "0x3fa7bc5cf02f07ed174d124a72fcf8d5276df546",
"to": "0x026F252016A7C47CDEf1F05a3Fc9E20C92a49C37",
"value": "0x0",
"data": "0x4c279d6b...",
"chainId": "eip155:8453",
"gasPrice": "0x21c2ac6a00",
"gasLimit": "0x1ad2cc"
}
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}Li.Fi
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.
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": {
"type": "lifi",
"id": "1a37d20d-c7c2-4db1-a4b5-96b7f1e7d99b:0",
"tool": "relay",
"integrator": "YOUR_INTEGRATOR_ID",
"action": {
"fromChainId": "eip155:8453",
"toChainId": "eip155:42161",
"fromAddress": "0x3fa7bc5cf02f07ed174d124a72fcf8d5276df546",
"toAddress": "0x3fa7bc5cf02f07ed174d124a72fcf8d5276df546",
"slippage": 0.001
},
"estimate": {
"fromAmount": "100000",
"toAmount": "98800",
"toAmountMin": "98500",
"executionDuration": 13,
"approvalAddress": "0x026F252016A7C47CDEf1F05a3Fc9E20C92a49C37",
"feeCosts": [
{
"name": "LIFI Fixed Fee",
"amount": "750",
"percentage": "0.0075",
"included": true,
"feeSplit": {
"lifiFee": "250",
"integratorFee": "500",
"recipients": [
{
"name": "lifi",
"type": "FIXED",
"fee": "250"
},
{
"name": "YOUR_INTEGRATOR_ID",
"type": "FIXED",
"fee": "500"
}
]
}
}
],
"gasCosts": [
{
"type": "SEND",
"estimate": "583000",
"amount": "84535000000000000",
"amountUSD": "0.0018"
}
]
},
"transactionRequest": {
"from": "0x3fa7bc5cf02f07ed174d124a72fcf8d5276df546",
"to": "0x026F252016A7C47CDEf1F05a3Fc9E20C92a49C37",
"value": "0x0",
"data": "0x4c279d6b...",
"chainId": "eip155:8453",
"gasPrice": "0x21c2ac6a00",
"gasLimit": "0x1ad2cc"
}
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
application/json
Your LI.FI integrator ID, registered in the LI.FI Portal. Required to collect integrator fees. When omitted, Portal sends its own default integrator and your fee configuration does not apply.
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.
Was this page helpful?