Vertex Docs
  • Getting Started
    • 📋Overview
    • 📜Table of Contents
    • 🚀Mission
    • ⚔️Vertex Edge
      • 1️⃣Vertex on Arbitrum
      • 2️⃣Blitz on Blast
        • Blitz Documentation
      • 3️⃣Vertex on Mantle
        • 🎆Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • 🖥️Open-Source Contracts
        • 🔌API
      • 4️⃣Vertex on Sei
        • 💰Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • 🖥️On-Chain Contracts
        • 🔌API
      • 5️⃣Vertex on Base
        • 💰Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • 💻Onchain Contracts
        • 🔌API
        • ✍️Create a Coinbase Smart Wallet
      • 6️⃣Vertex on Sonic
        • 💰Trading Rewards
        • 📊Perpetual & Spot Market Specifications
        • ⛓️On-Chain Contracts
        • 🔌API
      • 7️⃣Vertex on Abstract
        • 📊Market Specifications
        • ⛓️On-Chain Contracts
        • 🔌API
      • 8️⃣Bro.Trade on Berachain
        • ⛓️On-Chain Contracts
        • 🔌API
      • 9️⃣Vertex on Avalanche
        • 💰Trading Rewards
        • 📊Market Specifications
        • ⛓️On-Chain Contracts
        • 🔌API
  • Basics
    • 📽️Products
    • ⚡Technical Architecture
    • 🧵Universal Cross Margin
    • ✂️Isolated Margin
    • ℹ️Subaccounts & Health
    • ⏰Liquidations & Insurance Fund
    • 💵PnL Settlements
    • 📊Pricing (Oracles)
    • 💰Fees
    • 📈Funding Rates
    • 📅Market Specifications
    • ⚡One-Click Trading
    • 🔫Trigger Orders
    • 🗂️GMCI 30 & MEME Indices
    • 💰Trade & Earn
      • 🤝Maker Program
      • 🔁Cross-Chain VRTX Rewards
      • ❓Trading Rewards - FAQs
    • 🧑‍🤝‍🧑Referral Program
    • ⚒️Resources & Links
    • ❔FAQs
  • VRTX Token
    • 🎓VRTX Tokenomics
    • 📊Token Supply Distribution
  • More
    • 🌐Glossary
    • 🔬Contracts & Code Audits
    • 🦋Bug Bounties
    • 💽Data & Research
    • 🪟Maintenance Windows
    • 🏁Terms of Use
    • ✍️Statement of Risk
    • 🌍Restricted Territories
    • 📸Brand Assets
  • Tutorials
    • 🏁Quick Start
    • 🖱️One-Click Trading
    • ⚙️Trading Basics
    • ♾️Perpetuals
    • 🔮Spot
    • 🧑‍🤝‍🧑Multiple Accounts
    • 🔫TP/SL & Stop-Market
    • 💰Withdrawals
    • ⚡Fast Withdrawals
    • 🌉Cross-Chain Deposits
    • 🔄Lend, Borrow & Repay
    • ❤️Margin Health
    • 💧Pools
    • 💫VRTX Staking
    • ↔️Switching Chains
    • 🪙Trading Rewards
    • ✂️Shortcuts
  • Developer Resources
    • API
      • 🔌Endpoints
      • Gateway
        • Executes
          • Place Order
          • Place Isolated Order
          • Cancel Orders
          • Cancel Product Orders
          • Cancel And Place
          • Withdraw Collateral
          • Transfer Quote
          • Liquidate Subaccount
          • Mint LP
          • Burn LP
          • Link Signer
        • Queries
          • Status
          • Contracts
          • Nonces
          • Order
          • Orders
          • Subaccount Info
          • Isolated Positions
          • Market Liquidity
          • Symbols
          • All Products
          • Edge All Products
          • Market Prices
          • Max Order Size
          • Max Withdrawable
          • Max LP Mintable
          • Fee Rates
          • Health Groups
          • Linked Signer
          • Insurance
          • Min Deposit Rates
        • Signing
          • Examples
          • Q&A
      • Subscriptions
        • Authentication
        • Streams
        • Events
        • Rate limits
      • Archive (indexer)
        • Orders
        • Matches
        • Events
        • Summary
        • Candlesticks
        • Edge Candlesticks
        • Funding Rate
        • Interest & funding payments
        • Oracle Price
        • Perp Prices
        • Product Snapshots
        • Market Snapshots
        • Edge Market Snapshots
        • Maker Statistics
        • Merkle Proofs
        • Rewards
        • Referral Code
        • Liquidation Feed
        • Linked Signer Rate Limit
        • Subaccounts
        • Signatures
        • USDC Price
      • Trigger
        • Executes
          • Place Order
          • Cancel Orders
          • Cancel Product Orders
        • Queries
          • List Trigger Orders
      • V2
        • Assets
        • Pairs
        • APR
        • Orderbook
        • Tickers
        • Contracts
        • Trades
        • VRTX Token
      • Rate limits
      • Errors
      • Symbols
      • Depositing
      • Withdrawing (on-chain)
      • Integrate via Smart Contracts
      • Definitions / Formulas
    • Vertex Typescript SDK
      • Getting Started
      • How To
        • Create a Vertex client
        • Useful Common Functions
        • Query Markets & Products
        • Deposit Funds
        • Withdraw Funds
        • Manage Orders
      • User Guide
        • Client
          • Market
            • Place Order
            • Cancel Orders
            • Cancel Product Orders
            • Mint LP
            • Burn LP
            • Get All Markets
            • Get Latest Market Price
            • Get Market Liquidity
            • Get Open Subaccount orders
            • Get Historical Orders
            • Get Max Order Size
            • Get Max Mint LP
            • Get Candlesticks
            • Get Funding Rate
            • Get Product Snapshots
          • Spot
            • Approve Allowance
            • Deposit
            • Withdraw
            • Get Max Withdrawable
            • Get Token Contract for Product
            • Get Token Wallet Balance
            • Get Token Allowance
          • Perp
            • Get prices
          • Subaccount
            • Link Signer
            • Get Subaccount Linked Signer with Rate limits
            • Get Subaccount Summary
            • Get Subaccount Fee Rates
            • Get Subaccount Token Rewards
        • Engine Client
          • Executes
          • Queries
        • Indexer Client
          • Base Queries
          • Paginated Queries
        • Websocket
          • Executes
          • Queries
          • Subscriptions
        • Utilities
          • Contracts
          • Utils
      • API Reference
    • Vertex Python SDK
    • Vertex Rust SDK
    • Contracts
    • API/SDK Terms of Use
Powered by GitBook
On this page
  • Rate limits
  • Available Events
  • Event Limits
  • Request
  • Request Parameters
  • Response
  • Response Fields
  • Events
  • Txs
Export as PDF
  1. Developer Resources
  2. API
  3. Archive (indexer)

Events

Query Vertex events by subaccount, products, event types, etc.

PreviousMatchesNextSummary

Last updated 2 months ago

Rate limits

  • Dynamic based on limit param provided (weight = 2 + limit / 10)

    • E.g: With limit=100, you can make up to 200 requests per min or 33 requests / 10 secs.

See more details in

Available Events

Each event corresponds to a transaction type in Vertex. See below available events and their event_type mapping:

Event Name
Event Type Value

LiquidateSubaccount

liquidate_subaccount

DepositCollateral

deposit_collateral

WithdrawCollateral

withdraw_collateral

SettlePnl

settle_pnl

MatchOrders

match_orders

MintLp

mint_lp

BurnLp

burn_lp

Event Limits

You can specify 2 types of limit on the query:

  • raw: the max number of events to return.

  • txs: the max number of transactions to return. note: one transaction can emit multiple events, by specifying this limit, you will get all the events associated to the transactions in the response.

Request

Query events corresponding to a specific subaccount, ordered by submission index desc. E.g: all MatchOrder events for subaccount xxx specific to spot wBTC.

POST [ARCHIVE_ENDPOINT]

Body

{
  "events": {
    "product_ids": [
      1
    ],
    "subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
    "event_types": ["match_orders"],
    "max_time": 1679728762,
    "limit": {
       "raw": 1
    },
    "isolated": false
  }
}

Query events corresponding to specific products, ordered by submission index desc. Uses txs limit, will only return a single tx and one or more events associated with the tx.

POST [ARCHIVE_ENDPOINT]

Body

{
  "events": {
    "product_ids": [
      1,
      2
    ],
    "max_time": "1679728762",
    "limit": {
      "txs": 1
    }
  }
}

Query events corresponding to specific types, ordered by submission index desc.

POST [ARCHIVE_ENDPOINT]

Body

{
  "events": {
    "event_types": ["deposit_collateral", "withdraw_collateral"],
    "max_time": "1679728762",
    "limit": {
      "raw": 1
    }
  }
}

Query all events ordered by submission index desc.

POST [ARCHIVE_ENDPOINT]

Body

{
  "events": {
    "max_time": "1679728762",
    "limit": {
      "raw": 1
    }
  }
}

Request Parameters

Parameter
Type
Required
Description

subaccount

string

No

a bytes32 sent as a hex string; includes the address and the subaccount identifier.

product_ids

number[]

No

when provided, only return events for the specified product ids; return events for all products otherwise.

event_types

string[]

No

when provided, only return events for the specified event types; return all events otherwise.

idx

number / string

No

when provided, only return events with submission_idx <= idx

max_time

number / string

No

when idx is not provided, max_time (unix epoch in seconds) can be used to only return events created <= max_time

limit

object {"raw": number } or

{"txs": number }

No

  • specifying raw limit: max number of events to return. defaults to 100. max possible of 500.

  • specifying txs limit: max number of txs to return.

isolated

bool

No

Response

Note:

  • the response includes a txs field which contains the relevant transactions to the events. There are >=1 events per transaction.

  • both events and txs are in descending order by submission_idx.

  • use the submission_idx to associate an event to it's corresponding transaction.

{
  "events": [
    {
      "subaccount": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
      "product_id": 1,
      "submission_idx": "563011",
      "event_type": "match_orders",
      "isolated": false,
      "isolated_product_id": null,
      "pre_balance": {
        "spot": {
          "product_id": 1,
          "lp_balance": {
            "amount": "217360200000000000000000"
          },
          "balance": {
            "amount": "26766781157882079846319",
            "last_cumulative_multiplier_x18": "1001292804799204317"
          }
        }
      },
      "post_balance": {
        "spot": {
          "product_id": 1,
          "lp_balance": {
            "amount": "217360200000000000000000"
          },
          "balance": {
            "amount": "26767505157882079846318",
            "last_cumulative_multiplier_x18": "1001292804799204317"
          }
        }
      },
      "product": {
        "spot": {
          "product_id": 1,
          "oracle_price_x18": "27540844575000000000000",
          "risk": {
            "long_weight_initial_x18": "750000000000000000",
            "short_weight_initial_x18": "1250000000000000000",
            "long_weight_maintenance_x18": "800000000000000000",
            "short_weight_maintenance_x18": "1200000000000000000",
            "large_position_penalty_x18": "0"
          },
          "config": {
            "token": "0x5cc7c91690b2cbaee19a513473d73403e13fb431",
            "interest_inflection_util_x18": "800000000000000000",
            "interest_floor_x18": "10000000000000000",
            "interest_small_cap_x18": "40000000000000000",
            "interest_large_cap_x18": "1000000000000000000"
          },
          "state": {
            "cumulative_deposits_multiplier_x18": "1001292804799204317",
            "cumulative_borrows_multiplier_x18": "1002791493009348417",
            "total_deposits_normalized": "94095904024674402346367",
            "total_borrows_normalized": "1755914630382859644973"
          },
          "lp_state": {
            "supply": "1304161199999999999673957",
            "quote": {
              "amount": "1739271965822676148431418",
              "last_cumulative_multiplier_x18": "1000000000612384372"
            },
            "base": {
              "amount": "63297536722571942760",
              "last_cumulative_multiplier_x18": "1001292804799204317"
            }
          },
          "book_info": {
            "size_increment": "1000000000000000",
            "price_increment_x18": "1000000000000000000",
            "min_size": "10000000000000000",
            "collected_fees": "7658873942615761269158545",
            "lp_spread_x18": "3000000000000000"
          }
        }
      },
      "net_interest_unrealized": "49040544804593257",
      "net_interest_cumulative": "51596254598679857",
      "net_funding_unrealized": "0",
      "net_funding_cumulative": "0",
      "net_entry_unrealized": "748947727410369682388339518",
      "net_entry_cumulative": "749148081870171307027129958",
      "net_entry_lp_unrealized": "577238176026145728940277",
      "net_entry_lp_cumulative": "577238176026145728940277"
    }
  ],
  "txs": [
    {
      "tx": {
        "match_orders": {
          "product_id": 1,
          "amm": true,
          "taker": {
            "order": {
              "sender": "0x12a0b4888021576eb10a67616dd3dd3d9ce206b664656661756c740000000000",
              "price_x18": "27540000000000000000000",
              "amount": "2000000000000000000",
              "expiration": 4611686020107120000,
              "nonce": 1761322602510418000
            },
            "signature": "0x826c68f1a3f76d9ffbe8041f8d45e969d31f1ab6f2ae2f6379d1493e479e56436091d6cf4c72e212dd2f1d2fa17c627c4c21bd6d281c77172b8af030488478b71c"
          },
          "maker": {
            "order": {
              "sender": "0xf8d240d9514c9a4715d66268d7af3b53d619642564656661756c740000000000",
              "price_x18": "27540000000000000000000",
              "amount": "-724000000000000000",
              "expiration": 1679731656,
              "nonce": 1761322565506171000
            },
            "signature": "0xd8b6505b8d9b8c3cbfe793080976388035682c02a27893fb26b48a5b2bfe943f4162dea3a42e24e0dff5e2f74fbf77e33d83619140a2a581117c55e6cc236bdb1c"
          }
        }
      },
      "submission_idx": "563011",
      "timestamp": "1679728127"
    }
  ]
}

Response Fields

Events

  • Net cumulative: the net difference in that quantity since the beginning of time. For example, if I want to compute total amount paid out in funding between two events, you can subtract the net_funding_cumulative of the larger event by the net_funding_cumulative of the smaller event.

  • Net unrealized: similar to net_cumulative, but for net_unrealized, we have the caveat that when the magnitude of your position decreases, the magnitude of net_unrealized decreases by the same amount.

Field name
Description

submission_idx

Used to uniquely identify the blockchain transaction that generated the event; you can use it to grab the relevant transaction in the txs section.

product_id

The id of of the product the event is associated with.

event_type

Name of the transaction type this event corresponds to.

subaccount

The subaccount associated to the event.

pre_balance

The state of your balance before the event happened.

post_balance

The state of your balance after the event happened.

product

The state of the product throughout the event.

Txs

Field name
Description

submission_idx

Unique identifier of the transaction.

product_id

Product associated to the transaction.

tx

Raw data of the corresponding transaction e.g: match_orders with all associated data.

timestamp

The unix epoch in seconds of when the transaction took place.

When provided -- - true: only returns evens associated to isolated positions. - false: only return events associated to the cross-subaccount. defaults to null. In which case it returns everything. See to learn more.

API Rate limits
Isolated Margin