Api vault invest v2 request
Request payload for investing in a vault from the funding account or from a trading account, converting the source currency into the vault's investment currency when they differ.
The investor signs VaultInvestV3 over both currencies, the amount and the exchange rate. Without conversion the rate is exactly 1. With conversion it must be at most the rate /vault_conversion_rate returns.
NameLite |
Type | RequiredDefault |
Description |
|---|---|---|---|
vault_idvi |
string | True | The unique identifier of the vault to invest in. |
from_sub_account_idfs |
string | True | The trading account to invest from. 0 means the funding account. |
from_currencyfc |
string | True | The currency debited from the source wallet. |
from_num_tokensfn |
string | True | The amount debited from the source wallet, in fromCurrency. |
to_currencytc |
string | True | The currency the vault receives. This must be the vault's investment currency. |
exchange_rateer |
string | True | The signed rate, toCurrency per unit of fromCurrency, up to 9 decimal places. Exactly 1 when both currencies are the same. |
signatures |
Signature | True | The VaultInvestV3 signature of the investing account.The signer needs the vault investor permission on the main account and, for a trading account source, the transfer permission on that trading account. |
WalletType
| Value | Description |
|---|---|
FUNDING = 1 |
Funding wallet |
SPOT = 2 |
Spot wallet |
FUTURES = 3 |
Futures wallet |
Signature
NameLite |
Type | RequiredDefault |
Description |
|---|---|---|---|
signers |
string | True | The address (public key) of the wallet signing the payload |
rr |
string | True | Signature R |
ss1 |
string | True | Signature S |
vv |
integer | True | Signature V |
expiratione |
string | True | Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days |
noncen |
integer | True | Users can randomly generate this value, used as a signature deconflicting key. ie. You can send the same exact instruction twice with different nonces. When the same nonce is used, the same payload will generate the same signature. Our system will consider the payload a duplicate, and ignore it. Range: 0 to 4,294,967,295 (uint32) |
chain_idci |
string | True | Chain ID used in EIP-712 domain. Zero value fallbacks to GRVT Chain ID. |