SetSubAccountPositionMarginConfig (signed message)
EIP-712 type SetSubAccountPositionMarginConfig: 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 `SetSubAccountPositionMarginConfig` 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/SetSubAccountPositionMarginConfig.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 set_position_config. Step-by-step walkthrough: Signing.
SetSubAccountPositionMarginConfig(uint64 subAccountID,uint256 asset,uint8 marginType,int32 leverage,uint32 nonce,int64 expiration)
Type hash 0x75673028b3d75e3ec43589ed8a9291dbea56da6886c45d05efafc68a4ae51395. Domain {name: "GRVT Exchange", version: "0", chainId}.
Fields and where they come from
| EIP-712 field | Type | From request | Transform |
|---|---|---|---|
subAccountID | uint64 | sub_account_id | copy |
asset | uint256 | instrument | assetKey: the instrument's instrument_hash as uint256 |
marginType | uint8 | margin_type | enumCode: integer value of PositionMarginType |
leverage | int32 | leverage | scaled: decimal × 10^6 |
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:
set_position_config— Isolated margin at 10x leverage on BTC_USDT_Perp; leverage has 6 decimals. Digest0x33634cb8359ac37c5c6d24e8763dfd3c97a26cde9351ea384bbf45f1c0394cb0.