> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xmonaco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# V0.5.3

# Monaco Protocol SDK v0.5.3

## Candlestick API Refactor & Market Metadata

This release refactors the candlestick API to use trading pair UUIDs and introduces TradingView-compliant query patterns, along with new market metadata capabilities.

### Breaking Changes

**Candlestick API Signature Change:**

The `getCandlesticks` method now requires a trading pair UUID instead of a symbol string, and uses an options object for parameters.

```typescript theme={null}
// Before (v0.5.2)
sdk.market.getCandlesticks("BTC-USDC", "1h", startTime, endTime);

// After (v0.5.3)
const pair = await sdk.market.getTradingPairBySymbol("BTC-USDC");
sdk.market.getCandlesticks(pair.id, "1h", { startTime, endTime, limit: 350 });
```

### New Features

**Flexible Candlestick Queries:**

* Optional `startTime`, `endTime`, and `limit` parameters via `GetCandlesticksParams`
* Support for backward pagination (`endTime` + `limit`) — TradingView's countBack pattern
* Support for forward pagination (`startTime` + `limit`)
* Limit validation: max 500 bars per request, server defaults to 350
* Automatic backfilling when time range contains fewer bars than requested

**Market Metadata Endpoint:**

* New `getMarketMetadata()` method for comprehensive market information
* Returns 24-hour statistics, latest price, and market initialization data
* Useful for building market overview dashboards

**WebSocket Improvements:**

* Auto-connect flag for authenticated WebSocket channels
* Simplified connection management after authentication

**Vault API Updates:**

* Vault deposit/withdraw methods now use `assetId` (UUID) instead of token addresses
* Consistent with the platform-wide shift to UUID-based asset identification

### Migration Guide

**1. Update Candlestick Calls:**

```typescript theme={null}
// Step 1: Get trading pair (if you only have the symbol)
const pair = await sdk.market.getTradingPairBySymbol("BTC-USDC");

// Step 2: Use the new method signature
const candles = await sdk.market.getCandlesticks(pair.id, "1h", {
  startTime: Date.now() - 24 * 60 * 60 * 1000,
  endTime: Date.now(),
  limit: 350
});
```

**2. For TradingView Integration (backward pagination):**

```typescript theme={null}
// Fetch historical data going backwards from a point in time
const historicalCandles = await sdk.market.getCandlesticks(pair.id, "1h", {
  endTime: oldestCandleTime,
  limit: 350
});
```

**3. For Real-time Charts (forward pagination):**

```typescript theme={null}
// Fetch latest candles from a starting point
const latestCandles = await sdk.market.getCandlesticks(pair.id, "1h", {
  startTime: lastKnownCandleTime,
  limit: 100
});
```

### API Reference

**GetCandlesticksParams:**

| Parameter | Type | Required | Description |
| - | - | - | - |
| `startTime` | number | No | Unix timestamp (ms) for range start |
| `endTime` | number | No | Unix timestamp (ms) for range end |
| `limit` | number | No | Max bars to return (default: 350, max: 500) |

**Supported Intervals:**

| Interval | Description |
| - | - |
| `1m` | 1 minute |
| `5m` | 5 minutes |
| `15m` | 15 minutes |
| `1h` | 1 hour |
| `4h` | 4 hours |
| `1d` | 1 day |

***

*For detailed OHLCV documentation, see the [OHLCV & Candlesticks](/ohlcv) guide.*


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.