Developers

AddIsolatedPositionMargin (signed message)

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

On this page

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 fieldTypeFrom requestTransform
subAccountIDuint64sub_account_idcopy
assetuint256instrumentassetKey: the instrument's instrument_hash as uint256
amountint64amountscaled: decimal × 10^quote_decimals of the instrument
nonceuint32signature.noncesig.nonce
expirationint64signature.expirationsig.expiration
domain chainIduint256signature.chain_idsig.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. Digest 0xb777923ee34033655e0f98d30dc6b5c2813235be0173fd88561c7be0b2a14c50.
  • remove_position_margin — A negative amount removes margin: -100.25 is signed as the int64 -100250000. Digest 0x36780cb75505d0bfdafa27bd962f0436ba813f8f6705a1b53f870f2014225358.
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