SetDeriskToMaintenanceMarginRatio (signed message)
EIP-712 type SetDeriskToMaintenanceMarginRatio: 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 `SetDeriskToMaintenanceMarginRatio` 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/SetDeriskToMaintenanceMarginRatio.md (~28 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_derisk_mm_ratio. Step-by-step walkthrough: Signing.
SetDeriskToMaintenanceMarginRatio(uint64 subAccountID,uint32 deriskToMaintenanceMarginRatio,uint32 nonce,int64 expiration)
Type hash 0xacb6c1dcd395d10eb0681463bdc0d7dd0a0db302012781039cb1821ab326ed26. 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 |
deriskToMaintenanceMarginRatio | uint32 | ratio | 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_derisk_mm_ratio— Derisk at 1.5x the maintenance margin; ratio has 6 decimals. Only risk checks this signature. Digest0xcdf7cf83641d491b4bf66fe060fa7c308040762a7422ca26e7a78ada1c20c24b.