Skip to main content
POST
/
markets
/
quote
/
max
Get max quote
curl --request POST \
  --url https://tars.loopscale.com/v1/markets/quote/max \
  --header 'Content-Type: application/json' \
  --header 'user-wallet: <user-wallet>' \
  --data '
{
  "durationType": 123,
  "duration": 123,
  "principalMint": "<string>",
  "collateralFilter": [
    {
      "amount": 123,
      "assetData": {}
    }
  ]
}
'
import requests

url = "https://tars.loopscale.com/v1/markets/quote/max"

payload = {
"durationType": 123,
"duration": 123,
"principalMint": "<string>",
"collateralFilter": [
{
"amount": 123,
"assetData": {}
}
]
}
headers = {
"user-wallet": "<user-wallet>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {'user-wallet': '<user-wallet>', 'Content-Type': 'application/json'},
body: JSON.stringify({
durationType: 123,
duration: 123,
principalMint: '<string>',
collateralFilter: [{amount: 123, assetData: {}}]
})
};

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([
'durationType' => 123,
'duration' => 123,
'principalMint' => '<string>',
'collateralFilter' => [
[
'amount' => 123,
'assetData' => [

]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"user-wallet: <user-wallet>"
],
]);

$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 \"durationType\": 123,\n \"duration\": 123,\n \"principalMint\": \"<string>\",\n \"collateralFilter\": [\n {\n \"amount\": 123,\n \"assetData\": {}\n }\n ]\n}")

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

req.Header.Add("user-wallet", "<user-wallet>")
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("user-wallet", "<user-wallet>")
.header("Content-Type", "application/json")
.body("{\n \"durationType\": 123,\n \"duration\": 123,\n \"principalMint\": \"<string>\",\n \"collateralFilter\": [\n {\n \"amount\": 123,\n \"assetData\": {}\n }\n ]\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["user-wallet"] = '<user-wallet>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"durationType\": 123,\n \"duration\": 123,\n \"principalMint\": \"<string>\",\n \"collateralFilter\": [\n {\n \"amount\": 123,\n \"assetData\": {}\n }\n ]\n}"

response = http.request(request)
puts response.read_body
[
  {
    "apy": 100000,
    "strategy": "9rQ8Q4tMUDhT",
    "collateralIdentifier": "So11111111111111111111111111111111111111112",
    "ltv": 600000,
    "lqt": 800000,
    "amount": 12000000000
  }
]
"Something went wrong: You have an error in your SQL syntax."
"Failed to deserialize the JSON body into the target type: missing field `mints` at line 1 column 1."

Headers

user-wallet
string
required

Wallet address of the requesting user

Body

application/json
durationType
number
required

Duration type enum (0 = days, 1 = weeks, 2 = months, 3 = minutes, 4 = years)

duration
number
required

Number of units of the specified durationType

principalMint
string
required

Token mint address of the principal

collateralFilter
object[]
required

Mapping from collateral mint to detailed collateral metadata

Response

Best matching quote per collateral asset

apy
number

Annualized interest rate in 1/100th of a basis point

strategy
string

Lender who is offering the quote

collateralIdentifier
string

Collateral mint pubkey

ltv
number

Maximum initial loan to value in 1/100th of a basis point

lqt
number

Liquidation loan to value in 1/100th of a basis point

amount
number

Maximum amount that can be borrowed, in lamports

Example:
[
{
"apy": 100000,
"strategy": "9rQ8Q4tMUDhT",
"collateralIdentifier": "So11111111111111111111111111111111111111112",
"ltv": 600000,
"lqt": 800000,
"amount": 12000000000
}
]