Developers

OrderWithBuilderFee (signed message)

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

On this page

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 fieldTypeFrom requestTransform
subAccountIDuint64order.sub_account_idcopy
isMarketboolorder.is_marketcopy; absent = false
timeInForceuint8order.time_in_forceenumCode: integer value of TimeInForce
postOnlyboolorder.post_onlycopy; absent = false
reduceOnlyboolorder.reduce_onlycopy; absent = false
legsOrderLeg[]order.legseach: map every element as OrderLeg
builderaddressorder.builderaddress
builderFeeuint32order.builder_feescaled: decimal × 10^4; absent = 0
nonceuint32order.signature.noncesig.nonce
expirationint64order.signature.expirationsig.expiration
domain chainIduint256order.signature.chain_idsig.chainId

Nested OrderLeg (paths relative to each list element):

EIP-712 fieldTypeFrom elementTransform
assetIDuint256instrumentassetKey: the instrument's instrument_hash as uint256
contractSizeuint64sizescaled: decimal × 10^base_decimals of the instrument
limitPriceuint64limit_pricescaled: decimal × 10^9; absent = 0
isBuyingContractboolis_buying_assetcopy; 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. Digest 0x09b6c3c367b5641f38ab3750d2f5dc45325f3e46c15a3b6fe03e92b3ca7942af.
  • 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. Digest 0xd37d1ca9d12be0de22990d2a0e74fce73e6c4fb47b2a262b259208acc9dd6481.
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