OrderWithBuilderFee (signed message)
EIP-712 type OrderWithBuilderFee: 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 `OrderWithBuilderFee` 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/OrderWithBuilderFee.md (~30 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 create_order, bulk_orders. Step-by-step walkthrough: Signing.
OrderWithBuilderFee(uint64 subAccountID,bool isMarket,uint8 timeInForce,bool postOnly,bool reduceOnly,OrderLeg[] legs,address builder,uint32 builderFee,uint32 nonce,int64 expiration)OrderLeg(uint256 assetID,uint64 contractSize,uint64 limitPrice,bool isBuyingContract)
Type hash 0x6a59e4932070a97495ccc9de30b7309ec82b07156f8cfcbe516d28d226d11028. Domain {name: "GRVT Exchange", version: "0", chainId}.
Fields and where they come from
| EIP-712 field | Type | From request | Transform |
|---|---|---|---|
subAccountID | uint64 | order. | copy |
isMarket | bool | order.is_market | copy; absent = false |
timeInForce | uint8 | order.time_in_force | enumCode: integer value of TimeInForce |
postOnly | bool | order.post_only | copy; absent = false |
reduceOnly | bool | order.reduce_only | copy; absent = false |
legs | OrderLeg[] | order.legs | each: map every element as OrderLeg |
builder | address | order.builder | address |
builderFee | uint32 | order.builder_fee | scaled: decimal × 10^4; absent = 0 |
nonce | uint32 | order. | sig.nonce |
expiration | int64 | order. | sig.expiration |
domain chainId | uint256 | order. | sig.chainId |
Nested OrderLeg (paths relative to each list element):
| EIP-712 field | Type | From element | Transform |
|---|---|---|---|
assetID | uint256 | instrument | assetKey: the instrument's instrument_hash as uint256 |
contractSize | uint64 | size | scaled: decimal × 10^base_decimals of the instrument |
limitPrice | uint64 | limit_price | scaled: decimal × 10^9; absent = 0 |
isBuyingContract | bool | is_buying_asset | copy; absent = false |
Signing test cases
In signing.json, signed by the public test key:
order_with_builder_fee— builder set, so the server verifies OrderWithBuilderFee. builder_fee is scaled with 4 decimals. Digest0x09b6c3c367b5641f38ab3750d2f5dc45325f3e46c15a3b6fe03e92b3ca7942af.bulk_orders,orders[1]— Two orders in one bulk call, each signed on its own with its own nonce: a plain Order and an OrderWithBuilderFee, both on BTC_USDT_Perp (the server requires one asset per bulk call). The cancel list and time_to_live_ms are not signed. Digest0xd37d1ca9d12be0de22990d2a0e74fce73e6c4fb47b2a262b259208acc9dd6481.