AddIsolatedPositionMargin (signed message)
EIP-712 type AddIsolatedPositionMargin: 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 `AddIsolatedPositionMargin` 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/AddIsolatedPositionMargin.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 add_position_margin. Step-by-step walkthrough: Signing.
AddIsolatedPositionMargin(uint64 subAccountID,uint256 asset,int64 amount,uint32 nonce,int64 expiration)
Type hash 0xb6e7c8dc8d7d9fb71fb62ec71807f9a293291545d20d0123cba70b443af79010. 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 |
amount | int64 | amount | scaled: decimal × 10^quote_decimals of the instrument |
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:
add_position_margin— Add 250.5 USDT of isolated margin to the BTC_USDT_Perp position; amount uses the quote currency's decimals. Digest0xb777923ee34033655e0f98d30dc6b5c2813235be0173fd88561c7be0b2a14c50.remove_position_margin— A negative amount removes margin: -100.25 is signed as the int64 -100250000. Digest0x36780cb75505d0bfdafa27bd962f0436ba813f8f6705a1b53f870f2014225358.