Developers

Vault investor summary

Get your investment summary for one vault.

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.

SDKclient.vault_investor_summary(...)
HTTPPOST https://trades.testnet.grvt.io/full/v1/vault_investor_summary, or /lite/v1/vault_investor_summary for lite names (the SDKs' default)
WebSocketmethod v1/vault_investor_summary 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_investor_summary (RPCVaultInvestorSummaryV1)

Request

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

  • vault_idlite name vistring (uint64)optional#
    The unique identifier of the vault to fetch the summary for.

Response

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

vault_investor_summarylite name viarray<VaultInvestorSummary>required#
The summary of investments in the vault.
  • sub_account_idlite name sastring (uint64)required#
    The unique identifier of the vault sub-account.
  • num_lp_tokenslite name nlstringrequired#
    The number of vault LP tokens the investor holds: those in the funding account plus those in every sub-account.
  • avg_entry_pricelite name aestringrequired#
    The average entry price (in USD) of the investor's vault LP tokens: the investor's invested notional divided by numLPTokens.
  • current_pricelite name cpstringrequired#
    The current price (in USD) of the vault LP tokens.
  • total_equitylite name testringrequired#
    The vault's total equity (in USD). The investor's holding is investorEquity.
  • all_time_realized_pnllite name atstringrequired#
    The all-time realized PnL (in USD) that the investor has received from the vault.
  • pending_redemptionlite name probject VaultRedemptionoptional#
    The singleton pending redemption (omitted if none).
    7 fields of VaultRedemption
    • num_lp_tokenslite name nlstringrequired#
      The number of LP Tokens requested for redemption.
    • request_valuationlite name rvstringrequired#
      The valuation (in USD) of the redemption request.
    • request_timelite name rtstring (int64 unix ns)required#
      Set by the server. Time at which the redemption request was received by Grvt in unix nanoseconds
    • max_redemption_period_timestamplite name mrstring (int64 unix ns)required#
      Set by the server. Time in unix nanoseconds, beyond which the request will be force-redeemed.
    • cancel_blockedlite name cbbooloptionaldefault true#
      Omitted for redemption requests to non-cross exchange vaults. True if cancellation is blocked within the CEV allocation allowance for the user's current tier (e.g. because the user has already transferred out the spot balance underlying the redemption request).
    • to_currencylite name tcstringrequired#
      The currency the request pays into the investor's funding account: the vault's investment currency, unless the request converts.
    • exchange_ratelite name erstringrequired#
      The signed rate the request is paid at, to_currency per unit of the vault's investment currency. 1 when the request does not convert.
  • can_burnlite name cbbooloptionaldefault true#
    True if the requesting account is authorized to burn tokens on this vault, omitted otherwise.
  • num_lp_tokens_lockedlite name nl1stringrequired#
    The number of the investor's vault LP tokens still within the vault's minimum investment period.
  • num_lp_tokens_redeemablelite name nl2stringrequired#
    The number of vault LP tokens the investor can request to redeem now: those past the minimum investment period, less any pending redemption.
  • locked_lotslite name llarray<VaultLpLotView>required#
    The investor's vault LP tokens within the minimum investment period, by the time they unlock (earliest first).
    2 fields of VaultLpLotView
    • unlock_timelite name utstring (int64 unix ns)required#
      Time in unix nanoseconds from which these LP tokens can be redeemed.
    • num_lp_tokenslite name nlstringrequired#
      The number of LP tokens in the lot.
  • share_balanceslite name sbobject VaultShareBalancesrequired#
    Where the investor's vault LP tokens sit: the funding account and the sub-accounts.
    5 fields of VaultShareBalances
    • funding_lp_token_balancelite name flstringrequired#
      The vault LP tokens in the funding account, including those a pending redemption reserves.
    • trading_lp_token_balancelite name tlstringrequired#
      The vault LP tokens across all sub-accounts: the sum of tradingBalances.
    • pending_redemption_lp_token_balancelite name prstringrequired#
      The funding account's vault LP tokens a pending redemption reserves.
    • available_to_transferlite name atstringrequired#
      The funding account's vault LP tokens that can move to a sub-account now: fundingLpTokenBalance less pendingRedemptionLpTokenBalance. The minimum investment period does not block transfers. The destination's own checks still apply.
    • currencylite name cstringoptional#
      The vault's share currency, used to transfer its LP tokens. Omitted when the vault has none.
  • trading_balanceslite name tbarray<VaultShareTradingBalance>required#
    One entry per sub-account holding the vault's LP tokens. Empty when no sub-account holds any.
    5 fields of VaultShareTradingBalance
    • sub_account_idlite name sastring (uint64)required#
      The sub-account.
    • num_lp_tokenslite name nlstringrequired#
      The vault LP tokens in the sub-account.
    • equitylite name estringrequired#
      The current valuation (in USD) of the sub-account's vault LP tokens.
    • available_to_transferlite name atstringrequired#
      An estimate of the vault LP tokens that can move back to the funding account without failing the sub-account's withdrawal checks.
    • margin_balance_usdlite name mbstringrequired#
      What the vault LP tokens add to the sub-account's margin (in USD): equity times the collateral value ratio. 0 when they don't count as collateral.
  • investor_equitylite name iestringrequired#
    The current valuation (in USD) of all the investor's vault LP tokens: numLPTokens times currentPrice.
  • unrealized_pnllite name upstringrequired#
    The investor's unrealized PnL (in USD): investorEquity less the investor's invested notional.

Errors

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

7000InvalidVaultID400
Vault ID provided is invalid and does not belong to any vault
7007InvestorNotVaultLP400
The investor is not an LP for this vault.
Plus 8 errors any call can return
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_investor_summary()
    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_investor_summary" \
  -H "Content-Type: application/json" \
  -H "Cookie: gravity=$GRVT_COOKIE" \
  -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
  --data '{}'

With lite field names:

curl -sS "https://trades.testnet.grvt.io/lite/v1/vault_investor_summary" \
  -H "Content-Type: application/json" \
  -H "Cookie: gravity=$GRVT_COOKIE" \
  -H "X-Grvt-Account-Id: $GRVT_ACCOUNT_ID" \
  --data '{}'
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