Get Earn Position
curl --request POST \
--url https://tars.loopscale.com/v1/markets/earn/vaults/positions \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"wallet": "<string>"
}
'import requests
url = "https://tars.loopscale.com/v1/markets/earn/vaults/positions"
payload = {
"address": "<string>",
"wallet": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({address: '<string>', wallet: '<string>'})
};
fetch('https://tars.loopscale.com/v1/markets/earn/vaults/positions', 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/earn/vaults/positions",
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([
'address' => '<string>',
'wallet' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://tars.loopscale.com/v1/markets/earn/vaults/positions"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/earn/vaults/positions")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/earn/vaults/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"<string>\",\n \"wallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"openWithdrawalRequests": [
{
"earnVaultAddress": "<string>",
"onChainRequestAddr": "<string>",
"requestedAt": "<string>",
"sharesClaimed": "<string>",
"sharesFilled": "<string>",
"sharesRequested": "<string>",
"status": 1,
"userWallet": "<string>",
"cancelledAt": "<string>",
"fulfilledAt": "<string>"
}
],
"vault": {
"acceptedAssetMint": "<string>",
"address": "<string>",
"cancelEnabled": true,
"createdAt": "<string>",
"instantEnabled": true,
"managerAuthority": "<string>",
"metadataJson": {},
"parsedAccountJson": {},
"providerKind": 1,
"queueEnabled": true,
"requiresAcknowledgment": true,
"shareMint": "<string>",
"status": 1,
"lastUpdatedSlot": "<string>",
"lastUpdatedTs": "<string>",
"latestSnapshot": {
"navPerShareE18": "<string>",
"pendingWithdrawalsAssets": "<string>",
"shareSupply": "<string>",
"snapshotSlot": "<string>",
"snapshotTs": "<string>",
"totalAumAssets": "<string>",
"displayApyBps": 123,
"leverageX100": 1,
"realizedApyBps24h": 123,
"realizedApyBps30d": 123,
"realizedApyBps7d": 123,
"realizedReturnBps24h": 123,
"realizedReturnBps30d": 123,
"realizedReturnBps7d": 123,
"rewardsApyBps": 123,
"utilizationBps": 1
}
},
"position": {
"costBasisAssets": "<string>",
"earnVaultAddress": "<string>",
"feesPaidAssets": "<string>",
"lastSyncedSlot": "<string>",
"realizedPnlAssets": "<string>",
"shareBalance": "<string>",
"userWallet": "<string>",
"acknowledgedAt": "<string>"
}
}{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}Earn Vaults
Get Earn Position
Returns a wallet’s position in one Earn vault: share balance, cost basis and realized PnL, plus its open withdrawal requests. Use openWithdrawalRequests[].onChainRequestAddr as the requestId for claiming or cancelling a queued withdrawal.
POST
/
markets
/
earn
/
vaults
/
positions
Get Earn Position
curl --request POST \
--url https://tars.loopscale.com/v1/markets/earn/vaults/positions \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"wallet": "<string>"
}
'import requests
url = "https://tars.loopscale.com/v1/markets/earn/vaults/positions"
payload = {
"address": "<string>",
"wallet": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({address: '<string>', wallet: '<string>'})
};
fetch('https://tars.loopscale.com/v1/markets/earn/vaults/positions', 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/earn/vaults/positions",
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([
'address' => '<string>',
'wallet' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://tars.loopscale.com/v1/markets/earn/vaults/positions"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/earn/vaults/positions")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"wallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tars.loopscale.com/v1/markets/earn/vaults/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"<string>\",\n \"wallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"openWithdrawalRequests": [
{
"earnVaultAddress": "<string>",
"onChainRequestAddr": "<string>",
"requestedAt": "<string>",
"sharesClaimed": "<string>",
"sharesFilled": "<string>",
"sharesRequested": "<string>",
"status": 1,
"userWallet": "<string>",
"cancelledAt": "<string>",
"fulfilledAt": "<string>"
}
],
"vault": {
"acceptedAssetMint": "<string>",
"address": "<string>",
"cancelEnabled": true,
"createdAt": "<string>",
"instantEnabled": true,
"managerAuthority": "<string>",
"metadataJson": {},
"parsedAccountJson": {},
"providerKind": 1,
"queueEnabled": true,
"requiresAcknowledgment": true,
"shareMint": "<string>",
"status": 1,
"lastUpdatedSlot": "<string>",
"lastUpdatedTs": "<string>",
"latestSnapshot": {
"navPerShareE18": "<string>",
"pendingWithdrawalsAssets": "<string>",
"shareSupply": "<string>",
"snapshotSlot": "<string>",
"snapshotTs": "<string>",
"totalAumAssets": "<string>",
"displayApyBps": 123,
"leverageX100": 1,
"realizedApyBps24h": 123,
"realizedApyBps30d": 123,
"realizedApyBps7d": 123,
"realizedReturnBps24h": 123,
"realizedReturnBps30d": 123,
"realizedReturnBps7d": 123,
"rewardsApyBps": 123,
"utilizationBps": 1
}
},
"position": {
"costBasisAssets": "<string>",
"earnVaultAddress": "<string>",
"feesPaidAssets": "<string>",
"lastSyncedSlot": "<string>",
"realizedPnlAssets": "<string>",
"shareBalance": "<string>",
"userWallet": "<string>",
"acknowledgedAt": "<string>"
}
}{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}{
"error": {
"code": 400,
"message": "Request could not be processed."
}
}Response
The vault, the wallet's position and its open withdrawal requests
Open withdrawal requests for this user + vault.
Show child attributes
Show child attributes
Earn vault account (DB projection of the on-chain/provider state).
Show child attributes
Show child attributes
User's earn position (share balance, cost basis, realized PnL).
Show child attributes
Show child attributes