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
  • Single Product
  • Request
  • Request Parameters
  • Response
  • Response Fields
  • Multiple Products
  • Request
  • Request Parameters
  • Response
  • Response Fields
Export as PDF
  1. Developer Resources
  2. API
  3. Archive (indexer)

Product Snapshots

Query historical product snapshots.

PreviousPerp PricesNextMarket Snapshots

Last updated 6 months ago

Rate limits

  • 240 requests/min or 40 requests/10secs per IP address. (weight = 10)

See more details in

Single Product

Request

Query snapshots for a given product ordered by submission index desc.

POST [ARCHIVE_ENDPOINT]

Body

{
    "products": {
        "product_id": 3,
        "max_time": 1679728762,
        "limit": 1
    }
}

Request Parameters

Parameter
Type
Required
Description

product_id

number

Yes

id of product to fetch snapshots for.

idx

number / string

No

when provided, only return product snapshots 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 snapshots created <= max_time

limit

number

No

max number of snapshots to return. defaults to 100. max possible of 500.

Response

Note:

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

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

  • use the submission_idx to associate a product snapshot to it's corresponding transaction.

{
  "products": [
    {
      "product_id": 3,
      "submission_idx": "563014",
      "product": {
        "spot": {
          "product_id": 3,
          "oracle_price_x18": "1751488625000000050000",
          "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": "0xcc59686e3a32fb104c8ff84dd895676265efb8a6",
            "interest_inflection_util_x18": "800000000000000000",
            "interest_floor_x18": "10000000000000000",
            "interest_small_cap_x18": "40000000000000000",
            "interest_large_cap_x18": "1000000000000000000"
          },
          "state": {
            "cumulative_deposits_multiplier_x18": "1003006222268375194",
            "cumulative_borrows_multiplier_x18": "1005686349789989371",
            "total_deposits_normalized": "101765274778392635900623",
            "total_borrows_normalized": "48739080269992866425685"
          },
          "lp_state": {
            "supply": "902924999999999999774268",
            "quote": {
              "amount": "1026773958941457186836518",
              "last_cumulative_multiplier_x18": "1000000000612384372"
            },
            "base": {
              "amount": "587811596408602623177",
              "last_cumulative_multiplier_x18": "1003006222268375194"
            }
          },
          "book_info": {
            "size_increment": "10000000000000000",
            "price_increment_x18": "100000000000000000",
            "min_size": "100000000000000000",
            "collected_fees": "1546717023589573343471212",
            "lp_spread_x18": "3000000000000000"
          }
        }
      }
    }
  ],
  "txs": [
    {
      "tx": {
        "update_price": {
          "product_id": 3,
          "price_x18": "1750710375000000000000"
        }
      },
      "submission_idx": "563014",
      "timestamp": "1679728271"
    }
  ]
}

Response Fields

Products

Field name
Description

submission_idx

Used to uniquely identify the blockchain transaction that generated the product snapshot; 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.

product

The state of the product at the time of the transaction.

Txs

Field name
Description

submission_idx

Unique identifier of the transaction.

tx

Raw data of the corresponding transaction

timestamp

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

Multiple Products

Request

Query the latest snapshot for the provided products.

POST [ARCHIVE_ENDPOINT]

Body

{
    "product_snapshots": {
        "product_ids": [1, 2],
        "max_time": 1679728762
    }
}

Request Parameters

Parameter
Type
Required
Description

product_ids

number[]

Yes

Ids of products to fetch snapshots for.

max_time

number / string

No

When provided, returns the last snapshot created <= max_time for each product. Otherwise, the latest snapshot is returned.

Response

Note: the response is a map of product_id -> snapshot for each requested product.

{
  "1": {
    "product_id": 1,
    "submission_idx": "459743",
    "product": {
      "spot": {
        "product_id": 1,
        "oracle_price_x18": "31582395488073320408472",
        "risk": {
          "long_weight_initial_x18": "900000000000000000",
          "short_weight_initial_x18": "1100000000000000000",
          "long_weight_maintenance_x18": "950000000000000000",
          "short_weight_maintenance_x18": "1050000000000000000",
          "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": "1005266691979081067",
          "cumulative_borrows_multiplier_x18": "1008464332498400342",
          "total_deposits_normalized": "3853380366798127292498",
          "total_borrows_normalized": "3171903194179038855701"
        },
        "lp_state": {
          "supply": "485670917658672273450851",
          "quote": {
            "amount": "533498653674283527525638",
            "last_cumulative_multiplier_x18": "1000000000047911804"
          },
          "base": {
            "amount": "16862535452736644443",
            "last_cumulative_multiplier_x18": "1005266691979081067"
          }
        },
        "book_info": {
          "size_increment": "1000000000000000",
          "price_increment_x18": "1000000000000000000",
          "min_size": "10000000000000000",
          "collected_fees": "460839041331226808022323",
          "lp_spread_x18": "3000000000000000"
        }
      }
    }
  },
  "2": {
    "product_id": 2,
    "submission_idx": "459842",
    "product": {
      "perp": {
        "product_id": 2,
        "oracle_price_x18": "31577635670035396763528",
        "risk": {
          "long_weight_initial_x18": "950000000000000000",
          "short_weight_initial_x18": "1050000000000000000",
          "long_weight_maintenance_x18": "970000000000000000",
          "short_weight_maintenance_x18": "1030000000000000000",
          "large_position_penalty_x18": "0"
        },
        "state": {
          "cumulative_funding_long_x18": "134895011744110446566737",
          "cumulative_funding_short_x18": "134437616226076003830045",
          "available_settle": "3528089205596638824705152",
          "open_interest": "3341108000000000000000"
        },
        "lp_state": {
          "supply": "264410712802085330000000",
          "last_cumulative_funding_x18": "134895011744110446566737",
          "cumulative_funding_per_lp_x18": "5521082805340854",
          "base": "9170000000000000000",
          "quote": "289310002802085330000000"
        },
        "book_info": {
          "size_increment": "1000000000000000",
          "price_increment_x18": "1000000000000000000",
          "min_size": "10000000000000000",
          "collected_fees": "313231857879134266832804",
          "lp_spread_x18": "3000000000000000"
        }
      }
    }
  }
}

Response Fields

Field name
Description

submission_idx

Used to uniquely identify the blockchain transaction that generated the product snapshot.

product_id

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

product

The state of the product at the time of the transaction.

API Rate limits