@guiie/buda-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.github/workflows/publish.yml +58 -0
  2. package/PUBLISH.md +206 -0
  3. package/README.md +122 -0
  4. package/dist/client.d.ts +18 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +52 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +23 -0
  10. package/dist/tools/markets.d.ts +4 -0
  11. package/dist/tools/markets.d.ts.map +1 -0
  12. package/dist/tools/markets.js +22 -0
  13. package/dist/tools/orderbook.d.ts +4 -0
  14. package/dist/tools/orderbook.d.ts.map +1 -0
  15. package/dist/tools/orderbook.js +28 -0
  16. package/dist/tools/ticker.d.ts +4 -0
  17. package/dist/tools/ticker.d.ts.map +1 -0
  18. package/dist/tools/ticker.js +15 -0
  19. package/dist/tools/trades.d.ts +4 -0
  20. package/dist/tools/trades.d.ts.map +1 -0
  21. package/dist/tools/trades.js +32 -0
  22. package/dist/tools/volume.d.ts +4 -0
  23. package/dist/tools/volume.d.ts.map +1 -0
  24. package/dist/tools/volume.js +15 -0
  25. package/dist/types.d.ts +61 -0
  26. package/dist/types.d.ts.map +1 -0
  27. package/dist/types.js +4 -0
  28. package/marketplace/README.md +67 -0
  29. package/marketplace/claude-listing.md +97 -0
  30. package/marketplace/cursor-mcp.json +9 -0
  31. package/marketplace/gemini-tools.json +87 -0
  32. package/marketplace/openapi.yaml +349 -0
  33. package/package.json +53 -0
  34. package/server.json +20 -0
  35. package/src/client.ts +57 -0
  36. package/src/index.ts +26 -0
  37. package/src/tools/markets.ts +35 -0
  38. package/src/tools/orderbook.ts +40 -0
  39. package/src/tools/ticker.ts +25 -0
  40. package/src/tools/trades.ts +45 -0
  41. package/src/tools/volume.ts +25 -0
  42. package/src/types.ts +84 -0
  43. package/test/run-all.ts +144 -0
  44. package/tsconfig.json +17 -0
@@ -0,0 +1,61 @@
1
+ export type Amount = [string, string];
2
+ export interface Market {
3
+ id: string;
4
+ name: string;
5
+ base_currency: string;
6
+ quote_currency: string;
7
+ minimum_order_amount: Amount;
8
+ taker_fee: string;
9
+ maker_fee: string;
10
+ max_orders_per_minute: number;
11
+ maker_discount_percentage: string;
12
+ taker_discount_percentage: string;
13
+ maker_discount_tiers: Record<string, number>;
14
+ taker_discount_tiers: Record<string, number>;
15
+ }
16
+ export interface MarketsResponse {
17
+ markets: Market[];
18
+ }
19
+ export interface MarketResponse {
20
+ market: Market;
21
+ }
22
+ export interface Ticker {
23
+ market_id: string;
24
+ last_price: Amount;
25
+ min_ask: Amount;
26
+ max_bid: Amount;
27
+ volume: Amount;
28
+ price_variation_24h: string;
29
+ price_variation_7d: string;
30
+ }
31
+ export interface TickerResponse {
32
+ ticker: Ticker;
33
+ }
34
+ export interface OrderBook {
35
+ asks: [string, string][];
36
+ bids: [string, string][];
37
+ }
38
+ export interface OrderBookResponse {
39
+ order_book: OrderBook;
40
+ }
41
+ export interface Trades {
42
+ timestamp: string;
43
+ last_timestamp: string;
44
+ market_id: string;
45
+ /** Each entry: [timestamp, amount, price, direction] */
46
+ entries: [string, string, string, string][];
47
+ }
48
+ export interface TradesResponse {
49
+ trades: Trades;
50
+ }
51
+ export interface MarketVolume {
52
+ market_id: string;
53
+ ask_volume_24h: Amount;
54
+ ask_volume_7d: Amount;
55
+ bid_volume_24h: Amount;
56
+ bid_volume_7d: Amount;
57
+ }
58
+ export interface VolumeResponse {
59
+ volume: MarketVolume;
60
+ }
61
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAItC,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACzB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,SAAS,CAAC;CACvB;AAID,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAID,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,YAAY,CAAC;CACtB"}
package/dist/types.js ADDED
@@ -0,0 +1,4 @@
1
+ // Buda.com REST API v2 — shared response types
2
+ // All monetary amounts are returned as [amount_string, currency_string] tuples.
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,67 @@
1
+ # Marketplace Submission Assets
2
+
3
+ Ready-to-use assets for submitting buda-mcp to every major AI marketplace.
4
+ Replace `gtorreal` / `gtorreal` with your actual handles before submitting.
5
+
6
+ ---
7
+
8
+ ## `cursor-mcp.json` — Cursor
9
+
10
+ Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per project).
11
+ Uses `npx` so users don't need to clone the repo.
12
+
13
+ **PR submission:** Open a PR against the [Cursor MCP directory](https://github.com/getcursor/cursor) following their contribution guide. Include this file and a link to the npm package.
14
+
15
+ ---
16
+
17
+ ## `claude-listing.md` — Claude / Anthropic MCP Registry
18
+
19
+ Paste this content into the Anthropic MCP server submission form, or use it as the
20
+ body of a GitHub issue on the [modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers) repo.
21
+
22
+ For the official registry (`registry.modelcontextprotocol.io`), the listing is generated
23
+ automatically from `server.json` via `mcp-publisher` — see the main README for those steps.
24
+
25
+ ---
26
+
27
+ ## `openapi.yaml` — ChatGPT GPT Actions
28
+
29
+ Used to register buda-mcp as a ChatGPT Action inside a custom GPT.
30
+
31
+ **Steps:**
32
+ 1. Deploy the server over HTTP:
33
+ ```bash
34
+ pip install mcp-proxy
35
+ mcp-proxy --port 8000 -- npx -y @guiie/buda-mcp
36
+ ```
37
+ 2. Replace `https://YOUR_DEPLOYED_DOMAIN` in `openapi.yaml` with your public URL.
38
+ 3. In the GPT editor → "Actions" → "Add action" → paste the YAML.
39
+ 4. Set authentication to "None".
40
+
41
+ For production, deploy to Railway, Fly.io, or Render so the URL is stable.
42
+
43
+ ---
44
+
45
+ ## `gemini-tools.json` — Gemini API / Google AI Studio
46
+
47
+ Paste the `functionDeclarations` array into your Gemini API call:
48
+
49
+ ```python
50
+ import google.generativeai as genai
51
+ import json
52
+
53
+ with open("gemini-tools.json") as f:
54
+ tool_config = json.load(f)
55
+
56
+ model = genai.GenerativeModel(
57
+ model_name="gemini-2.0-flash",
58
+ tools=[{"function_declarations": tool_config["functionDeclarations"]}],
59
+ )
60
+ ```
61
+
62
+ For **Google AI Studio**, go to *System instructions → Tools → Add function* and paste
63
+ each `functionDeclaration` object individually.
64
+
65
+ For the **Gemini marketplace / Extensions** (once generally available), submit via the
66
+ [Google AI Extensions portal](https://ai.google.dev/) using these declarations as the
67
+ tool schema.
@@ -0,0 +1,97 @@
1
+ # Buda.com Market Data
2
+
3
+ **Category:** Finance / Cryptocurrency
4
+ **Auth:** None required
5
+ **Transport:** stdio
6
+ **npm:** `@guiie/buda-mcp`
7
+ **Registry name:** `io.github.gtorreal/buda-mcp`
8
+
9
+ ---
10
+
11
+ ## Description
12
+
13
+ Real-time market data from [Buda.com](https://www.buda.com/), the leading cryptocurrency exchange operating in Chile, Colombia, and Peru. All data is sourced from Buda's public REST API v2 — no API key required.
14
+
15
+ Use this server to query live prices, order books, trade history, and volume for all BTC, ETH, and altcoin markets quoted in CLP, COP, and PEN.
16
+
17
+ ---
18
+
19
+ ## Tools
20
+
21
+ ### `get_markets`
22
+ List all available trading pairs on Buda.com, or retrieve details for a specific market.
23
+ Returns: base/quote currencies, trading fees, minimum order amounts, fee discount tiers.
24
+ **Parameters:** `market_id` *(optional)* — e.g. `BTC-CLP`. Omit to list all 26 markets.
25
+
26
+ ### `get_ticker`
27
+ Current market snapshot: last traded price, best bid and ask, 24h volume, and price change over 24h and 7d.
28
+ **Parameters:** `market_id` *(required)* — e.g. `BTC-CLP`, `ETH-COP`, `ETH-BTC`.
29
+
30
+ ### `get_orderbook`
31
+ Full order book for a market: sorted bids and asks as `[price, amount]` pairs.
32
+ **Parameters:** `market_id` *(required)*, `limit` *(optional)* — cap levels returned per side.
33
+
34
+ ### `get_trades`
35
+ Recent trade history. Each entry: `[timestamp_ms, amount, price, direction]`.
36
+ **Parameters:** `market_id` *(required)*, `limit` *(optional, max 100)*, `timestamp` *(optional, for pagination)*.
37
+
38
+ ### `get_market_volume`
39
+ 24h and 7-day transacted volume broken down by buy (bid) and sell (ask) side.
40
+ **Parameters:** `market_id` *(required)*.
41
+
42
+ ---
43
+
44
+ ## Example prompts
45
+
46
+ - *"What is the current Bitcoin price in Chilean pesos?"*
47
+ - *"Show me the BTC-CLP order book — top 10 bids and asks."*
48
+ - *"How much ETH was traded on Buda in the last 7 days?"*
49
+ - *"List all markets available on Buda.com."*
50
+ - *"What's the spread on BTC-COP right now?"*
51
+
52
+ ---
53
+
54
+ ## Installation
55
+
56
+ **Claude Code (claude CLI)**
57
+ ```bash
58
+ claude mcp add buda-mcp -- npx -y @guiie/buda-mcp
59
+ ```
60
+
61
+ **Claude Desktop (`claude_desktop_config.json`)**
62
+ ```json
63
+ {
64
+ "mcpServers": {
65
+ "buda-mcp": {
66
+ "command": "npx",
67
+ "args": ["-y", "@guiie/buda-mcp"]
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ **From source**
74
+ ```bash
75
+ git clone https://github.com/gtorreal/buda-mcp.git
76
+ cd buda-mcp && npm install && npm run build
77
+ # Then point to: node /absolute/path/buda-mcp/dist/index.js
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Markets covered
83
+
84
+ | Quote | Country | Sample pairs |
85
+ |---|---|---|
86
+ | CLP | Chile | BTC-CLP, ETH-CLP, XRP-CLP |
87
+ | COP | Colombia | BTC-COP, ETH-COP, XRP-COP |
88
+ | PEN | Peru | BTC-PEN, ETH-PEN |
89
+ | BTC | Cross | ETH-BTC, XRP-BTC, BCH-BTC |
90
+
91
+ ---
92
+
93
+ ## Source
94
+
95
+ - GitHub: https://github.com/gtorreal/buda-mcp
96
+ - npm: https://www.npmjs.com/package/@guiie/buda-mcp
97
+ - Buda.com API docs: https://api.buda.com/en/
@@ -0,0 +1,9 @@
1
+ {
2
+ "mcpServers": {
3
+ "buda-mcp": {
4
+ "command": "npx",
5
+ "args": ["-y", "@guiie/buda-mcp"],
6
+ "description": "Buda.com cryptocurrency exchange — real-time market data for Chile, Colombia, and Peru"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,87 @@
1
+ {
2
+ "_comment": "Gemini function declarations for buda-mcp. Pass this array as the `tools[0].functionDeclarations` field when calling the Gemini API. See: https://ai.google.dev/gemini-api/docs/function-calling",
3
+ "functionDeclarations": [
4
+ {
5
+ "name": "get_markets",
6
+ "description": "List all available cryptocurrency trading pairs on Buda.com (Chile, Colombia, Peru), or get details for a specific market. Returns base/quote currencies, maker/taker fees, and minimum order sizes.",
7
+ "parameters": {
8
+ "type": "OBJECT",
9
+ "properties": {
10
+ "market_id": {
11
+ "type": "STRING",
12
+ "description": "Optional market identifier such as 'BTC-CLP', 'ETH-BTC', or 'BTC-COP'. Case-insensitive. Omit to list all available markets."
13
+ }
14
+ },
15
+ "required": []
16
+ }
17
+ },
18
+ {
19
+ "name": "get_ticker",
20
+ "description": "Get the current market ticker for a Buda.com trading pair. Returns the last traded price, best bid (max_bid), best ask (min_ask), 24-hour volume, and price change percentage over 24 hours and 7 days.",
21
+ "parameters": {
22
+ "type": "OBJECT",
23
+ "properties": {
24
+ "market_id": {
25
+ "type": "STRING",
26
+ "description": "Market identifier such as 'BTC-CLP', 'ETH-COP', or 'ETH-BTC'. Case-insensitive."
27
+ }
28
+ },
29
+ "required": ["market_id"]
30
+ }
31
+ },
32
+ {
33
+ "name": "get_orderbook",
34
+ "description": "Get the current limit order book for a Buda.com market. Returns sorted arrays of bids (buy orders) and asks (sell orders). Each entry is a [price, amount] pair. Useful for analyzing market depth and calculating slippage.",
35
+ "parameters": {
36
+ "type": "OBJECT",
37
+ "properties": {
38
+ "market_id": {
39
+ "type": "STRING",
40
+ "description": "Market identifier such as 'BTC-CLP' or 'ETH-BTC'. Case-insensitive."
41
+ },
42
+ "limit": {
43
+ "type": "INTEGER",
44
+ "description": "Maximum number of price levels to return per side (bids and asks). Defaults to all levels if omitted."
45
+ }
46
+ },
47
+ "required": ["market_id"]
48
+ }
49
+ },
50
+ {
51
+ "name": "get_trades",
52
+ "description": "Get recent trade history for a Buda.com market. Each trade entry contains [timestamp_ms, amount, price, direction] where direction is 'buy' or 'sell'. Supports pagination via the timestamp parameter.",
53
+ "parameters": {
54
+ "type": "OBJECT",
55
+ "properties": {
56
+ "market_id": {
57
+ "type": "STRING",
58
+ "description": "Market identifier such as 'BTC-CLP' or 'ETH-BTC'. Case-insensitive."
59
+ },
60
+ "limit": {
61
+ "type": "INTEGER",
62
+ "description": "Number of trades to return. Default is 50, maximum is 100."
63
+ },
64
+ "timestamp": {
65
+ "type": "INTEGER",
66
+ "description": "Unix timestamp in seconds. When provided, returns trades that occurred before this timestamp, enabling pagination through historical data."
67
+ }
68
+ },
69
+ "required": ["market_id"]
70
+ }
71
+ },
72
+ {
73
+ "name": "get_market_volume",
74
+ "description": "Get 24-hour and 7-day transacted volume for a Buda.com market, broken down by side: ask_volume (sell orders) and bid_volume (buy orders). Amounts are in the market's base currency.",
75
+ "parameters": {
76
+ "type": "OBJECT",
77
+ "properties": {
78
+ "market_id": {
79
+ "type": "STRING",
80
+ "description": "Market identifier such as 'BTC-CLP', 'ETH-COP', or 'ETH-BTC'. Case-insensitive."
81
+ }
82
+ },
83
+ "required": ["market_id"]
84
+ }
85
+ }
86
+ ]
87
+ }
@@ -0,0 +1,349 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Buda.com Market Data API
4
+ description: |
5
+ Real-time cryptocurrency market data from Buda.com — the leading exchange
6
+ in Chile (CLP), Colombia (COP), and Peru (PEN).
7
+ Provides live prices, order books, trade history, and volume for all markets.
8
+ No authentication required.
9
+
10
+ **Note:** This spec describes a deployed HTTP wrapper around the buda-mcp
11
+ stdio server. Deploy locally with mcp-proxy:
12
+ mcp-proxy --port 8000 -- npx -y @guiie/buda-mcp
13
+ Or point `servers[0].url` at your hosted instance.
14
+ version: 1.0.0
15
+ contact:
16
+ url: https://github.com/gtorreal/buda-mcp
17
+
18
+ servers:
19
+ - url: https://YOUR_DEPLOYED_DOMAIN
20
+ description: Deployed buda-mcp HTTP instance
21
+
22
+ paths:
23
+ /get_markets:
24
+ get:
25
+ operationId: getMarkets
26
+ summary: List all trading pairs
27
+ description: |
28
+ Returns all available markets on Buda.com, or details for a single market.
29
+ Each market entry includes base/quote currencies, trading fees, and minimum order amounts.
30
+ parameters:
31
+ - name: market_id
32
+ in: query
33
+ required: false
34
+ description: |
35
+ Market identifier (e.g. "BTC-CLP", "ETH-BTC"). Case-insensitive.
36
+ Omit to return all markets.
37
+ schema:
38
+ type: string
39
+ example: BTC-CLP
40
+ responses:
41
+ "200":
42
+ description: Market list or single market details
43
+ content:
44
+ application/json:
45
+ schema:
46
+ oneOf:
47
+ - $ref: "#/components/schemas/MarketsResponse"
48
+ - $ref: "#/components/schemas/SingleMarketResponse"
49
+ "404":
50
+ $ref: "#/components/responses/NotFound"
51
+
52
+ /get_ticker:
53
+ get:
54
+ operationId: getTicker
55
+ summary: Current price and volume for a market
56
+ description: |
57
+ Returns the current market snapshot: last traded price, best bid (max_bid),
58
+ best ask (min_ask), 24h volume, and price change over 24h and 7d.
59
+ parameters:
60
+ - name: market_id
61
+ in: query
62
+ required: true
63
+ description: Market identifier (e.g. "BTC-CLP", "ETH-COP"). Case-insensitive.
64
+ schema:
65
+ type: string
66
+ example: BTC-CLP
67
+ responses:
68
+ "200":
69
+ description: Current ticker snapshot
70
+ content:
71
+ application/json:
72
+ schema:
73
+ $ref: "#/components/schemas/TickerResponse"
74
+ "404":
75
+ $ref: "#/components/responses/NotFound"
76
+
77
+ /get_orderbook:
78
+ get:
79
+ operationId: getOrderbook
80
+ summary: Order book for a market
81
+ description: |
82
+ Returns the current limit order book: sorted arrays of bids (buy orders)
83
+ and asks (sell orders). Each entry is [price, amount].
84
+ parameters:
85
+ - name: market_id
86
+ in: query
87
+ required: true
88
+ description: Market identifier (e.g. "BTC-CLP"). Case-insensitive.
89
+ schema:
90
+ type: string
91
+ example: BTC-CLP
92
+ - name: limit
93
+ in: query
94
+ required: false
95
+ description: Max number of price levels to return per side. Defaults to all.
96
+ schema:
97
+ type: integer
98
+ minimum: 1
99
+ example: 20
100
+ responses:
101
+ "200":
102
+ description: Order book bids and asks
103
+ content:
104
+ application/json:
105
+ schema:
106
+ $ref: "#/components/schemas/OrderBookResponse"
107
+ "404":
108
+ $ref: "#/components/responses/NotFound"
109
+
110
+ /get_trades:
111
+ get:
112
+ operationId: getTrades
113
+ summary: Recent trade history for a market
114
+ description: |
115
+ Returns recent trades. Each entry is [timestamp_ms, amount, price, direction]
116
+ where direction is "buy" or "sell".
117
+ parameters:
118
+ - name: market_id
119
+ in: query
120
+ required: true
121
+ description: Market identifier (e.g. "BTC-CLP"). Case-insensitive.
122
+ schema:
123
+ type: string
124
+ example: BTC-CLP
125
+ - name: limit
126
+ in: query
127
+ required: false
128
+ description: Number of trades to return (default 50, max 100).
129
+ schema:
130
+ type: integer
131
+ minimum: 1
132
+ maximum: 100
133
+ example: 50
134
+ - name: timestamp
135
+ in: query
136
+ required: false
137
+ description: |
138
+ Unix timestamp in seconds. Returns trades older than this value,
139
+ for pagination through history.
140
+ schema:
141
+ type: integer
142
+ example: 1712000000
143
+ responses:
144
+ "200":
145
+ description: Trade history
146
+ content:
147
+ application/json:
148
+ schema:
149
+ $ref: "#/components/schemas/TradesResponse"
150
+ "404":
151
+ $ref: "#/components/responses/NotFound"
152
+
153
+ /get_market_volume:
154
+ get:
155
+ operationId: getMarketVolume
156
+ summary: 24h and 7-day volume for a market
157
+ description: |
158
+ Returns transacted volume broken down by side (ask = sell, bid = buy)
159
+ and time window (24h and 7d). Amounts are in the market's base currency.
160
+ parameters:
161
+ - name: market_id
162
+ in: query
163
+ required: true
164
+ description: Market identifier (e.g. "BTC-CLP"). Case-insensitive.
165
+ schema:
166
+ type: string
167
+ example: BTC-CLP
168
+ responses:
169
+ "200":
170
+ description: Volume data
171
+ content:
172
+ application/json:
173
+ schema:
174
+ $ref: "#/components/schemas/VolumeResponse"
175
+ "404":
176
+ $ref: "#/components/responses/NotFound"
177
+
178
+ components:
179
+ schemas:
180
+ Amount:
181
+ type: array
182
+ description: Monetary amount as [value_string, currency_code]
183
+ items:
184
+ type: string
185
+ minItems: 2
186
+ maxItems: 2
187
+ example: ["65929908.0", "CLP"]
188
+
189
+ Market:
190
+ type: object
191
+ properties:
192
+ id:
193
+ type: string
194
+ example: BTC-CLP
195
+ name:
196
+ type: string
197
+ example: btc-clp
198
+ base_currency:
199
+ type: string
200
+ example: BTC
201
+ quote_currency:
202
+ type: string
203
+ example: CLP
204
+ minimum_order_amount:
205
+ $ref: "#/components/schemas/Amount"
206
+ taker_fee:
207
+ type: string
208
+ example: "0.8"
209
+ maker_fee:
210
+ type: string
211
+ example: "0.4"
212
+ max_orders_per_minute:
213
+ type: integer
214
+ example: 100
215
+ maker_discount_percentage:
216
+ type: string
217
+ taker_discount_percentage:
218
+ type: string
219
+
220
+ MarketsResponse:
221
+ type: object
222
+ properties:
223
+ markets:
224
+ type: array
225
+ items:
226
+ $ref: "#/components/schemas/Market"
227
+
228
+ SingleMarketResponse:
229
+ type: object
230
+ properties:
231
+ market:
232
+ $ref: "#/components/schemas/Market"
233
+
234
+ Ticker:
235
+ type: object
236
+ properties:
237
+ market_id:
238
+ type: string
239
+ example: BTC-CLP
240
+ last_price:
241
+ $ref: "#/components/schemas/Amount"
242
+ max_bid:
243
+ $ref: "#/components/schemas/Amount"
244
+ min_ask:
245
+ $ref: "#/components/schemas/Amount"
246
+ volume:
247
+ $ref: "#/components/schemas/Amount"
248
+ price_variation_24h:
249
+ type: string
250
+ description: Decimal fraction (e.g. "0.014" = +1.4%)
251
+ example: "0.014"
252
+ price_variation_7d:
253
+ type: string
254
+ example: "-0.032"
255
+
256
+ TickerResponse:
257
+ type: object
258
+ properties:
259
+ ticker:
260
+ $ref: "#/components/schemas/Ticker"
261
+
262
+ OrderBookResponse:
263
+ type: object
264
+ properties:
265
+ bids:
266
+ type: array
267
+ description: Buy orders sorted best-first, each [price, amount]
268
+ items:
269
+ type: array
270
+ items:
271
+ type: string
272
+ minItems: 2
273
+ maxItems: 2
274
+ asks:
275
+ type: array
276
+ description: Sell orders sorted best-first, each [price, amount]
277
+ items:
278
+ type: array
279
+ items:
280
+ type: string
281
+ minItems: 2
282
+ maxItems: 2
283
+ bid_count:
284
+ type: integer
285
+ description: Total number of bid levels in the full book
286
+ ask_count:
287
+ type: integer
288
+ description: Total number of ask levels in the full book
289
+
290
+ TradeEntry:
291
+ type: array
292
+ description: "[timestamp_ms, amount, price, direction]"
293
+ items:
294
+ type: string
295
+ minItems: 4
296
+ maxItems: 4
297
+ example: ["1775857164247", "0.00113757", "65929908.0", "buy"]
298
+
299
+ TradesResponse:
300
+ type: object
301
+ properties:
302
+ trades:
303
+ type: object
304
+ properties:
305
+ market_id:
306
+ type: string
307
+ example: BTC-CLP
308
+ timestamp:
309
+ type: string
310
+ description: Most recent trade timestamp (ms)
311
+ last_timestamp:
312
+ type: string
313
+ description: Oldest trade timestamp in this response (ms)
314
+ entries:
315
+ type: array
316
+ items:
317
+ $ref: "#/components/schemas/TradeEntry"
318
+
319
+ VolumeResponse:
320
+ type: object
321
+ properties:
322
+ volume:
323
+ type: object
324
+ properties:
325
+ market_id:
326
+ type: string
327
+ example: BTC-CLP
328
+ ask_volume_24h:
329
+ $ref: "#/components/schemas/Amount"
330
+ ask_volume_7d:
331
+ $ref: "#/components/schemas/Amount"
332
+ bid_volume_24h:
333
+ $ref: "#/components/schemas/Amount"
334
+ bid_volume_7d:
335
+ $ref: "#/components/schemas/Amount"
336
+
337
+ Error:
338
+ type: object
339
+ properties:
340
+ error:
341
+ type: string
342
+
343
+ responses:
344
+ NotFound:
345
+ description: Market not found
346
+ content:
347
+ application/json:
348
+ schema:
349
+ $ref: "#/components/schemas/Error"