Developers

Vault manager investment history

List the investor history of a vault you manage.

On this page

URLs and generated code samples on this page: Testnet (chain ID 326). Other code on this page doesn't change: it stays on testnet until you switch it in your code. Tutorials, signing cases and live tools always use testnet.

Only for vault managers. Other accounts get error 1001.

SDKclient.vault_manager_investment_history(...)
HTTPPOST https://trades.testnet.grvt.io/full/v1/vault_manager_investor_history, or /lite/v1/vault_manager_investor_history for lite names (the SDKs' default)
WebSocketmethod v1/vault_manager_investor_history on wss://trades.testnet.grvt.io/ws/full, or /ws/lite for lite names
AuthSession required (Authentication)
RetriesRead: the SDKs retry retryable errors (rules)
Contract idvault.vault_manager_investment_history (RPCVaultManagerInvestmentHistoryV1)

Request

Body type ApiQueryVaultManagerInvestorHistoryRequest. Fields the server fills are left out.

  • vault_idlite name vistring (uint64)required#
    The unique identifier of the vault to filter by
  • only_own_investmentslite name ooboolrequired#
    Whether to only return investments made by the manager
  • start_timelite name ststring (int64 unix ns)optionaldefault 0#
    Optional. Start time in unix nanoseconds
  • end_timelite name etstring (int64 unix ns)optionaldefault now()#
    Optional. End time in unix nanoseconds

Response

Body type ApiQueryVaultManagerInvestorHistoryResponse (the same object is the JSON-RPC result over WebSocket).

resultlite name rarray<ApiVaultInvestorHistory>required#
The list of vault investor history belong to the manager
  • event_timelite name etstring (int64 unix ns)required#
    Time at which the event was emitted in unix nanoseconds
  • off_chain_account_idlite name ocstringrequired#
    The off chain account id of the investor, only visible to the manager
  • vault_idlite name vistring (uint64)required#
    The unique identifier of the vault.
  • typelite name tenum VaultInvestorActionrequired#
    The type of transaction that occurred. List of types: vaultInvest, vaultBurnLpToken, vaultRedeem
    4 values
    UNSPECIFIED, VAULT_INVEST, VAULT_BURN_LP_TOKEN, VAULT_REDEEM (details).
  • pricelite name pstringrequired#
    The price of the vault LP tokens at the time of the event.
  • sizelite name sstringrequired#
    The amount of Vault LP tokens invested or redeemed.
  • realized_pnllite name rpstringrequired#
    The realized PnL of the vault.
  • performance_feelite name pfstringrequired#
    The performance fee of the vault.
  • token_currencylite name tcstringrequired#
    The vault leg's currency: the vault's investment currency, which the vault received or paid. Empty on a burn, which moves no tokens.
  • num_tokenslite name ntstringrequired#
    The vault leg: the tokens of tokenCurrency the vault received on an invest or paid on a redemption. 0 on a burn, and on a vaultRedeem recorded before its results carried the amount.
  • from_currencylite name fcstringrequired#
    The currency that left its owner: on an invest the investor's source currency (the user leg), on a redemption tokenCurrency. A row without conversion has the vault leg's currency. Empty on a burn.
  • from_num_tokenslite name fnstringrequired#
    The tokens of fromCurrency that left their owner: on an invest what the investor paid (the user leg), on a redemption numTokens. 0 on a burn, and on a vaultRedeem recorded before its results carried the amount.
  • to_currencylite name tc1stringrequired#
    The currency that reached its owner: on a redemption the investor's payout currency (the user leg), on an invest tokenCurrency. A row without conversion has the vault leg's currency. Empty on a burn.
  • to_num_tokenslite name tnstringrequired#
    The tokens of toCurrency that reached their owner: on a redemption what the investor received (the user leg), on an invest numTokens. 0 on a burn, and on a vaultRedeem recorded before its results carried the amount.
  • conversion_fee_num_tokenslite name cfstringrequired#
    The conversion fee in toCurrency: the difference between the two legs of a converting invest or redemption. 0 without conversion.
  • from_sub_account_idlite name fsstring (uint64)required#
    The trading sub-account an invest was paid from. 0 for the funding account and on other rows.
  • from_wallet_typelite name fwenum WalletTyperequired#
    The wallet an invest was paid from: FUNDING for the funding account, otherwise SPOT or FUTURES. Unspecified on redemptions and burns.
    3 values
    FUNDING, SPOT, FUTURES (details).
  • request_timelite name rtstring (int64 unix ns)required#
    On a redemption, when its redemption request was made, in unix nanoseconds. 0 when unknown and on other rows.

Errors

Errors come back as {"code", "message", "status"} (lite {"c", "m", "s"}) with the HTTP status. Codes this call can return (all error codes):

8 errors any call can return; none specific to this one
1000Unauthorized401
You need to authenticate prior to using this functionality
1001Forbidden403
You are not authorized to access this functionality
1002InternalServer500
Internal Server Error
1003InvalidRequest400
Request could not be processed due to malformed syntax
1006RateLimit429retryable
You have surpassed the allocated rate limit for your tier
1008IPNotWhitelisted401
Your IP has not been whitelisted for access
1014GatewayTimeout504retryable
Upstream data service timed out, please try again
1015ServiceUnavailable503retryable
Upstream data service is temporarily unavailable, please try again

Example

Example code
import os

from grvt import Grvt

with Grvt(
    env=os.environ.get("GRVT_ENV", "testnet"),
    api_key=os.environ["GRVT_API_KEY"],
) as client:
    resp = client.vault_manager_investment_history(
        vault_id="2312134",
        only_own_investments=True,
    )
    print(resp)

Raw HTTP (set GRVT_DOMAIN, see Environments; GRVT_COOKIE and GRVT_ACCOUNT_ID come from login):

With full field names:

curl -sS "https://trades.testnet.grvt.io/full/v1/vault_manager_investor_history" \
  -H "Content-Type: application/json" \
  -H "Cookie: gravity=$GRVT_COOKIE" \
  -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
  --data @- <<EOF
{
  "vault_id": "2312134",
  "only_own_investments": true
}
EOF

With lite field names:

curl -sS "https://trades.testnet.grvt.io/lite/v1/vault_manager_investor_history" \
  -H "Content-Type: application/json" \
  -H "Cookie: gravity=$GRVT_COOKIE" \
  -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
  --data @- <<EOF
{
  "vi": "2312134",
  "oo": true
}
EOF
Build request
esc

↑ ↓ move↵ open⇧↵ open .mdTry an error code like 2002

Keyboard shortcuts

⌘ K
Search the docs
/
Search
l
Next code language (Python → TypeScript → Go → Rust → curl → WebSocket)
j / k
Next / previous page
t
Light / dark theme
?
This help
Esc
Close dialogs and drawers