curl --request POST \
--url https://tars.loopscale.com/v1/markets/creditbook/repay_simple \
--header 'Content-Type: application/json' \
--header 'payer: <payer>' \
--data '
{
"loan": "<string>",
"repayParams": {
"amount": 123,
"ledgerIndex": 123,
"repayAll": true
},
"strategy": "<string>",
"weightMatrixUpdates": [
{
"weightMatrixUpdate": [
123
],
"collateralIndex": 123
}
],
"isLoop": true
}
'import requests
url = "https://tars.loopscale.com/v1/markets/creditbook/repay_simple"
payload = {
"loan": "<string>",
"repayParams": {
"amount": 123,
"ledgerIndex": 123,
"repayAll": True
},
"strategy": "<string>",
"weightMatrixUpdates": [
{
"weightMatrixUpdate": [123],
"collateralIndex": 123
}
],
"isLoop": True
}
headers = {
"payer": "<payer>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {payer: '<payer>', 'Content-Type': 'application/json'},
body: JSON.stringify({
loan: '<string>',
repayParams: {amount: 123, ledgerIndex: 123, repayAll: true},
strategy: '<string>',
weightMatrixUpdates: [{weightMatrixUpdate: [123], collateralIndex: 123}],
isLoop: true
})
};
fetch('https://tars.loopscale.com/v1/markets/creditbook/repay_simple', 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/creditbook/repay_simple",
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([
'loan' => '<string>',
'repayParams' => [
'amount' => 123,
'ledgerIndex' => 123,
'repayAll' => true
],
'strategy' => '<string>',
'weightMatrixUpdates' => [
[
'weightMatrixUpdate' => [
123
],
'collateralIndex' => 123
]
],
'isLoop' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"payer: <payer>"
],
]);
$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/creditbook/repay_simple"
payload := strings.NewReader("{\n \"loan\": \"<string>\",\n \"repayParams\": {\n \"amount\": 123,\n \"ledgerIndex\": 123,\n \"repayAll\": true\n },\n \"strategy\": \"<string>\",\n \"weightMatrixUpdates\": [\n {\n \"weightMatrixUpdate\": [\n 123\n ],\n \"collateralIndex\": 123\n }\n ],\n \"isLoop\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("payer", "<payer>")
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/creditbook/repay_simple")
.header("payer", "<payer>")
.header("Content-Type", "application/json")
.body("{\n \"loan\": \"<string>\",\n \"repayParams\": {\n \"amount\": 123,\n \"ledgerIndex\": 123,\n \"repayAll\": true\n },\n \"strategy\": \"<string>\",\n \"weightMatrixUpdates\": [\n {\n \"weightMatrixUpdate\": [\n 123\n ],\n \"collateralIndex\": 123\n }\n ],\n \"isLoop\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/creditbook/repay_simple")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["payer"] = '<payer>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loan\": \"<string>\",\n \"repayParams\": {\n \"amount\": 123,\n \"ledgerIndex\": 123,\n \"repayAll\": true\n },\n \"strategy\": \"<string>\",\n \"weightMatrixUpdates\": [\n {\n \"weightMatrixUpdate\": [\n 123\n ],\n \"collateralIndex\": 123\n }\n ],\n \"isLoop\": true\n}"
response = http.request(request)
puts response.read_body{
"transactions": [
{
"message": "<string>",
"signatures": [
{
"publicKey": "<string>",
"signature": "<string>"
}
]
}
],
"expectedLoanInfo": {
"loan": {
"address": "<string>"
}
}
}"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."Simple repay loan
A simplified repay endpoint that handles a single strategy at a time. Unlike the full repay endpoint, it does not support CPI instructions, collateral withdrawals, or setup instructions. If a ledger is fully repaid on a multi-ledger loan, weight matrix updates are automatically generated to redistribute collateral away from the emptied ledger.
curl --request POST \
--url https://tars.loopscale.com/v1/markets/creditbook/repay_simple \
--header 'Content-Type: application/json' \
--header 'payer: <payer>' \
--data '
{
"loan": "<string>",
"repayParams": {
"amount": 123,
"ledgerIndex": 123,
"repayAll": true
},
"strategy": "<string>",
"weightMatrixUpdates": [
{
"weightMatrixUpdate": [
123
],
"collateralIndex": 123
}
],
"isLoop": true
}
'import requests
url = "https://tars.loopscale.com/v1/markets/creditbook/repay_simple"
payload = {
"loan": "<string>",
"repayParams": {
"amount": 123,
"ledgerIndex": 123,
"repayAll": True
},
"strategy": "<string>",
"weightMatrixUpdates": [
{
"weightMatrixUpdate": [123],
"collateralIndex": 123
}
],
"isLoop": True
}
headers = {
"payer": "<payer>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {payer: '<payer>', 'Content-Type': 'application/json'},
body: JSON.stringify({
loan: '<string>',
repayParams: {amount: 123, ledgerIndex: 123, repayAll: true},
strategy: '<string>',
weightMatrixUpdates: [{weightMatrixUpdate: [123], collateralIndex: 123}],
isLoop: true
})
};
fetch('https://tars.loopscale.com/v1/markets/creditbook/repay_simple', 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/creditbook/repay_simple",
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([
'loan' => '<string>',
'repayParams' => [
'amount' => 123,
'ledgerIndex' => 123,
'repayAll' => true
],
'strategy' => '<string>',
'weightMatrixUpdates' => [
[
'weightMatrixUpdate' => [
123
],
'collateralIndex' => 123
]
],
'isLoop' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"payer: <payer>"
],
]);
$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/creditbook/repay_simple"
payload := strings.NewReader("{\n \"loan\": \"<string>\",\n \"repayParams\": {\n \"amount\": 123,\n \"ledgerIndex\": 123,\n \"repayAll\": true\n },\n \"strategy\": \"<string>\",\n \"weightMatrixUpdates\": [\n {\n \"weightMatrixUpdate\": [\n 123\n ],\n \"collateralIndex\": 123\n }\n ],\n \"isLoop\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("payer", "<payer>")
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/creditbook/repay_simple")
.header("payer", "<payer>")
.header("Content-Type", "application/json")
.body("{\n \"loan\": \"<string>\",\n \"repayParams\": {\n \"amount\": 123,\n \"ledgerIndex\": 123,\n \"repayAll\": true\n },\n \"strategy\": \"<string>\",\n \"weightMatrixUpdates\": [\n {\n \"weightMatrixUpdate\": [\n 123\n ],\n \"collateralIndex\": 123\n }\n ],\n \"isLoop\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/creditbook/repay_simple")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["payer"] = '<payer>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"loan\": \"<string>\",\n \"repayParams\": {\n \"amount\": 123,\n \"ledgerIndex\": 123,\n \"repayAll\": true\n },\n \"strategy\": \"<string>\",\n \"weightMatrixUpdates\": [\n {\n \"weightMatrixUpdate\": [\n 123\n ],\n \"collateralIndex\": 123\n }\n ],\n \"isLoop\": true\n}"
response = http.request(request)
puts response.read_body{
"transactions": [
{
"message": "<string>",
"signatures": [
{
"publicKey": "<string>",
"signature": "<string>"
}
]
}
],
"expectedLoanInfo": {
"loan": {
"address": "<string>"
}
}
}"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
Wallet that pays transaction fees for the repay transaction.
Body
Address of the loan to repay.
Repayment parameters for the targeted ledger.
Show child attributes
Show child attributes
Address of the strategy (vault) to repay against.
Optional weight matrix updates. If omitted and a ledger is fully repaid on a multi-ledger loan, these are auto-generated.
Show child attributes
Show child attributes
Optional flag indicating whether this repayment is part of a loop transaction.