Developers

SetSubAccountPositionMarginConfig (signed message)

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

On this page

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 fieldTypeFrom requestTransform
subAccountIDuint64sub_account_idcopy
assetuint256instrumentassetKey: the instrument's instrument_hash as uint256
marginTypeuint8margin_typeenumCode: integer value of PositionMarginType
leverageint32leveragescaled: decimal × 10^6
nonceuint32signature.noncesig.nonce
expirationint64signature.expirationsig.expiration
domain chainIduint256signature.chain_idsig.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. Digest 0x33634cb8359ac37c5c6d24e8763dfd3c97a26cde9351ea384bbf45f1c0394cb0.
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