Preview opening a leveraged position (deterministic, no wallet)
curl --request POST \
--url https://api.spiralstake.xyz/v1/partner/leverage/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategyId": "<string>",
"payToken": "<string>",
"amount": "<string>",
"leverage": 123,
"desiredLtv": "<string>",
"slippage": 123
}
'import requests
url = "https://api.spiralstake.xyz/v1/partner/leverage/simulate"
payload = {
"strategyId": "<string>",
"payToken": "<string>",
"amount": "<string>",
"leverage": 123,
"desiredLtv": "<string>",
"slippage": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
strategyId: '<string>',
payToken: '<string>',
amount: '<string>',
leverage: 123,
desiredLtv: '<string>',
slippage: 123
})
};
fetch('https://api.spiralstake.xyz/v1/partner/leverage/simulate', 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://api.spiralstake.xyz/v1/partner/leverage/simulate",
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([
'strategyId' => '<string>',
'payToken' => '<string>',
'amount' => '<string>',
'leverage' => 123,
'desiredLtv' => '<string>',
'slippage' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.spiralstake.xyz/v1/partner/leverage/simulate"
payload := strings.NewReader("{\n \"strategyId\": \"<string>\",\n \"payToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"leverage\": 123,\n \"desiredLtv\": \"<string>\",\n \"slippage\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.spiralstake.xyz/v1/partner/leverage/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategyId\": \"<string>\",\n \"payToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"leverage\": 123,\n \"desiredLtv\": \"<string>\",\n \"slippage\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spiralstake.xyz/v1/partner/leverage/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"strategyId\": \"<string>\",\n \"payToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"leverage\": 123,\n \"desiredLtv\": \"<string>\",\n \"slippage\": 123\n}"
response = http.request(request)
puts response.read_body{
"path": "<string>",
"isDirect": true,
"isReallocate": true,
"positionPreview": {
"leverage": "3.0",
"requestedLtv": "66.67",
"effectiveLtv": "66.73",
"amountLeveragedCollateral": "<string>",
"expectedLeverageApy": "5.64",
"priceImpactPct": "0.07"
},
"amountFlashLoan": "<string>",
"minTokenOut": "<string>",
"reallocationFeeWei": "<string>",
"slippage": 123,
"note": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}Partner
Preview opening a leveraged position (deterministic, no wallet)
POST
/
v1
/
partner
/
leverage
/
simulate
Preview opening a leveraged position (deterministic, no wallet)
curl --request POST \
--url https://api.spiralstake.xyz/v1/partner/leverage/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategyId": "<string>",
"payToken": "<string>",
"amount": "<string>",
"leverage": 123,
"desiredLtv": "<string>",
"slippage": 123
}
'import requests
url = "https://api.spiralstake.xyz/v1/partner/leverage/simulate"
payload = {
"strategyId": "<string>",
"payToken": "<string>",
"amount": "<string>",
"leverage": 123,
"desiredLtv": "<string>",
"slippage": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
strategyId: '<string>',
payToken: '<string>',
amount: '<string>',
leverage: 123,
desiredLtv: '<string>',
slippage: 123
})
};
fetch('https://api.spiralstake.xyz/v1/partner/leverage/simulate', 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://api.spiralstake.xyz/v1/partner/leverage/simulate",
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([
'strategyId' => '<string>',
'payToken' => '<string>',
'amount' => '<string>',
'leverage' => 123,
'desiredLtv' => '<string>',
'slippage' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.spiralstake.xyz/v1/partner/leverage/simulate"
payload := strings.NewReader("{\n \"strategyId\": \"<string>\",\n \"payToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"leverage\": 123,\n \"desiredLtv\": \"<string>\",\n \"slippage\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.spiralstake.xyz/v1/partner/leverage/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategyId\": \"<string>\",\n \"payToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"leverage\": 123,\n \"desiredLtv\": \"<string>\",\n \"slippage\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spiralstake.xyz/v1/partner/leverage/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"strategyId\": \"<string>\",\n \"payToken\": \"<string>\",\n \"amount\": \"<string>\",\n \"leverage\": 123,\n \"desiredLtv\": \"<string>\",\n \"slippage\": 123\n}"
response = http.request(request)
puts response.read_body{
"path": "<string>",
"isDirect": true,
"isReallocate": true,
"positionPreview": {
"leverage": "3.0",
"requestedLtv": "66.67",
"effectiveLtv": "66.73",
"amountLeveragedCollateral": "<string>",
"expectedLeverageApy": "5.64",
"priceImpactPct": "0.07"
},
"amountFlashLoan": "<string>",
"minTokenOut": "<string>",
"reallocationFeeWei": "<string>",
"slippage": 123,
"note": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"correlationId": "<string>",
"details": "<unknown>"
}
}Authorizations
Partner API key: Authorization: Bearer <key>.
Body
application/json
Morpho market id (from /v1/strategies).
Token to pay in. Collateral (direct) or any token (zapped). ETH = zero address.
Amount of payToken in human units, e.g. '10000'.
Target leverage (e.g. 3). Provide this OR desiredLtv.
Target LTV percent (e.g. '66.67'). Provide this OR leverage.
Ratio, default 0.005, capped at 0.01.
Available options:
1, 4663 ⌘I