curl --request POST \
--url https://core-api-dev.vanish.trade/borrow/commit \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tx_id": "<string>"
}
'import requests
url = "https://core-api-dev.vanish.trade/borrow/commit"
payload = { "tx_id": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tx_id: '<string>'})
};
fetch('https://core-api-dev.vanish.trade/borrow/commit', 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://core-api-dev.vanish.trade/borrow/commit",
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([
'tx_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://core-api-dev.vanish.trade/borrow/commit"
payload := strings.NewReader("{\n \"tx_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://core-api-dev.vanish.trade/borrow/commit")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tx_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api-dev.vanish.trade/borrow/commit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tx_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "pending",
"action_type": "borrow",
"already_processed": true,
"vanish_fee": 123,
"tx_fee": 123,
"balance_changes": [
{
"token_address": "<string>",
"change": "<string>"
}
],
"completed_at": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Commit Lending Action
Resolves a lending or settle action and applies its balance changes once the transaction is confirmed on-chain. Must be called after every /borrow/initiate and /borrow/settle - success, failure, or expiry. Requires no signature, only the API key.
Not interchangeable with POST /commit, which resolves deposits, trades, and withdrawals. See Commit Status.
curl --request POST \
--url https://core-api-dev.vanish.trade/borrow/commit \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"tx_id": "<string>"
}
'import requests
url = "https://core-api-dev.vanish.trade/borrow/commit"
payload = { "tx_id": "<string>" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({tx_id: '<string>'})
};
fetch('https://core-api-dev.vanish.trade/borrow/commit', 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://core-api-dev.vanish.trade/borrow/commit",
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([
'tx_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://core-api-dev.vanish.trade/borrow/commit"
payload := strings.NewReader("{\n \"tx_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://core-api-dev.vanish.trade/borrow/commit")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tx_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api-dev.vanish.trade/borrow/commit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tx_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "pending",
"action_type": "borrow",
"already_processed": true,
"vanish_fee": 123,
"tx_fee": 123,
"balance_changes": [
{
"token_address": "<string>",
"change": "<string>"
}
],
"completed_at": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
Details of the lending commit request.
The transaction signature returned by /borrow/initiate or /borrow/settle
Response
Successful lending commit response.
The result of the commit operation to determine the state of the action and balance. A lending action is only reflected in the user's balance once the status is completed.
pending, completed, failed, expired The type of action that was committed. Indicates whether the operation was a borrow (opening a position) or a settle.
borrow, settle Indicates whether the action had already reached a terminal status before this commit attempt.
The fee amount charged by Vanish, expressed in lamports. Currently always 0 for lending actions.
The transaction fee amount, expressed in lamports.
A list of net per-token balance changes that resulted from the committed action. Null while the action is still pending.
Show child attributes
Show child attributes
Timestamp (ISO 8601 format) indicating when the action reached a terminal state; null while it is still pending.
