curl --request POST \
--url https://core-api-dev.vanish.trade/borrow/initiate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"smart_wallet_id": 4821,
"user_address": "<string>",
"source_token_address": "<string>",
"amount": "<string>",
"loan_additional_sol": "<string>",
"jito_tip_amount": "<string>",
"main_tx": "<string>",
"timestamp": "<string>",
"user_signature": "<string>"
}
'import requests
url = "https://core-api-dev.vanish.trade/borrow/initiate"
payload = {
"smart_wallet_id": 4821,
"user_address": "<string>",
"source_token_address": "<string>",
"amount": "<string>",
"loan_additional_sol": "<string>",
"jito_tip_amount": "<string>",
"main_tx": "<string>",
"timestamp": "<string>",
"user_signature": "<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({
smart_wallet_id: 4821,
user_address: '<string>',
source_token_address: '<string>',
amount: '<string>',
loan_additional_sol: '<string>',
jito_tip_amount: '<string>',
main_tx: '<string>',
timestamp: '<string>',
user_signature: '<string>'
})
};
fetch('https://core-api-dev.vanish.trade/borrow/initiate', 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/initiate",
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([
'smart_wallet_id' => 4821,
'user_address' => '<string>',
'source_token_address' => '<string>',
'amount' => '<string>',
'loan_additional_sol' => '<string>',
'jito_tip_amount' => '<string>',
'main_tx' => '<string>',
'timestamp' => '<string>',
'user_signature' => '<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/initiate"
payload := strings.NewReader("{\n \"smart_wallet_id\": 4821,\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"main_tx\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<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/initiate")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"smart_wallet_id\": 4821,\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"main_tx\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api-dev.vanish.trade/borrow/initiate")
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 \"smart_wallet_id\": 4821,\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"main_tx\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"action_id": 88213,
"tx_id": "<string>",
"transaction": "<string>",
"jito_bundle_id": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Open Position
Opens a lending position: advances funds from Vanish’s trading accounts into the position’s one-time wallet and runs your own instructions against them in the same transaction. Vanish wraps the unsigned transaction supplied in main_tx, signs it, and simulates it, then either returns the signed transaction for you to broadcast or - if the wrapped transaction exceeds Solana’s size limit - submits a two-transaction Jito bundle itself.
Follow every open with POST /borrow/commit. Requires a signature valid for 10 minutes; see Signing Requests and the Lending Flow.
curl --request POST \
--url https://core-api-dev.vanish.trade/borrow/initiate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"smart_wallet_id": 4821,
"user_address": "<string>",
"source_token_address": "<string>",
"amount": "<string>",
"loan_additional_sol": "<string>",
"jito_tip_amount": "<string>",
"main_tx": "<string>",
"timestamp": "<string>",
"user_signature": "<string>"
}
'import requests
url = "https://core-api-dev.vanish.trade/borrow/initiate"
payload = {
"smart_wallet_id": 4821,
"user_address": "<string>",
"source_token_address": "<string>",
"amount": "<string>",
"loan_additional_sol": "<string>",
"jito_tip_amount": "<string>",
"main_tx": "<string>",
"timestamp": "<string>",
"user_signature": "<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({
smart_wallet_id: 4821,
user_address: '<string>',
source_token_address: '<string>',
amount: '<string>',
loan_additional_sol: '<string>',
jito_tip_amount: '<string>',
main_tx: '<string>',
timestamp: '<string>',
user_signature: '<string>'
})
};
fetch('https://core-api-dev.vanish.trade/borrow/initiate', 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/initiate",
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([
'smart_wallet_id' => 4821,
'user_address' => '<string>',
'source_token_address' => '<string>',
'amount' => '<string>',
'loan_additional_sol' => '<string>',
'jito_tip_amount' => '<string>',
'main_tx' => '<string>',
'timestamp' => '<string>',
'user_signature' => '<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/initiate"
payload := strings.NewReader("{\n \"smart_wallet_id\": 4821,\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"main_tx\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<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/initiate")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"smart_wallet_id\": 4821,\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"main_tx\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core-api-dev.vanish.trade/borrow/initiate")
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 \"smart_wallet_id\": 4821,\n \"user_address\": \"<string>\",\n \"source_token_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"loan_additional_sol\": \"<string>\",\n \"jito_tip_amount\": \"<string>\",\n \"main_tx\": \"<string>\",\n \"timestamp\": \"<string>\",\n \"user_signature\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"action_id": 88213,
"tx_id": "<string>",
"transaction": "<string>",
"jito_bundle_id": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
Details of the request to open a position.
Identifier of the one-time wallet the funds are advanced into, returned by the /borrow/smart-wallet endpoint. Must belong to user_address.
4821
The Solana wallet address of the user opening the position.
The address of the token being advanced into the one-time wallet. Wrapped SOL is normalised to native SOL after the signature check.
The amount to advance into the one-time wallet, expressed in the smallest unit (e.g., lamports for SOL). Must be greater than 0. Can be provided as a string or a number
^[0-9]+$Additional SOL (in lamports) advanced alongside the token, typically used for ATA creation and account initialization. The one-time wallet starts empty, so this is required the first time the position uses a given token: one ATA costs approximately 2039280 lamports. Pass 0 when the wallet already holds enough. Can be provided as a string or a number
^[0-9]+$The amount of Jito tip, expressed in the smallest unit (e.g., lamports for SOL). Only applied when the wrapped transaction overflows Solana's size limit and a two-transaction bundle is used instead, but always required - it is part of the signed message either way. Can be provided as a string or a number
^[0-9]+$Serialized or encoded transaction data carrying your own deposit or open instructions. The transaction must be provided unsigned, with the one-time wallet address set as the signer.
Unix timestamp of when the position was opened (in milliseconds). Must be within 10 minutes of server time. Can be provided as a string or a number
^[0-9]+$A digital signature of 'By signing, I hereby agree to Vanish's Terms of Service and agree to be bound by them (docs.vanish.trade/legal/TOS)
Details: borrow:{smart_wallet_id}:{source_token_address}:{amount}:{loan_additional_sol}:{timestamp}:{jito_tip_amount}', signed by the user's wallet.
Response
Successful lending action response.
Identifier of this lending or settle action.
88213
Transaction signature of the action. Poll it via /borrow/commit.
Base64-encoded signed transaction for you to broadcast. Null when Vanish submitted a Jito bundle instead; always populated for settle.
If the wrapped transaction was too large for a single transaction and Vanish submitted a two-transaction Jito bundle, its bundle ID; otherwise null. When set, there is nothing for you to broadcast. Always null for settle.
