Account Structure

A wallet owner can register an account on Orderly Network for each builder that is supported. Each wallet owner could thus have multiple accounts (that are not interlinked with each other) registered with Orderly Network.

Account ID

Each account is identified by an account id, which can be calculated by

1

Converting the wallet address to bytes

2

Converting the keccak256 hash of the `brokerId` string to bytes

3

ABI encoding (1) and (2)

4

Converting back to Hex String, the keccak256 hash of the result of (3)

Account Registration

Follow the following steps to register an account on Orderly Network:

1

Choose a valid chain/builder to register the account on

List of chains can be found here and supported builders through Get list of builders API.

2

Check if the wallet is already registered or account exists

Check if the wallet is already registered via this API or if account already exisists via this API.

3

Obtain a registration nonce

Get a nonce from Get Registration Nonce API.

4

Obtain a signature from EIP-712

Sign a message from the wallet in the following format using the EIP-712 standard and obtain the signature.

{
  "brokerId": "woofi_dex",
  "chainId": 80001,
  "timestamp": 1685973017064,
  "registrationNonce": "194528949540"
}

where:

NameTypeRequiredDescription
brokerIdstringYBuilder ID
chainIdintYChain ID of registering chain (within those that are supported by the Network)
timestamptimestampYtimestamp in UNIX milliseconds
registrationNoncestringYValid nonce from Get Registration Nonce
5

Register account

Send all the necessary information via Register account API.

Full example