LogoLogo
Join DiscordFollow on XBridge FundsLong $BERA
  • Doc Bros v1
    • Overview
    • Key Features
      • Speed & Liquidity is Key
      • Bropetual Markets
      • A Hub for Berachain DeFi
    • Proof-of-Liquidity
      • Reward Vault
    • Power of Points
    • Partners & Integrations
    • Campaigns
      • bro.trade Em Up
  • bullish bros
    • SuperBros NFT
  • Technicals
    • What is Proof-of-Liquidity?
    • One-Click Trading
    • Funding Rates
  • Liquidations & Insurance Fund
  • Vertex Edge Sequencer
  • Fees
  • PnL Settlements
  • Withdrawals
  • Pricing (Oracles)
  • links & resources
    • bro.trade Links
      • Website
      • Trade Bropetuals
      • Discord
      • X (Twitter)
      • Medium
      • Swap on OogaBooga
    • Berachain Links
      • Berachain.com
      • Official Bridge
      • BeraHub
      • Berascan
      • Bera Discord
      • Berachain X (Twitter)
      • Berachain Docs
    • FAQ
  • developer bros
    • API
      • Gateway
        • Executes
          • Place Order
          • Cancel Order
          • Cancel and Place
          • Cancel Product Order
          • Withdraw Colleteral
          • Transfer Quote
          • Liquidate Subaccount
          • Mint LP
          • Burn LP
          • Link Signer
        • Queries
          • All Products
          • Contracts
          • Fee Rates
          • Health Groups
          • Insurance
          • Linked Signer
          • Market Liquidity
          • Market Prices
          • Max Lp Mintable
          • Max Order Size
          • Max Withdrawable
          • Min Deposit Rates
          • Nonces
          • Order
          • Orders
          • Status
          • Subaccount Info
          • Symbols
        • Signing
          • Examples
          • Q A
      • Subscriptions
        • Authentication
        • Streams
        • Events
        • Rate Limits
      • Archive (indexer)
        • Candlesticks
        • Events
        • Funding Rate
        • Interest Funding Payments
        • Linked Signer Rate Limit
        • Liquidation Feed
        • Maker Statistics
        • Market Snapshots
        • Matches
        • Merkle Proofs
        • Oracle Price
        • Orders
        • Perp Prices
        • Product Snapshots
        • Rewards
        • Signatures
        • Subaccounts
        • Summary
        • HONEY Price
      • Trigger
        • Executes
          • Place Order
          • Cancel Orders
          • Cancel Product Orders
        • Queries
          • List Trigger Orders
      • V2
        • Apr
        • Assets
        • Contracts
        • Orderbook
        • Pairs
        • Tickers
        • Trades
      • Rate limits
      • Errors
      • Symbols
      • Depositing
      • Withdrawing (on-chain)
      • Integrate via Smart Contracts
      • Definitions / Formulas
    • On-Chain Contracts
Powered by GitBook
On this page
  • Domain
  • EIP712 Types
  • Cancel Orders(#cancel-orders)
  • Cancel Product Orders(#cancel-product-orders)
  • Withdraw Collateral**](#withdraw-collateral)
  • Liquidate Subaccount(#liquidate-subaccount)
  • [Mint LP](#mint-lp)
  • [Burn LP](#burn-lp)
  • [Link Signer](#link-signer)
  • [List Trigger Orders](#list-trigger-orders)
  1. developer bros
  2. API
  3. Gateway

Signing

PreviousSymbolsNextExamples

Last updated 2 months ago

All executes are signed using . Each execute request contains:

  1. A piece of structured data that includes the sender address i.e: the primaryType that needs to be signed.

  2. A signature of the hash of that structured data, signed by the sender.

Domain

The following is the domain required as part of the EIP712 structure:

{
    name: 'Vertex',
    version: '0.0.1',
    chainId: chainId,
    verifyingContract: contractAddress
}

You can retrieve the corresponding chain id and verifying contract via the query.

Note: make sure to use the correct verifying contract for each execute:

  • For place order: should use the orderbook address of the corresponding product.

  • For everything else: should use the endpoint address.

See more details in the query page.

EIP712 Types

See below the EIP712 type for each execute:

Place Order**](#place-order)

Primary Type: Order

Solidity struct that needs to be signed:

struct Order {
    bytes32 sender;
    int128 priceX18;
    int128 amount;
    uint64 expiration;
    uint64 nonce;
}

JSON representation:

{
  Order: [
    { name: 'sender', type: 'bytes32' },
    { name: 'priceX18', type: 'int128' },
    { name: 'amount', type: 'int128' },
    { name: 'expiration', type: 'uint64' },
    { name: 'nonce', type: 'uint64' },
  ],
}

Cancel Orders(#cancel-orders)

Primary Type: Cancellation

Solidity struct that needs to be signed:

struct Cancellation {
    bytes32 sender;
    uint32[] productIds;
    bytes32[] digests;
    uint64 nonce;
}

JSON representation:

{
  Cancellation: [
    { name: 'sender', type: 'bytes32' },
    { name: 'productIds', type: 'uint32[]' },
    { name: 'digests', type: 'bytes32[]' },
    { name: 'nonce', type: 'uint64' },
  ],
}

Cancel Product Orders(#cancel-product-orders)

Primary Type: CancellationProducts

Solidity struct that needs to be signed:

struct CancellationProducts {
    bytes32 sender;
    uint32[] productIds;
    uint64 nonce;
}

JSON representation:

{
  CancellationProducts: [
    { name: 'sender', type: 'bytes32' },
    { name: 'productIds', type: 'uint32[]' },
    { name: 'nonce', type: 'uint64' },
  ],
}

Withdraw Collateral**](#withdraw-collateral)

Primary Type: WithdrawCollateral

Solidity struct that needs to be signed:

struct WithdrawCollateral {
    bytes32 sender;
    uint32 productId;
    uint128 amount;
    uint64 nonce;
}

JSON representation:

{
  WithdrawCollateral: [
    { name: 'sender', type: 'bytes32' },
    { name: 'productId', type: 'uint32' },
    { name: 'amount', type: 'uint128' },
    { name: 'nonce', type: 'uint64' },
  ],
}

Liquidate Subaccount(#liquidate-subaccount)

Primary Type: LiquidateSubaccount

Solidity struct that needs to be signed:

struct LiquidateSubaccount {
    bytes32 sender;
    bytes32 liquidatee;
    uint32 productId;
    bool isEncodedSpread;
    int128 amount;
    uint64 nonce;
}

JSON representation:

{
  LiquidateSubaccount: [
    { name: 'sender', type: 'bytes32' },
    { name: 'liquidatee', type: 'bytes32' },
    { name: 'productId', type: 'uint32' },
    { name: 'isEncodedSpread', type: 'bool' },
    { name: 'amount', type: 'int128' },
    { name: 'nonce', type: 'uint64' },
  ],
}

[Mint LP](#mint-lp)

Primary Type: MintLp

Solidity struct that needs to be signed:

struct MintLp {
    bytes32 sender;
    uint32 productId;
    uint128 amountBase;
    uint128 quoteAmountLow;
    uint128 quoteAmountHigh;
    uint64 nonce;
}

JSON representation:

{
  MintLp: [
    { name: 'sender', type: 'bytes32' },
    { name: 'productId', type: 'uint32' },
    { name: 'amountBase', type: 'uint128' },
    { name: 'quoteAmountLow', type: 'uint128' },
    { name: 'quoteAmountHigh', type: 'uint128' },
    { name: 'nonce', type: 'uint64' },
  ],
}

[Burn LP](#burn-lp)

Primary Type: BurnLp

Solidity struct that needs to be signed:

struct BurnLp {
    bytes32 sender;
    uint32 productId;
    uint128 amount;
    uint64 nonce;
}

JSON representation:

{
  BurnLp: [
    { name: 'sender', type: 'bytes32' },
    { name: 'productId', type: 'uint32' },
    { name: 'amount', type: 'uint128' },
    { name: 'nonce', type: 'uint64' },
  ],
}

[Link Signer](#link-signer)

Primary Type: LinkSigner

Solidity struct that needs to be signed:

struct LinkSigner {
    bytes32 sender;
    bytes32 signer;
    uint64 nonce;
}

JSON representation:

{
  LinkSigner: [
    { name: 'sender', type: 'bytes32' },
    { name: 'signer', type: 'bytes32' },
    { name: 'nonce', type: 'uint64' },
  ],
}

[List Trigger Orders](#list-trigger-orders)

Primary Type: ListTriggerOrders

Solidity struct that needs to be signed:

struct ListTriggerOrders {
    bytes32 sender;
    uint64 recvTime;
}

JSON representation:

{
  ListTriggerOrders: [
    { name: 'sender', type: 'bytes32' },
    { name: 'recvTime', type: 'uint64' },
  ],
}

Authenticate Subscription Streams

Primary Type: StreamAuthentication

Struct that needs to be signed:

struct StreamAuthentication {
    bytes32 sender;
    uint64 expiration;
}

JSON representation:

{
  StreamAuthentication: [
    { name: 'sender', type: 'bytes32' },
    { name: 'expiration', type: 'uint64' },
  ],
}
EIP712
contracts
contracts