Get max quote
curl --request POST \
--url https://tars.loopscale.com/v1/markets/quote/max \
--header 'Content-Type: application/json' \
--data '
{
"collateralFilter": [
{
"amount": 1,
"assetData": {
"Spl": {
"mint": "<string>"
}
},
"priceOverride": 123
}
],
"duration": 1,
"durationType": 1,
"principalMint": "<string>",
"excludedExternalYield": [
1
],
"strategyCredit": {}
}
'import requests
url = "https://tars.loopscale.com/v1/markets/quote/max"
payload = {
"collateralFilter": [
{
"amount": 1,
"assetData": { "Spl": { "mint": "<string>" } },
"priceOverride": 123
}
],
"duration": 1,
"durationType": 1,
"principalMint": "<string>",
"excludedExternalYield": [1],
"strategyCredit": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
collateralFilter: [{amount: 1, assetData: {Spl: {mint: '<string>'}}, priceOverride: 123}],
duration: 1,
durationType: 1,
principalMint: '<string>',
excludedExternalYield: [1],
strategyCredit: {}
})
};
fetch('https://tars.loopscale.com/v1/markets/quote/max', 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://tars.loopscale.com/v1/markets/quote/max",
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([
'collateralFilter' => [
[
'amount' => 1,
'assetData' => [
'Spl' => [
'mint' => '<string>'
]
],
'priceOverride' => 123
]
],
'duration' => 1,
'durationType' => 1,
'principalMint' => '<string>',
'excludedExternalYield' => [
1
],
'strategyCredit' => [
]
]),
CURLOPT_HTTPHEADER => [
"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://tars.loopscale.com/v1/markets/quote/max"
payload := strings.NewReader("{\n \"collateralFilter\": [\n {\n \"amount\": 1,\n \"assetData\": {\n \"Spl\": {\n \"mint\": \"<string>\"\n }\n },\n \"priceOverride\": 123\n }\n ],\n \"duration\": 1,\n \"durationType\": 1,\n \"principalMint\": \"<string>\",\n \"excludedExternalYield\": [\n 1\n ],\n \"strategyCredit\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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://tars.loopscale.com/v1/markets/quote/max")
.header("Content-Type", "application/json")
.body("{\n \"collateralFilter\": [\n {\n \"amount\": 1,\n \"assetData\": {\n \"Spl\": {\n \"mint\": \"<string>\"\n }\n },\n \"priceOverride\": 123\n }\n ],\n \"duration\": 1,\n \"durationType\": 1,\n \"principalMint\": \"<string>\",\n \"excludedExternalYield\": [\n 1\n ],\n \"strategyCredit\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/quote/max")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"collateralFilter\": [\n {\n \"amount\": 1,\n \"assetData\": {\n \"Spl\": {\n \"mint\": \"<string>\"\n }\n },\n \"priceOverride\": 123\n }\n ],\n \"duration\": 1,\n \"durationType\": 1,\n \"principalMint\": \"<string>\",\n \"excludedExternalYield\": [\n 1\n ],\n \"strategyCredit\": {}\n}"
response = http.request(request)
puts response.read_body[
{
"amount": 1,
"apy": 1,
"collateralIdentifier": "<string>",
"lqt": 1,
"ltv": 1,
"strategy": "<string>"
}
]{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}Markets
Get best quote
Returns the top quote for each specified collateral asset based on available liquidity. This endpoint is designed for minimizing rate slippage for a borrow with known inputs.
POST
/
markets
/
quote
/
max
Get max quote
curl --request POST \
--url https://tars.loopscale.com/v1/markets/quote/max \
--header 'Content-Type: application/json' \
--data '
{
"collateralFilter": [
{
"amount": 1,
"assetData": {
"Spl": {
"mint": "<string>"
}
},
"priceOverride": 123
}
],
"duration": 1,
"durationType": 1,
"principalMint": "<string>",
"excludedExternalYield": [
1
],
"strategyCredit": {}
}
'import requests
url = "https://tars.loopscale.com/v1/markets/quote/max"
payload = {
"collateralFilter": [
{
"amount": 1,
"assetData": { "Spl": { "mint": "<string>" } },
"priceOverride": 123
}
],
"duration": 1,
"durationType": 1,
"principalMint": "<string>",
"excludedExternalYield": [1],
"strategyCredit": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
collateralFilter: [{amount: 1, assetData: {Spl: {mint: '<string>'}}, priceOverride: 123}],
duration: 1,
durationType: 1,
principalMint: '<string>',
excludedExternalYield: [1],
strategyCredit: {}
})
};
fetch('https://tars.loopscale.com/v1/markets/quote/max', 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://tars.loopscale.com/v1/markets/quote/max",
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([
'collateralFilter' => [
[
'amount' => 1,
'assetData' => [
'Spl' => [
'mint' => '<string>'
]
],
'priceOverride' => 123
]
],
'duration' => 1,
'durationType' => 1,
'principalMint' => '<string>',
'excludedExternalYield' => [
1
],
'strategyCredit' => [
]
]),
CURLOPT_HTTPHEADER => [
"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://tars.loopscale.com/v1/markets/quote/max"
payload := strings.NewReader("{\n \"collateralFilter\": [\n {\n \"amount\": 1,\n \"assetData\": {\n \"Spl\": {\n \"mint\": \"<string>\"\n }\n },\n \"priceOverride\": 123\n }\n ],\n \"duration\": 1,\n \"durationType\": 1,\n \"principalMint\": \"<string>\",\n \"excludedExternalYield\": [\n 1\n ],\n \"strategyCredit\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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://tars.loopscale.com/v1/markets/quote/max")
.header("Content-Type", "application/json")
.body("{\n \"collateralFilter\": [\n {\n \"amount\": 1,\n \"assetData\": {\n \"Spl\": {\n \"mint\": \"<string>\"\n }\n },\n \"priceOverride\": 123\n }\n ],\n \"duration\": 1,\n \"durationType\": 1,\n \"principalMint\": \"<string>\",\n \"excludedExternalYield\": [\n 1\n ],\n \"strategyCredit\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/quote/max")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"collateralFilter\": [\n {\n \"amount\": 1,\n \"assetData\": {\n \"Spl\": {\n \"mint\": \"<string>\"\n }\n },\n \"priceOverride\": 123\n }\n ],\n \"duration\": 1,\n \"durationType\": 1,\n \"principalMint\": \"<string>\",\n \"excludedExternalYield\": [\n 1\n ],\n \"strategyCredit\": {}\n}"
response = http.request(request)
puts response.read_body[
{
"amount": 1,
"apy": 1,
"collateralIdentifier": "<string>",
"lqt": 1,
"ltv": 1,
"strategy": "<string>"
}
]{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}Body
application/json
Show child attributes
Show child attributes
Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0Show child attributes
Show child attributes
Response
Best matching quote per collateral asset
⌘I