Preview an allocation for a wallet without automatic rebalancing
curl --request POST \
--url https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allocations": [
{
"from": "cash:base:usdc",
"to": "morpho-gauntlet-usdc",
"amountUsd": "1000.000000"
}
]
}
'import requests
url = "https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview"
payload = { "allocations": [
{
"from": "cash:base:usdc",
"to": "morpho-gauntlet-usdc",
"amountUsd": "1000.000000"
}
] }
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({
allocations: [{from: 'cash:base:usdc', to: 'morpho-gauntlet-usdc', amountUsd: '1000.000000'}]
})
};
fetch('https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview', 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://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview",
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([
'allocations' => [
[
'from' => 'cash:base:usdc',
'to' => 'morpho-gauntlet-usdc',
'amountUsd' => '1000.000000'
]
]
]),
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://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview"
payload := strings.NewReader("{\n \"allocations\": [\n {\n \"from\": \"cash:base:usdc\",\n \"to\": \"morpho-gauntlet-usdc\",\n \"amountUsd\": \"1000.000000\"\n }\n ]\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://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allocations\": [\n {\n \"from\": \"cash:base:usdc\",\n \"to\": \"morpho-gauntlet-usdc\",\n \"amountUsd\": \"1000.000000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview")
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 \"allocations\": [\n {\n \"from\": \"cash:base:usdc\",\n \"to\": \"morpho-gauntlet-usdc\",\n \"amountUsd\": \"1000.000000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"positions": [
{
"id": "cash:base:usdc",
"label": "USDC Cash",
"beforeUsd": "2500.000000",
"afterUsd": "1500.000000",
"deltaUsd": "-1000.000000"
},
{
"id": "morpho-gauntlet-usdc",
"label": "Morpho Gauntlet USDC Prime",
"beforeUsd": "0.000000",
"afterUsd": "1000.000000",
"deltaUsd": "1000.000000"
}
]
}{
"error": "<string>"
}{
"error": "Unauthenticated request",
"message": "Missing or invalid bearer token"
}{
"error": "Portfolio wallet not found",
"code": "wallet_not_found"
}{
"error": "This wallet has autoRebalance set to true. Use PATCH /v2/wallets/{id}/strategy instead.",
"code": "operation_not_supported"
}{
"error": "Rate limit exceeded",
"code": "rate_limited"
}{
"error": "Internal server error",
"code": "internal_error"
}Wallets
Preview wallet allocation
Validates explicit dollar movements and returns each affected position’s value before and after. This endpoint is read-only.
POST
/
v2
/
wallets
/
{id}
/
allocate-preview
Preview an allocation for a wallet without automatic rebalancing
curl --request POST \
--url https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allocations": [
{
"from": "cash:base:usdc",
"to": "morpho-gauntlet-usdc",
"amountUsd": "1000.000000"
}
]
}
'import requests
url = "https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview"
payload = { "allocations": [
{
"from": "cash:base:usdc",
"to": "morpho-gauntlet-usdc",
"amountUsd": "1000.000000"
}
] }
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({
allocations: [{from: 'cash:base:usdc', to: 'morpho-gauntlet-usdc', amountUsd: '1000.000000'}]
})
};
fetch('https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview', 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://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview",
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([
'allocations' => [
[
'from' => 'cash:base:usdc',
'to' => 'morpho-gauntlet-usdc',
'amountUsd' => '1000.000000'
]
]
]),
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://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview"
payload := strings.NewReader("{\n \"allocations\": [\n {\n \"from\": \"cash:base:usdc\",\n \"to\": \"morpho-gauntlet-usdc\",\n \"amountUsd\": \"1000.000000\"\n }\n ]\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://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allocations\": [\n {\n \"from\": \"cash:base:usdc\",\n \"to\": \"morpho-gauntlet-usdc\",\n \"amountUsd\": \"1000.000000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.groundtech.co/v2/wallets/{id}/allocate-preview")
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 \"allocations\": [\n {\n \"from\": \"cash:base:usdc\",\n \"to\": \"morpho-gauntlet-usdc\",\n \"amountUsd\": \"1000.000000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"positions": [
{
"id": "cash:base:usdc",
"label": "USDC Cash",
"beforeUsd": "2500.000000",
"afterUsd": "1500.000000",
"deltaUsd": "-1000.000000"
},
{
"id": "morpho-gauntlet-usdc",
"label": "Morpho Gauntlet USDC Prime",
"beforeUsd": "0.000000",
"afterUsd": "1000.000000",
"deltaUsd": "1000.000000"
}
]
}{
"error": "<string>"
}{
"error": "Unauthenticated request",
"message": "Missing or invalid bearer token"
}{
"error": "Portfolio wallet not found",
"code": "wallet_not_found"
}{
"error": "This wallet has autoRebalance set to true. Use PATCH /v2/wallets/{id}/strategy instead.",
"code": "operation_not_supported"
}{
"error": "Rate limit exceeded",
"code": "rate_limited"
}{
"error": "Internal server error",
"code": "internal_error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Wallet ID
Body
application/json
Explicit dollar movements between wallet positions and eligible yield sources.
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
Allocation preview
Minimum array length:
2Show child attributes
Show child attributes
⌘I