Developers

VaultInvestV3 (signed message)

EIP-712 type VaultInvestV3: fields, type hash and how each field is built from the request JSON.

On this page

Signed by vault_invest. Step-by-step walkthrough: Signing.

VaultInvestV3(uint64 vaultID,address accountID,uint64 fromSubAccountID,uint8 fromWalletType,uint16 fromCurrency,uint64 fromNumTokens,uint16 toCurrency,uint64 exchangeRate,uint32 nonce,int64 expiration)

Type hash 0x9310afe005ecc1260bf9be1863d1fde16bed5d7be16ed68926ddf67cd10a736e. Domain {name: "GRVT Exchange", version: "0", chainId}.

Fields and where they come from

EIP-712 fieldTypeFrom requestTransform
vaultIDuint64vault_idcopy
accountIDaddressnone: result.main_account_id of funding_account_summarymainAccount: your main account address, fetched once per session
fromSubAccountIDuint64from_sub_account_idcopy; absent = 0
fromWalletTypeuint8from_wallet_typeenumCode: integer value of WalletType
fromCurrencyuint16from_currencycurrencyId: id of the currency (get_currency)
fromNumTokensuint64from_num_tokensscaled: decimal × 10^balance_decimals of the currency
toCurrencyuint16to_currencycurrencyId: id of the currency (get_currency)
exchangeRateuint64exchange_ratescaled: decimal × 10^9
nonceuint32signature.noncesig.nonce
expirationint64signature.expirationsig.expiration
domain chainIduint256signature.chain_idsig.chainId

Signing test cases

In signing.json, signed by the public test key:

  • vault_invest — Invest 1000.5 USDT from the funding account into a vault whose investment currency is USDC, at 0.9998 USDC per USDT. accountID is the session's main account (metadata main_account_id); from_num_tokens uses USDT's decimals and exchange_rate 9. Digest 0x5e28c5a2d5e01a4b43ef7200c727c0d9864bb5f252ebf484386d5b486f43ba44.
Sign the example in your browser
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