VaultInvestV3 (signed message)
EIP-712 type VaultInvestV3: fields, type hash and how each field is built from the request JSON.
On this page
Agent prompt
Write a function that signs a Grvt `VaultInvestV3` message {using} and checks it against the signing test cases.
Target environment: Testnet (chain ID 326). Recorded signing cases keep their original environment.
Validate new flows on testnet with test funds before using production.
Read this first: {origin}/bundle/reference/signing/VaultInvestV3.md (~29 KB, plain Markdown: this page plus the AGENTS.md rules, Signing, Environments).
Fetch other pages from the index at {origin}/llms.txt only as you need them. {origin}/downloads/contract.json is a machine-readable contract for tools, not for reading.
Rules: follow AGENTS.md; do not send requests without the user asking you to; read credentials from environment variables; never retry writes automatically; show me the code and how to run it. 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 field | Type | From request | Transform |
|---|---|---|---|
vaultID | uint64 | vault_id | copy |
accountID | address | none: result. of funding_account_summary | mainAccount: your main account address, fetched once per session |
fromSubAccountID | uint64 | from_sub_account_id | copy; absent = 0 |
fromWalletType | uint8 | from_wallet_type | enumCode: integer value of WalletType |
fromCurrency | uint16 | from_currency | currencyId: id of the currency (get_currency) |
fromNumTokens | uint64 | from_num_tokens | scaled: decimal × 10^balance_decimals of the currency |
toCurrency | uint16 | to_currency | currencyId: id of the currency (get_currency) |
exchangeRate | uint64 | exchange_rate | scaled: decimal × 10^9 |
nonce | uint32 | signature.nonce | sig.nonce |
expiration | int64 | signature. | sig.expiration |
domain chainId | uint256 | signature.chain_id | sig.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. Digest0x5e28c5a2d5e01a4b43ef7200c727c0d9864bb5f252ebf484386d5b486f43ba44.