Subaccount Snapshots

Query latest subaccount snapshots.

Use this query to get a summary of the latest actions per product on Vertex for provided subaccounts. Tracked variables (ex. net interest) are extrapolated to the timestamp or set of timestamps provided.

Rate limits

  • 480 requests/min or 80 requests/10secs per IP address. (weight = 5)

See more details in API Rate limits

Request

Query latest subaccount events/actions ordered by submission index desc.

POST [ARCHIVE_ENDPOINT]

Body

{
    "account_snapshots": {
        "subaccounts": [
            "0xec132d41e542c7129268d9d4431f105e0830a81164656661756c745f31000000"
        ],
        "timestamps": [
            1738703761
        ],
        "isolated": false
    }
}

Request Parameters

Parameter
Type
Required
Description

subaccounts

array

Yes

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

timestamp

array

Yes

A list of timestamps to retrieve multiple subaccount snapshots (one per timestamp).

isolated

boolean

No

A filter to include only isolated or cross margin events.

  • If true: returns only isolated margin events.

  • If false: returns only cross margin events.

  • If omitted: returns both isolated and cross events.

Response

{
  "snapshots": {
    "0xec132d41e542c7129268d9d4431f105e0830a81164656661756c745f31000000": {
      "1738703761": [
        {
          "subaccount": "0xec132d41e542c7129268d9d4431f105e0830a81164656661756c745f31000000",
          "product_id": 0,
          "submission_idx": "17286676",
          "event_type": "liquidate_subaccount",
          "isolated": false,
          "isolated_product_id": null,
          "pre_balance": {
            "spot": {
              "product_id": 0,
              "lp_balance": {
                "amount": "0"
              },
              "balance": {
                "amount": "53278293456559329896",
                "last_cumulative_multiplier_x18": "1030906860605053006"
              }
            }
          },
          "post_balance": {
            "spot": {
              "product_id": 0,
              "lp_balance": {
                "amount": "0"
              },
              "balance": {
                "amount": "0",
                "last_cumulative_multiplier_x18": "1049694890218172982"
              }
            }
          },
          "product": {
            "spot": {
              "product_id": 0,
              "oracle_price_x18": "1000000000000000000",
              "risk": {
                "long_weight_initial_x18": "1000000000000000000",
                "short_weight_initial_x18": "1000000000000000000",
                "long_weight_maintenance_x18": "1000000000000000000",
                "short_weight_maintenance_x18": "1000000000000000000",
                "large_position_penalty_x18": "0"
              },
              "config": {
                "token": "0x3894085ef7ff0f0aedf52e2a2704928d1ec074f1",
                "interest_inflection_util_x18": "800000000000000000",
                "interest_floor_x18": "10000000000000000",
                "interest_small_cap_x18": "40000000000000000",
                "interest_large_cap_x18": "1000000000000000000"
              },
              "state": {
                "cumulative_deposits_multiplier_x18": "1031753474962205088",
                "cumulative_borrows_multiplier_x18": "1049694890218172982",
                "total_deposits_normalized": "1920493495548704701108679",
                "total_borrows_normalized": "1537093444988398950546459"
              },
              "lp_state": {
                "supply": "0",
                "quote": {
                  "amount": "0",
                  "last_cumulative_multiplier_x18": "1031753474962205088"
                },
                "base": {
                  "amount": "0",
                  "last_cumulative_multiplier_x18": "1031753474962205088"
                }
              },
              "book_info": {
                "size_increment": "0",
                "price_increment_x18": "0",
                "min_size": "0",
                "collected_fees": "0",
                "lp_spread_x18": "0"
              }
            }
          },
          "net_interest_unrealized": "0",
          "net_interest_cumulative": "1443761232166478119",
          "net_funding_unrealized": "0",
          "net_funding_cumulative": "0",
          "net_entry_unrealized": "0",
          "net_entry_cumulative": "13458165999999999998",
          "net_entry_lp_unrealized": "0",
          "net_entry_lp_cumulative": "0"
        }
      ]
    }
  }
}

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.

Last updated