Title: Vestige legacy API reference
Source: https://nodely.io/docs/vestige/endpoints/

# Vestige legacy API reference

Base URL: `https://vestleg.api.nodely.io`. Every route is `GET` unless marked otherwise, answers JSON and is free. The parameters are the ones of Vestige Labs API 4.0.0. The routes that quote and build swaps are on the [Swap aggregator](https://nodely.io/docs/vestige/aggregator) page. The same reference is machine-readable at [`/openapi.json`](https://vestleg.api.nodely.io/openapi.json) (OpenAPI 3.1) and, for LLMs, at [`/llms.txt`](https://vestleg.api.nodely.io/llms.txt) and [`/llms-full.txt`](https://vestleg.api.nodely.io/llms-full.txt).

<a id="conventions"></a>

## Conventions

|  |  |
| --- | --- |
| `network_id` | Accepted on every route, default `0`. Only `0` (Algorand mainnet) exists |
| `denominating_asset_id` | The asset prices and values are given in, default `0` (ALGO). Use `31566704` for USDC |
| Asset ids | ALGO is `0`. Lists such as `asset_ids` are comma separated: `asset_ids=0,31566704` |
| Times | Unix seconds (UTC). `interval` is in seconds |
| Amounts | Whole units of the asset (decimals applied), except in the swap aggregator, which takes and returns base units |
| Paging | `limit` (default 50) and `offset`, with `order_by` and `order_dir` (`asc` or `desc`, default `desc`). Lists answer `{"count", "results", "extra", "limit", "offset", "order_by", "order_dir"}`. `/swaps` pages with `next` instead |
| Errors | `{"detail": ...}`: `422` for a bad parameter, `404` for an unknown path or id, `429` over the [rate limit](https://nodely.io/docs/vestige/#rate-limits-and-caching) |

<a id="networks-and-status"></a>

## Networks and status

<a id="get-ping"></a>

### `GET /ping`

Answers `{"message":"pong"}`.

<a id="get-networks-get-networksnetwork_id"></a>

### `GET /networks`, `GET /networks/{network_id}`

The chain tip as indexed by Nodely. `blocks_behind` is normally 0.

```json
[{"id":0,"name":"Algorand","stage":"Mainnet","block":66990218,"network_block":66990218,"blocks_behind":0,"cache_updated_at":1794778614,"cache_seconds":3}]
```

<a id="get-usage"></a>

### `GET /usage`

Request counts, status codes and average response time per route over the last `hours` (default 24) on the instance that answers. `api_keys` is always empty: there are no keys.

<a id="protocols-and-pools"></a>

## Protocols and pools

<a id="get-protocols-get-protocolsprotocol_id"></a>

### `GET /protocols`, `GET /protocols/{protocol_id}`

Every protocol with its TVL in ALGO. Ids 0 to 17 are Vestige’s; protocols Nodely adds start at 100.

| id | Protocol | id | Protocol |
| --- | --- | --- | --- |
| 0 | Tinyman 1.0 | 12 | rug.ninja |
| 1 | Tinyman 1.1 | 13 | gALGO LST |
| 2 | Tinyman 2.0 | 14 | xALGO LST |
| 3 | Pact | 15 | tALGO LST |
| 4 | Pact StableSwap | 16 | mALGO LST |
| 5 | Algofi 1.0 | 17 | cALGO LST |
| 6 | Algofi 2.0 | 100 | Pact Weighted |
| 7 | Algofi StableSwap | 101 | Pact Concentrated |
| 8 | HumbleSwap 1.0 | 102 | Biatec |
| 9 | HumbleSwap 2.0 | 103 | LiquiHog |
| 10 | Vestige Vault | 104 | Folks Lending |
|  |  | 105 | Lofty OTC |

Algofi 2.0 and the gALGO, mALGO and cALGO LSTs are listed with TVL 0: Nodely doesn’t index them. Call `/protocols` for the authoritative list with names, versions and URLs.

```json
{"id":2,"active":true,"name":"Tinyman","type":0,"version":"2.0","url":"https://tinyman.org","tvl":52198298.96885025}
```

<a id="get-protocolsvolume"></a>

### `GET /protocols/volume`

Swaps and traded volume per protocol and asset for the UTC day holding `timestamp` (default: today so far). Each swap counts the asset sold, as Vestige counts. tALGO and xALGO count their mint and burn calls.

| Parameter | Default |
| --- | --- |
| `timestamp` | Now |
| `denominating_asset_id` | `0` |

```json
{"1":{"denominating_asset_id":0,"total_swaps":719,"total_volume":36858.62,"assets":{"0":{"swaps":442,"amount":12855.589207,"volume":12855.589207,"vwap":1,"confidence":1}}}}
```

<a id="get-pools"></a>

### `GET /pools`

Pools with their reserves and LP supply.

| Parameter | Notes |
| --- | --- |
| `protocol_id`, `other_protocol_id` | Filter by protocol |
| `asset_1_id`, `asset_2_id` | Filter by asset. `asset_1_id` is the larger id of the pair, as Vestige |
| `limit`, `offset`, `order_by`, `order_dir` | Paging |

`id` and `application_id` are the pool’s app (the LP token id for Tinyman 2.0). `fee` is in millionths (`3000` = 0.30 %). `token_supply` is the LP supply on Tinyman 2.0 and Pact, 0 elsewhere.

```json
{"id":3770093831,"network_id":0,"protocol_id":100,"created_at":1794633815,"updated_at":1794666605,"address":"PXTZII4HGGH5C56HNKTOKRSF5UR2FNJF44LHTQJOO24NUOSZ6KLTK3WBLI","application_id":3770093831,"fee":10000,"token_id":0,"token_supply":0,"asset_1_id":31566704,"asset_1_supply":298,"asset_2_id":0,"asset_2_supply":3382}
```

<a id="assets-and-prices"></a>

## Assets and prices

<a id="get-assets"></a>

### `GET /assets`

On-chain parameters of the assets in `asset_ids` (required): name, ticker, decimals, creator, manager, reserve, freeze, clawback, URL, total supply.

<a id="get-assetsprice"></a>

### `GET /assets/price`

Live prices of the assets in `asset_ids` (required), in `denominating_asset_id`.

```json
[{"network_id":0,"asset_id":31566704,"denominating_asset_id":0,"price":12.5721408320605,"confidence":1,"total_lockup":1184193.67574}]
```

-   `price` comes from a route search over every live pool, weighted by liquidity, recomputed at least every 10 seconds.
-   `confidence` is L / (L + 1000), where L is the routed liquidity in USD.
-   `total_lockup` is the amount of the asset held in live AMM pools.

<a id="get-assetslist"></a>

### `GET /assets/list`

The screener: every traded asset with price changes, volume, swap counts, supply, market cap, TVL, labels and image. Rebuilt every minute.

| Parameter | Notes |
| --- | --- |
| `asset_ids` | Only these assets |
| `denominating_asset_id` | Default `0` |
| `include_labels`, `exclude_labels` | Comma-separated label ids, see below |
| `extended` | Accepted, as Vestige |
| `limit`, `offset`, `order_by`, `order_dir` | Paging. `order_by` takes any numeric field, such as `tvl`, `volume1d`, `market_cap` or `rank` |
| `rank__lt`, `rank__gt`, `tvl__lt`, `tvl__gt`, `market_cap__lt`, `market_cap__gt`, `fully_diluted_market_cap__lt`, `fully_diluted_market_cap__gt`, `volume1d__lt`, `volume1d__gt`, `created_at__lt`, `created_at__gt` | Range filters |

Label ids, as Vestige’s:

| id | Meaning | id | Meaning |
| --- | --- | --- | --- |
| 0 | Freeze address set | 5 | rug.ninja token, still bonding |
| 1 | Clawback address set | 6 | rug.ninja token, graduated to a DEX |
| 2 | Pera verified | 7 | Inactive: no swaps in 7 days |
| 3 | Pera suspicious | 8 | Curated pegged or blue chip (stablecoins, LSTs, wrapped assets) |
| 4 | Wormhole bridged | 9 | ALGO |

```json
{"rank":5,"network_id":0,"id":386192725,"decimals":8,"name":"goBTC","ticker":"goBTC","confidence":0.99,"price":810122.78,"price1h":810169.57,"price1d":825104.54,"price7d":805018.78,"volume1h":406.47,"volume1d":35489.31,"volume7d":349267.74,"swaps1h":35,"swaps1d":1004,"swaps7d":8176,"total_lockup":2.20138489,"total_supply":21000000,"circulating_supply":27.3922239,"market_cap":22191064.68,"tvl":3566784.11,"labels":[2,8],"image":"https://algorand-wallet-mainnet.b-cdn.net/...png"}
```

Circulating supply is total supply minus the reserve address and burned amounts. `views1h`, `views1d`, `replies`, `last_reply_at` and `bond_progress` are always 0 or null, and `vault_supply` is 0.

<a id="get-assetssearch"></a>

### `GET /assets/search`

Assets whose name or ticker matches `query` (required), in the screener’s shape. Also takes `protocol_id`, `denominating_asset_id` and paging.

<a id="charts"></a>

## Charts

<a id="get-assetsasset_idhistory"></a>

### `GET /assets/{asset_id}/history`

Volume, swaps, TVL, VWAP and confidence per bin.

| Parameter | Notes |
| --- | --- |
| `interval` | Required. Whole hours (`3600`, `86400`, …) or 60, 300, 900 or 1800 seconds |
| `start` | Required |
| `end` | Default now. At most 2000 bins per request |
| `denominating_asset_id` | Default `0` |
| `volume_in_denominating_asset` | Accepted and ignored: `volume` is in whole units of the asset |

```json
[{"network_id":0,"asset_id":31566704,"interval":86400,"denominating_asset_id":0,"timestamp":1793923200,"volume":194714.794734,"tvl":1299003.50516,"swaps":12395,"vwap":10.469502724296323,"confidence":1}]
```

Bins without swaps are left out.

<a id="get-assetsasset_idcandles"></a>

### `GET /assets/{asset_id}/candles`

OHLC candles in `denominating_asset_id`, with the same parameters as `history`. Each bin uses the asset’s main pool: the most liquid one with activity in that bin.

```json
[{"network_id":0,"asset_id":31566704,"interval":3600,"denominating_asset_id":0,"timestamp":1794700800,"open":12.8856,"high":12.9847,"low":12.7552,"close":12.9843,"volume":23375.92,"confidence":0.9993}]
```

<a id="get-assetsasset_idcomposition"></a>

### `GET /assets/{asset_id}/composition`

Where the asset is locked: `{protocol_id: {paired_asset_id: amount}}`, from the reserves of live pools.

<a id="trades"></a>

## Trades

<a id="get-swaps"></a>

### `GET /swaps`

Swaps on the indexed AMM venues, newest first.

| Parameter | Notes |
| --- | --- |
| `start`, `end` | Time range |
| `asset_id` | Swaps of this asset |
| `address` | Swaps by this account |
| `executor` | Swaps made through this app account, such as an aggregator |
| `denominating_asset_id` | For the `*_value` fields, default `0` |
| `limit` | Default 50 |
| `next` | Paging: pass the `next` of the previous page |
| `order_dir` | `desc` (default) or `asc`. `order_by=value` isn’t served |

```json
{"type":0,"network_id":0,"protocol_id":2,"asset_1_id":3259446717,"asset_2_id":0,"offset":4390272696378,"block":66990245,"timestamp":1794778689,"group":"IUszj6yVlmecLkX0cRRq35OXMt99W8s9trh3sWZpTEI=","address":"PV5CWQNODZFOSOGXNYOZHN34J5ILW3PAL5OSWHKYHDXBOSYLQMS4K6D4OI","executor":"3IMNKFHT7BIUBIV57Y4VYQJM4BLXXWPKWY3CUN4QOIQ33CYJAVWKUDQF3Q","asset_1_delta":112678438.096173,"asset_2_delta":-4.656734,"asset_1_delta_value":4.664157575619326,"asset_2_delta_value":4.656734}
```

The deltas are the pool’s side of the swap. `extra` maps each asset id on the page to its ticker and image. A request filtered by `address` or `executor` walks at most 20,000 of that account’s rounds: page on with `next`.

<a id="get-marks"></a>

### `GET /marks`

One account’s buys (`type` 0) and sells (`type` 1) of one asset per bin, for trade markers on a chart. Required: `address`, `asset_id`, `interval`, `start`. Optional: `end`, `denominating_asset_id`.

```json
[{"timestamp":1794700800,"marks":[{"type":0,"swaps":1,"amount":-112893859.173565,"value":4.6730746130494},{"type":1,"swaps":1,"amount":112678438.096173,"value":4.664157575619325}]}]
```

<a id="wallets"></a>

## Wallets

<a id="get-walletsaddressvalue"></a>

### `GET /wallets/{address}/value`

An account’s value in `denominating_asset_id`: wallet tokens in `token_balances` (LP tokens and liquid staking tokens listed as themselves) and DeFi positions in `labeled_balances` (provider, type, debt as negative amounts), with `assets` describing every asset in the answer. Cached 60 seconds per address.

<a id="get-walletsaddresspnl"></a>

### `GET /wallets/{address}/pnl`

What an account bought and sold of `asset_id` (required) since `start` (required), with values in `denominating_asset_id`.

```json
{"timestamp":1794000000,"asset_id":3259446717,"amount_bought":112893859.173565,"amount_bought_value":4.6730746130494,"amount_sold":112678438.096173,"amount_sold_value":4.664157575619325}
```

<a id="protocol-positions"></a>

## Protocol positions

<a id="get-vaults"></a>

### `GET /vaults`

Vestige Vault token locks (`protocol_id=10`, required), decoded from the lock apps on chain: deployer, claimer, asset, steps, amount per step, release times, amounts given and `is_done`. Filters: `asset_id`, `address`, paging.

<a id="get-balances"></a>

### `GET /balances`

rug.ninja bonding-curve balances (`protocol_id=12`, required): address, asset, amount and when it was claimed. Filters: `address`, `asset_id`, paging.

<a id="asset-notes"></a>

## Asset notes

Notes that projects attach to their assets: transactions whose note is `vlabs:j` followed by JSON. An asset transfer note belongs to that asset, a payment note to ALGO, and an app call note to the asset the call created. New notes appear within about a minute.

| Route | Parameters | Returns |
| --- | --- | --- |
| `GET /notes` | `asset_id`, paging | Notes, newest first |
| `GET /notes/first` | `asset_ids` (required) | The first note of each asset |
| `GET /notes/count` | `asset_ids` (required) | Count and first and last time per asset |

```json
{"network_id":0,"offset":4370209046546,"timestamp":1793935749,"address":"LONQAI3RNTOYCVTF72DKUH5OSPM55HBNUUIA3BPHA7GHDYMX7XGJF6T6HA","asset_id":3763665834,"content":"{\"a\":\"Moon juice tokens getting bonded 😀\"}"}
```

<a id="swap-aggregator"></a>

## Swap aggregator

`GET /swap/v4`, `POST /swap/v4/transactions`, `GET /swap/v4/fee` and `GET /swap/v4/history` have their own page: [Swap aggregator](https://nodely.io/docs/vestige/aggregator).
