From f707e1cb7550361faf48359ac960ee71f32bd445 Mon Sep 17 00:00:00 2001 From: Nguyen Khai Date: Tue, 30 Dec 2025 18:09:02 +0700 Subject: [PATCH 1/2] update Minswap APIs --- developer/minswap-apis.md | 851 ++++++++++++++++++++++++++++---------- 1 file changed, 628 insertions(+), 223 deletions(-) diff --git a/developer/minswap-apis.md b/developer/minswap-apis.md index 6535077..73ef464 100644 --- a/developer/minswap-apis.md +++ b/developer/minswap-apis.md @@ -86,6 +86,10 @@ enum SortDirection { Ascending = "asc", Descending = "desc" } + +type SupportedCurrency = 'aed' | 'ars' | 'aud' | 'bdt' | 'bhd' | 'bmd' | 'brl' | 'cad' | 'chf' | 'clp' | 'cny' | 'czk' | 'dkk' | 'eur' | 'gbp' | 'hkd' | 'huf' | 'idr' | 'ils' | 'inr' | 'jpy' | 'krw' | 'kwd' | 'lkr' | 'mmk' | 'mxn' | 'myr' | 'ngn' | 'nok' | 'nzd' | 'php' | 'pkr' | 'pln' | 'rub' | 'sar' | 'sek' | 'sgd' | 'thb' | 'try' | 'twd' | 'uah' | 'usd' | 'vef' | 'vnd' | 'xdr' | 'zar'; + +type TimeSeriesPeriod = "1d" | "1w" | "1M" | "6M" | "1y" | "all"; ``` ## Assets APIs @@ -94,11 +98,11 @@ Assets APIs allow you to retrieve information about tokens available on Minswap, ### 1. Get List Assets -**GET:** `/v1/assets` +**POST:** `/v1/assets` **Description:** Retrieve a paginated list of assets available on Minswap with their metadata and verification status. Use this endpoint to populate token selection interfaces or search for specific assets. -#### Request Parameters +#### Request Body | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| @@ -106,7 +110,11 @@ Assets APIs allow you to retrieve information about tokens available on Minswap, | limit | number | No | `20` | Number of results per page (min: `1`, max: `100`) | | only_verified | boolean | No | `false` | Filter to show only verified tokens | | search_after | string[] | No | `[]` | Pagination cursor from previous response | - +| sort_direction | string | No | - | Sort order: `asc` or `desc` | +| sort_field | string | No | - | Sort by: `price_change_1h`, `price_change_24h`, or `price_change_7d`, or `volume_1h`, or `volume_24h`, or `volume_7d`, or `liquidity`, or `market_cap`, or `fully_diluted`, or `total_supply`, or `circulating_supply` | +| favorite_asset_ids | string[] | No | - | Parameter is an optional array of Asset IDs used to filter and prioritize results for assets marked as favorites by the user | +| filter_small_liquidity | boolean | No | - | If true, returns only assets with value > $1 | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | **Note:** For pagination, use the `search_after` value from the previous response to get the next page of results. #### Request Response @@ -114,55 +122,363 @@ Assets APIs allow you to retrieve information about tokens available on Minswap, ```typescript type Response = { search_after: string[], - assets: Asset[] + asset_metrics: RestAssetMetrics[]; } -type Asset = { - currency_symbol: string, - token_name: string, - is_verified: boolean, - metadata?: AssetMetadata, - social_links?: SocialLinks +type RestAssetMetrics = { + asset: RestAssetMetadata; + price_change_1h: number; + price_change_24h: number; + price_change_7d: number; + volume_1h: number; + volume_24h: number; + volume_7d: number; + total_supply: number; + circulating_supply: number; + created_at?: string; + created_tx_id?: string; + categories?: string[]; + price: number; + liquidity: number; + market_cap: number; + fully_diluted: number; } ``` #### Example ```bash -curl --location 'https://api-mainnet-prod.minswap.org/v1/assets?term=&limit=20&only_verified=false' +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/metrics' \ +--header 'cache-control: no-cache' \ +--header 'content-type: application/json' \ +--data '{ + "term": "", + "limit": 1, + "only_verified": true, + "sort_direction": "desc", + "sort_field": "liquidity", + "currency": "usd" +}' +``` + +```json +{ + "search_after": [ + 9954917.19354675, + "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad.0014df105553444d" + ], + "asset_metrics": [ + { + "asset": { + "currency_symbol": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad", + "token_name": "0014df105553444d", + "is_verified": true, + "metadata": { + "name": "USDM", + "url": "https://moneta.global/", + "ticker": "USDM", + "decimals": 6, + "description": "Fiat-backed stablecoin native to the Cardano blockchain" + } + }, + "total_supply": 0, + "circulating_supply": 0, + "created_at": "2024-03-17T00:21:21.000Z", + "created_tx_id": "ac1cb7d3bc2a6e1a356b16c959e222608005524fc0c35919b63574d6b0b20b5a", + "categories": [ + "Stablecoin" + ], + "price": 0.9975544277153409, + "price_change_1h": 0.02207271877209818, + "price_change_24h": -2.350271288070098, + "price_change_7d": -0.09023188511685103, + "volume_1h": 15276.40548938064, + "volume_24h": 1058967.9023246677, + "volume_7d": 7092205.7164879, + "liquidity": 9954917.19354675, + "market_cap": 0, + "fully_diluted": 0 + } + ] +} +``` +### 2. Get Asset Metrics +**GET:** `v1/assets/${id}/metrics` +**Description:** Retrieves detailed metrics for a specific asset by its ID, optionally filtered by display currency. It returns comprehensive asset statistics such as volume, liquidity, and price data for use in analytics or UI display. + +#### Request Parameter + +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| id | string | Yes | - | The id parameter is a required string that uniquely identifies the asset for which metrics are being requested | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | + +#### Request Response + +```typescript +type RestAssetMetrics = { + asset: RestAssetMetadata; + price_change_1h: number; + price_change_24h: number; + price_change_7d: number; + volume_1h: number; + volume_24h: number; + volume_7d: number; + total_supply: number; + circulating_supply: number; + created_at?: string; + created_tx_id?: string; + categories?: string[]; + price: number; + liquidity: number; + market_cap: number; + fully_diluted: number; +} + +type RestAssetMetadata = { + currency_symbol: string; + token_name: string; + is_verified: boolean; + metadata?: { + decimals: number; + name?: string; + url?: string; + ticker?: string; + description?: string; + logo?: string; + } + social_links?: { + website?: string; + discord?: string; + telegram?: string; + twitter?: string; + coingecko?: string; + coin_market_cap?: string; + } +} ``` +#### Example +```bash +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/016be5325fd988fea98ad422fcfd53e5352cacfced5c106a932a35a442544e/metrics?currency=usd' +``` ```json { - "search_after": [ - "1", - "14110", - "f66d78b4a3cb3d37afa0ec36461e51ecbde00f26c8f0a68f94b69880.69425443" - ], - "assets": [ + "asset": { + "currency_symbol": "016be5325fd988fea98ad422fcfd53e5352cacfced5c106a932a35a4", + "token_name": "42544e", + "is_verified": true, + "metadata": { + "name": "BTN", + "url": "https://butane.dev", + "ticker": "BTN", + "decimals": 6, + "description": "BTN is the native token of Butane, an advanced synthetics protocol." + }, + "social_links": { + "website": "https://butane.dev", + "discord": "https://discord.gg/butane", + "telegram": "https://t.me/butaneprotocol", + "twitter": "https://twitter.com/butaneprotocol" + } + }, + "total_supply": 25000000, + "circulating_supply": 12432701.092661, + "created_at": "2024-02-22T14:03:08.000Z", + "created_tx_id": "c2d43135e34981fcb9a5db3d9b189c81d278adadc9940967f93980f8ee2b7074", + "categories": [ + "DeFi" + ], + "price": 0.05475648065168212, + "price_change_1h": 0.25619128949616055, + "price_change_24h": -3.539488320210792, + "price_change_7d": -32.212313963662844, + "volume_1h": 0, + "volume_24h": 150.8735360716138, + "volume_7d": 55897.59149512404, + "liquidity": 182029.9901877545, + "market_cap": 680770.9568284391, + "fully_diluted": 1368912.016292053 +} +``` +### 3. Get Asset Price Candlestick +**GET:** `v1/assets/${id}/price/candlestick` +**Description:** Returns historical candlestick (OHLC) price data for a specific asset, supporting custom time ranges and resolutions + +#### Request Parameters +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| id | string | Yes | - | The id parameter is a required string that uniquely identifies the asset for which metrics are being requested | +| start_time | number | NO | - | The Unix timestamp (in seconds) marking the start of the time range for the candlestick data. | +| end_time | number | NO | - | The Unix timestamp (in seconds) marking the end of the time range for the candlestick data. | +| limit | number | NO | `500` | Max results (min: `1`, max: `1000`) | +| interval | string | | - | The time interval for each candlestick (e.g., 1T, 1s, 1m, 1D, 1W, 1M). | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | + +**Supported Intervals:** +- Minutes: `1m`, `5m`, `15m`, `30m` +- Hours: `1h`, `2h`, `4h`, `6h`, `12h` +- Days/Weeks/Months: `1d`, `1w`, `1M` +#### Request Response +```typescript + Ohlcv = { + open: number; + high: number; + low: number; + close: number; + volume: number; + timestamp: number; +} +``` +#### Example + +```bash +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa4e49474854/price/candlestick?end_time=1766028002000&interval=15m¤cy=usd' +``` +```json +[ { - "currency_symbol": "", - "token_name": "", - "is_verified": true, - "metadata": { - "decimals": 6, - "name": "Cardano", - "ticker": "ADA" - } + "open": 0.05150856356161587, + "high": 0.05150856356161587, + "low": 0.05047932810976648, + "close": 0.050701693758410896, + "volume": 50724.16443664555, + "timestamp": 1765578600000 }, { - "currency_symbol": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad", - "token_name": "0014df105553444d", - "is_verified": true, - "metadata": { - "name": "USDM", - "url": "https://moneta.global/", - "ticker": "USDM", - "decimals": 6, - "description": "Fiat-backed stablecoin native to the Cardano blockchain" - } + "open": 0.05093382373126923, + "high": 0.05093382373126923, + "low": 0.05030821733861369, + "close": 0.050525200451240655, + "volume": 26361.171205892428, + "timestamp": 1765579500000 + } +] +``` +### 4. Get Asset Price Timeseries +**GET:** `v1/assets/${id}/price/timeseries` +**Description:** + +#### Request Body +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| id | string | Yes | - | The id parameter is a required string that uniquely identifies the asset for which metrics are being requested | +| period | string | Yes | - | The period parameter specifies the time interval (`TimeSeriesPeriod`) over which the asset’s price timeseries data is aggregated and returned | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | +#### Request Response + +```typescript +type AssetTimeseriesPriceResponse = { + value: number; + timestamp: number; +}[]; +``` +#### Example + +```bash +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/016be5325fd988fea98ad422fcfd53e5352cacfced5c106a932a35a4.42544e/price/timeseries?period=1w¤cy=usd' +``` +```json +[ + { + "value": 0.21675761701343657, + "timestamp": 1766476800000 }, - ] + { + "value": 0.21675761701343657, + "timestamp": 1766491200000 + } +] +``` +### 5. Get Asset Similar +**GET:** `v1/assets/${id}/similars` +**Description:** + +#### Request Parameters +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| id | string | Yes | - | The id parameter is a required string that uniquely identifies the asset for which metrics are being requested | +| limit | number | No | - | Number of results will be returned | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | +#### Request Response + +```typescript +type SimilarAssetsParams = { + id: string; + limit?: number; + currency?: DisplayCurrency; } ``` +#### Example + +```bash +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/016be5325fd988fea98ad422fcfd53e5352cacfced5c106a932a35a442544e/similars?only_verified=true&limit=2¤cy=vnd' +``` + +```json +[ + { + "asset": { + "currency_symbol": "0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa", + "token_name": "4e49474854", + "is_verified": true, + "metadata": { + "name": "NIGHT", + "url": "https://midnight.network", + "ticker": "NIGHT", + "decimals": 6, + "description": "NIGHT is Midnight’s utility token whose main function is to generate DUST, the resource used to execute transactions on the Midnight network. It is intended that NIGHT will also be used for block production rewards, ecosystem growth incentives, and on-chain governance in relation to the Midnight network. One unit of NIGHT is further divided into one million subunits called STARs." + } + }, + "total_supply": 0, + "circulating_supply": 0, + "created_at": "2025-11-25T22:00:10.000Z", + "created_tx_id": "ce75b0e1e203c66d5dbce3b37865114163f577a58d3d12b0ae2593f8d3a64eb2", + "categories": [ + "DeFi" + ], + "price": 2522.7611778052687, + "price_change_1h": -0.958874771493212, + "price_change_24h": 7.828716517531677, + "price_change_7d": 14.642652331793157, + "volume_1h": 1409706290.737956, + "volume_24h": 89717557686.68806, + "volume_7d": 758455950639.8641, + "liquidity": 143995829160.62665, + "market_cap": 0, + "fully_diluted": 0 + }, + { + "asset": { + "currency_symbol": "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6", + "token_name": "4d494e", + "is_verified": true, + "metadata": { + "name": "Minswap", + "url": "https://minswap.org/", + "ticker": "MIN", + "decimals": 6, + "description": "Minswap is a multi-pool decentralize exchange protocol on Cardano" + } + }, + "total_supply": 2498206975.845323, + "circulating_supply": 1756617778.454461, + "created_at": "2021-10-10T10:17:49.000Z", + "created_tx_id": "78e5821367cd4e2fbfce4d32c3ecededd388f13118f06b959015c2aad19b5cd8", + "categories": [ + "DeFi" + ], + "price": 222.573317783584, + "price_change_1h": -0.007542462927113619, + "price_change_24h": -0.9105384285602564, + "price_change_7d": -6.300857142712838, + "volume_1h": 217669.4406669727, + "volume_24h": 880820878.5427129, + "volume_7d": 10552387706.27257, + "liquidity": 55239699272.47354, + "market_cap": 390976247028.23816, + "fully_diluted": 556034215123.9875 + } +] +``` ## Pools APIs @@ -185,97 +501,106 @@ Pools APIs provide comprehensive data about liquidity pools, including metrics, | sort_direction | string | No | - | Sort order: `asc` or `desc` | | sort_field | string | No | - | Sort by: `volume_usd_24h`, `volume_usd_7d`, or `liquidity_usd` | | protocols | string[] | No | All | Filter by protocol: `Minswap`, `MinswapV2`, `MinswapStable` | - +| favorite_pool_ids | string[] | No | - | Parameter is an optional array of pool IDs used to filter and prioritize results for pools marked as favorites by the user | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | #### Request Response ```typescript type Response = { search_after: string[], - pool_metrics: PoolMetric[] + pool_metrics: RestPoolMetrics[] } -type PoolMetric = { - lp_asset: Token, - asset_a: Token, - asset_b: Token, - type: Protocol, - volume_usd_24h: number, - volume_usd_7d: number, - liquidity_usd: number, - liquidity_a_usd: number, - liquidity_b_usd: number, - liquidity: number, - liquidity_a: number, - liquidity_b: number, - trading_fee_usd_24h: number, - trading_fee_usd_7d: number, - trading_fee_tier: number[], // Fee tiers [asset_a_fee, asset_b_fee] - trading_fee_apr: number +type RestPoolMetrics = { + lp_asset: Token; + type: Protocol; + asset_a: Token; + asset_b: Token; + liquidity_raw: number; + liquidity_a_raw: number; + liquidity_b_raw: number; + trading_fee_tier: number[]; + trading_fee_apr?: number; + volume_24h: number; + volume_7d: number; + trading_fee_24h: number; + trading_fee_7d: number; + liquidity: number; + liquidity_a: number; + liquidity_b: number; } ``` #### Example ```bash -curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/metrics' \ +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/metrics' \ +--header 'accept: application/json' \ --header 'Content-Type: application/json' \ ---data '{}' +--data '{ + "term": "", + "only_verified": true, + "limit": 1, + "sort_field": "liquidity", + "sort_direction": "desc", + "currency": "usd" +}' ``` ```json { - "search_after": [ - "504648.73646031605", - "f5808c2c990d86da54bfc97d89cee6efa20cd8461616359478d96b4c.a449f98fa06fff1d6c17b95c65ca609660049dc683cc3e94d3846b05419fc20d" - ], - "pool_metrics": [ - { - "lp_asset": { - "currency_symbol": "5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd6", - "token_name": "5553444d2d555344412d534c50", - "is_verified": false - }, - "type": "MinswapStable", - "asset_a": { - "currency_symbol": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad", - "token_name": "0014df105553444d", - "is_verified": true, - "metadata": { - "name": "USDM", - "url": "https://moneta.global/", - "ticker": "USDM", - "decimals": 6, - "description": "Fiat-backed stablecoin native to the Cardano blockchain" - } - }, - "asset_b": { - "currency_symbol": "fe7c786ab321f41c654ef6c1af7b3250a613c24e4213e0425a7ae456", - "token_name": "55534441", - "is_verified": true, - "metadata": { - "name": "USDA", - "url": "https://www.anzens.com", - "ticker": "USDA", - "decimals": 6, - "description": "Anzens USDA Stablecoin" - } - }, - "volume_usd_24h": 275887.6115451449, - "volume_usd_7d": 1096418.146131719, - "liquidity_usd": 11894141.900263073, - "liquidity_a_usd": 6371591.613676783, - "liquidity_b_usd": 5522550.286586288, - "liquidity": 11424797740483, - "liquidity_a": 6146880, - "liquidity_b": 5301950, - "trading_fee_usd_24h": 69.15013892473809, - "trading_fee_usd_7d": 274.5034984422627, - "trading_fee_tier": [ - 0.05, - 0.05 - ], - "trading_fee_apr": 0.5588071063497281 - } - ] + "search_after": [ + 10183179.86675752, + "5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd6.5553444d2d555344412d534c50" + ], + "pool_metrics": [ + { + "lp_asset": { + "currency_symbol": "5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd6", + "token_name": "5553444d2d555344412d534c50", + "is_verified": true + }, + "type": "MinswapStable", + "asset_a": { + "currency_symbol": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad", + "token_name": "0014df105553444d", + "is_verified": true, + "metadata": { + "name": "USDM", + "url": "https://moneta.global/", + "ticker": "USDM", + "decimals": 6, + "description": "Fiat-backed stablecoin native to the Cardano blockchain" + } + }, + "asset_b": { + "currency_symbol": "fe7c786ab321f41c654ef6c1af7b3250a613c24e4213e0425a7ae456", + "token_name": "55534441", + "is_verified": true, + "metadata": { + "name": "USDA", + "url": "https://www.anzens.com", + "ticker": "USDA", + "decimals": 6, + "description": "Anzens USDA Stablecoin" + } + }, + "trading_fee_tier": [ + 0.05, + 0.05 + ], + "trading_fee_apr": 0.3437032224976275, + "liquidity_raw": 10053890543674, + "liquidity_a_raw": 5393732.846663, + "liquidity_b_raw": 4683667.353299, + "volume_24h": 294243.8992270554, + "volume_7d": 2042834.6864464958, + "liquidity": 10183179.86675752, + "liquidity_a": 5409159.8695964, + "liquidity_b": 4774019.997161119, + "trading_fee_24h": 73.6453803607475, + "trading_fee_7d": 511.1735333229008 + } + ] } ``` @@ -290,79 +615,83 @@ curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/metrics' \ | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | id | string | Yes | Pool identifier (LP asset in format: `{policy_id}.{token_name}` or `{policy_id}{token_name}`) | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | + #### Request Response -```ts -type Response = { - lp_asset: Token, - asset_a: Token, - asset_b: Token, - type: Protocol, - volume_usd_24h: number, - volume_usd_7d: number, - liquidity_usd: number, - liquidity_a_usd: number, - liquidity_b_usd: number, - liquidity: number, - liquidity_a: number, - liquidity_b: number, - trading_fee_usd_24h: number, - trading_fee_usd_7d: number, - trading_fee_tier: number[], // [trading_fee_tier_a, trading_fee_tier_b] - trading_fee_apr: number +```typescript +type RestPoolMetrics = { + lp_asset: Token; + type: Protocol; + asset_a: Token; + asset_b: Token; + liquidity_raw: number; + liquidity_a_raw: number; + liquidity_b_raw: number; + trading_fee_tier: number[]; + trading_fee_apr?: number; + volume_24h: number; + volume_7d: number; + trading_fee_24h: number; + trading_fee_7d: number; + liquidity: number; + liquidity_a: number; + liquidity_b: number; } ``` #### Example ```bash -curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/f5808c2c990d86da54bfc97d89cee6efa20cd8461616359478d96b4c.82e2b1fd27a7712a1a9cf750dfbea1a5778611b20e06dd6a611df7a643f8cb75/metrics' +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd65553444d2d555344412d534c50/metrics?currency=usd' ``` ```json { - "lp_asset": { - "currency_symbol": "f5808c2c990d86da54bfc97d89cee6efa20cd8461616359478d96b4c", - "token_name": "82e2b1fd27a7712a1a9cf750dfbea1a5778611b20e06dd6a611df7a643f8cb75", - "is_verified": false - }, - "type": "MinswapV2", - "asset_a": { - "currency_symbol": "", - "token_name": "", - "is_verified": true, - "metadata": { - "decimals": 6, - "name": "Cardano", - "ticker": "ADA" - } - }, - "asset_b": { - "currency_symbol": "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6", - "token_name": "4d494e", - "is_verified": true, - "metadata": { - "name": "Minswap", - "url": "https://minswap.org/", - "ticker": "MIN", - "decimals": 6, - "description": "Minswap is a multi-pool decentralize exchange protocol on Cardano" - } - }, - "volume_usd_24h": 33450.56473381408, - "volume_usd_7d": 414577.06098515296, - "liquidity_usd": 4014574.127954561, - "liquidity_a_usd": 2007287.0639772804, - "liquidity_b_usd": 2007287.0639772804, - "liquidity": 31904344470140, - "liquidity_a": 4959938, - "liquidity_b": 214384918, - "trading_fee_usd_24h": 146.6456692739724, - "trading_fee_usd_7d": 1275.4345738452926, - "trading_fee_tier": [ - 0.3, - 1 - ], - "trading_fee_apr": 2.714538755500508 + "lp_asset": { + "currency_symbol": "5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd6", + "token_name": "5553444d2d555344412d534c50", + "is_verified": true + }, + "type": "MinswapStable", + "asset_a": { + "currency_symbol": "c48cbb3d5e57ed56e276bc45f99ab39abe94e6cd7ac39fb402da47ad", + "token_name": "0014df105553444d", + "is_verified": true, + "metadata": { + "name": "USDM", + "url": "https://moneta.global/", + "ticker": "USDM", + "decimals": 6, + "description": "Fiat-backed stablecoin native to the Cardano blockchain" + } + }, + "asset_b": { + "currency_symbol": "fe7c786ab321f41c654ef6c1af7b3250a613c24e4213e0425a7ae456", + "token_name": "55534441", + "is_verified": true, + "metadata": { + "name": "USDA", + "url": "https://www.anzens.com", + "ticker": "USDA", + "decimals": 6, + "description": "Anzens USDA Stablecoin" + } + }, + "trading_fee_tier": [ + 0.05, + 0.05 + ], + "trading_fee_apr": 0.3436275699948192, + "liquidity_raw": 10053890543674, + "liquidity_a_raw": 5393732.846663, + "liquidity_b_raw": 4683667.353299, + "volume_24h": 294243.8992270554, + "volume_7d": 2020489.306139798, + "liquidity": 10183179.86675752, + "liquidity_a": 5409159.8695964, + "liquidity_b": 4774019.997161119, + "trading_fee_24h": 73.6453803607475, + "trading_fee_7d": 505.84438543787957 } ``` @@ -376,16 +705,12 @@ curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/f5808c2c990d86da5 | Parameter | Type | Required | Description | |-----------|------|----------|-------------| -| id | string | Yes | Pool identifier (LP asset) | - -#### Request Query - -| Parameter | Type | Required | Default | Description | -|-----------|------|----------|---------|-------------| -| interval | string | **Yes** | - | Candlestick interval (see supported intervals below) | -| start_time | number | No | 1 year ago | Start timestamp in milliseconds | -| end_time | number | No | Current time | End timestamp in milliseconds | -| limit | number | No | `500` | Max results (min: `1`, max: `1000`) | +| poolId | string | Yes | Pool identifier (LP asset) | +| start_time | number | NO | - | The Unix timestamp (in seconds) marking the start of the time range for the candlestick data. | +| end_time | number | NO | - | The Unix timestamp (in seconds) marking the end of the time range for the candlestick data. | +| limit | number | NO | `500` | Max results (min: `1`, max: `1000`) | +| interval | string | | - | The time interval for each candlestick (e.g., 1T, 1s, 1m, 1D, 1W, 1M). | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | **Supported Intervals:** - Minutes: `1m`, `5m`, `15m`, `30m` @@ -397,48 +722,40 @@ curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/f5808c2c990d86da5 ```typescript type Response = Candlestick[] -type Candlestick = { - open: number, - high: number, - low: number, - close: number, - volume: number, - timestamp: number +type Ohlcv = { + open: number; + high: number; + low: number; + close: number; + volume: number; + timestamp: number; } ``` **Note:** Results are sorted by timestamp in ascending order. #### Example ```bash -curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd6.5553444d2d555344412d534c50/price/candlestick?interval=1w' +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd65553444d2d555344412d534c50/price/candlestick?currency=usd&interval=1d' ``` ```json [ - { - "open": 1, - "high": 1.0006422551006466, - "low": 0.982164538002603, - "close": 0.9985817609540729, - "volume": 1162928.645893875, - "timestamp": 1740960000000 - }, - { - "open": 0.9991815087622149, - "high": 1.003046739205926, - "low": 0.9884252565466588, - "close": 1.0004556637397555, - "volume": 1983393.985634902, - "timestamp": 1741564800000 - }, - { - "open": 1.0005697563181883, - "high": 1.0032710788557815, - "low": 0.9938494885491757, - "close": 0.994448078550209, - "volume": 1197875.7042322678, - "timestamp": 1742169600000 - } + { + "open": 1, + "high": 1, + "low": 0.9974800585016822, + "close": 0.9975013544595096, + "volume": 19302.254052164284, + "timestamp": 1741219200000 + }, + { + "open": 0.9961873940063273, + "high": 0.9979189703516822, + "low": 0.982164538002603, + "close": 0.9943174251922641, + "volume": 621299.6639291946, + "timestamp": 1741305600000 + } ] ``` @@ -458,15 +775,7 @@ curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72c | Parameter | Type | Required | Description | |-----------|------|----------|-------------| -| period | string | **Yes** | Time period to retrieve data for | - -**Supported Periods:** -- `1d` - Last 24 hours -- `1w` - Last 7 days -- `1M` - Last 30 days -- `6M` - Last 6 months -- `1y` - Last 12 months -- `all` - All available data +| period | string | Yes | - | The period parameter specifies the time interval (`TimeSeriesPeriod`) over which the pool’s price timeseries data is aggregated and returned | #### Request Response @@ -502,6 +811,102 @@ curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72c } ] ``` +### 5. Get Pool Volume Timeseries +**GET:** `v1/pools/${id}/volume/timeseries` +**Description:** + +#### Request Body +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| id | string | Yes | - | The id parameter is a required string that uniquely identifies the pool for which metrics are being requested | +| period | string | Yes | - | The period parameter specifies the time interval (`TimeSeriesPeriod`) over which the pool’s price timeseries data is aggregated and returned | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | +#### Request Response + +```typescript +type PoolTimeseriesVolumeResponse = { + value: number; + timestamp: number; +}[] +``` + +#### Example + +```bash +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd65553444d2d555344412d534c50/price/timeseries?period=1d' +``` + +```json +[ + { + "value": 1.0152826272926845, + "timestamp": 1767002400000 + }, + { + "value": 1.0152096048405934, + "timestamp": 1767004200000 + } +] +``` +### 6. Get Pool TVL Timeseries +**GET:** `v1/pools/${id}/tvl/timeseries` +**Description:** + +#### Request Body +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| id | string | Yes | - | The id parameter is a required string that uniquely identifies the pool for which metrics are being requested | +| period | string | Yes | - | The period parameter specifies the time interval (`TimeSeriesPeriod`) over which the pool’s price timeseries data is aggregated and returned | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | +#### Request Response + +```typescript +type PoolTimeseriesTvlResponse = { + value: number; + timestamp: number; +}[] +``` + +#### Example + +```bash +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd6.5553444d2d555344412d534c50/tvl/timeseries?period=1w¤cy=usd' +``` + +```json +[ + { + "value": 27414288.316657227, + "timestamp": 1766476800000 + }, + { + "value": 28325724.627680056, + "timestamp": 1766491200000 + } +] +``` +### 7. Get Pool Fee Timeseries +**GET:** `v1/assets/${id}/price/timeseries` +**Description:** + +#### Request Body +| Parameter | Type | Required | Default | Description | +|-----------|------|----------|---------|-------------| +| id | string | Yes | - | The id parameter is a required string that uniquely identifies the pool for which metrics are being requested | +| period | string | Yes | - | The period parameter specifies the time interval (`TimeSeriesPeriod`) over which the pool’s price timeseries data is aggregated and returned | +| currency | string | No | - | If not specified, defaults to ADA. Supported currencies are listed in `SupportedCurrency` | +#### Request Response + +```typescript +``` + +#### Example + +```bash +``` + +```json +``` From a51e45994e5b03146f6320170b976e1598f64714 Mon Sep 17 00:00:00 2001 From: Nguyen Khai Date: Wed, 31 Dec 2025 11:58:52 +0700 Subject: [PATCH 2/2] update Minswap APIs --- developer/minswap-apis.md | 130 ++++++++++++++++++++++++++++++++------ 1 file changed, 112 insertions(+), 18 deletions(-) diff --git a/developer/minswap-apis.md b/developer/minswap-apis.md index 73ef464..e6f08b3 100644 --- a/developer/minswap-apis.md +++ b/developer/minswap-apis.md @@ -201,7 +201,7 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/metrics' \ } ``` ### 2. Get Asset Metrics -**GET:** `v1/assets/${id}/metrics` +**GET:** `v1/assets/:id/metrics` **Description:** Retrieves detailed metrics for a specific asset by its ID, optionally filtered by display currency. It returns comprehensive asset statistics such as volume, liquidity, and price data for use in analytics or UI display. #### Request Parameter @@ -300,7 +300,7 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/016be5325fd } ``` ### 3. Get Asset Price Candlestick -**GET:** `v1/assets/${id}/price/candlestick` +**GET:** `v1/assets/:id/price/candlestick` **Description:** Returns historical candlestick (OHLC) price data for a specific asset, supporting custom time ranges and resolutions #### Request Parameters @@ -354,7 +354,7 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/0691b2fecca ] ``` ### 4. Get Asset Price Timeseries -**GET:** `v1/assets/${id}/price/timeseries` +**GET:** `v1/assets/:id/price/timeseries` **Description:** #### Request Body @@ -389,7 +389,7 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/016be5325fd ] ``` ### 5. Get Asset Similar -**GET:** `v1/assets/${id}/similars` +**GET:** `v1/assets/:id/similars` **Description:** #### Request Parameters @@ -401,10 +401,45 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/assets/016be5325fd #### Request Response ```typescript -type SimilarAssetsParams = { - id: string; - limit?: number; - currency?: DisplayCurrency; +type RestAssetMetrics = { + asset: RestAssetMetadata; + price_change_1h: number; + price_change_24h: number; + price_change_7d: number; + volume_1h: number; + volume_24h: number; + volume_7d: number; + total_supply: number; + circulating_supply: number; + created_at?: string; + created_tx_id?: string; + categories?: string[]; + price: number; + liquidity: number; + market_cap: number; + fully_diluted: number; +} + +type RestAssetMetadata = { + currency_symbol: string; + token_name: string; + is_verified: boolean; + metadata?: { + decimals: number; + name?: string; + url?: string; + ticker?: string; + description?: string; + logo?: string; + }; + social_links?: { + website?: string; + discord?: string; + telegram?: string; + twitter?: string; + coingecko?: string; + coin_market_cap?: string; + }; } ``` #### Example @@ -513,10 +548,10 @@ type Response = { } type RestPoolMetrics = { - lp_asset: Token; + lp_asset: RestAssetMetadata; type: Protocol; - asset_a: Token; - asset_b: Token; + asset_a: RestAssetMetadata; + asset_b: RestAssetMetadata; liquidity_raw: number; liquidity_a_raw: number; liquidity_b_raw: number; @@ -530,6 +565,28 @@ type RestPoolMetrics = { liquidity_a: number; liquidity_b: number; } + +type RestAssetMetadata = { + currency_symbol: string; + token_name: string; + is_verified: boolean; + metadata?: { + decimals: number; + name?: string; + url?: string; + ticker?: string; + description?: string; + logo?: string; + }; + social_links?: { + website?: string; + discord?: string; + telegram?: string; + twitter?: string; + coingecko?: string; + coin_market_cap?: string; + }; +} ``` #### Example ```bash @@ -621,10 +678,10 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/metrics' \ #### Request Response ```typescript type RestPoolMetrics = { - lp_asset: Token; + lp_asset: RestAssetMetadata; type: Protocol; - asset_a: Token; - asset_b: Token; + asset_a: RestAssetMetadata; + asset_b: RestAssetMetadata; liquidity_raw: number; liquidity_a_raw: number; liquidity_b_raw: number; @@ -638,6 +695,28 @@ type RestPoolMetrics = { liquidity_a: number; liquidity_b: number; } + +type RestAssetMetadata = { + currency_symbol: string; + token_name: string; + is_verified: boolean; + metadata?: { + decimals: number; + name?: string; + url?: string; + ticker?: string; + description?: string; + logo?: string; + }; + social_links?: { + website?: string; + discord?: string; + telegram?: string; + twitter?: string; + coingecko?: string; + coin_market_cap?: string; + }; +} ``` #### Example @@ -720,7 +799,7 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8f #### Request Response ```typescript -type Response = Candlestick[] +type Response = Ohlcv[] type Ohlcv = { open: number; @@ -812,7 +891,7 @@ curl --location 'https://api-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72c ] ``` ### 5. Get Pool Volume Timeseries -**GET:** `v1/pools/${id}/volume/timeseries` +**GET:** `v1/pools/:id/volume/timeseries` **Description:** #### Request Body @@ -849,7 +928,7 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8f ] ``` ### 6. Get Pool TVL Timeseries -**GET:** `v1/pools/${id}/tvl/timeseries` +**GET:** `v1/pools/:id/tvl/timeseries` **Description:** #### Request Body @@ -886,7 +965,7 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8f ] ``` ### 7. Get Pool Fee Timeseries -**GET:** `v1/assets/${id}/price/timeseries` +**GET:** `v1/pools/:id/fees/timeseries` **Description:** #### Request Body @@ -898,14 +977,29 @@ curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8f #### Request Response ```typescript +type PoolTimeseriesFeesResponse = { + value: number; + timestamp: number; +}[] ``` #### Example ```bash +curl --location 'https://monorepo-mainnet-prod.minswap.org/v1/pools/5f0d38b3eb8fea72cd3cbdaa9594a74d0db79b5a27e85be5e9015bd6.5553444d2d555344412d534c50/fees/timeseries?period=1d¤cy=usd' ``` ```json +[ + { + "value": 0, + "timestamp": 1767060000000 + }, + { + "value": 0.9978481459422092, + "timestamp": 1767061800000 + } +] ```