Skip to main content
cesto.products reads baskets (products). Both methods are read-only.

List products

const products = await cesto.products.list();

// filter by category
const defi = await cesto.products.list({ category: 'defi' });

Include backtested performance

Set includeBacktest to merge backtested performance onto each item (one extra request). If that data can’t be fetched, backtest comes back null rather than failing the call.
const products = await cesto.products.list({ includeBacktest: true });
products[0].backtest; // performance metrics, or null
category
string
Optional category filter.
includeBacktest
boolean
default:"false"
Also fetch and attach backtested performance per product.

Get a product

Fetch a single basket by its slug.
const product = await cesto.products.get('my-basket-slug');
product.id;          // product id
product.versionId;   // current version id
product.definition;  // the basket's workflow definition

Include the backtested chart

const detailed = await cesto.products.get('my-basket-slug', {
  includeBacktestChart: true,
  chartTimeRange: '1y', // '7d' | '1m' | '3m' | '6m' | '1y' | 'all' — default '1y'
});
detailed.backtestChart; // chart data, or null on failure
The chart is a union — a portfolio value chart or a prediction-market chart. Discriminate it with the shipped type guard:
import { isPredictionMarketChart } from '@cesto/sdk';

const chart = detailed.backtestChart;
if (chart && isPredictionMarketChart(chart)) {
  chart.markets; // prediction markets
} else if (chart) {
  chart.timeSeries; // portfolio value over time
}
includeBacktestChart
boolean
default:"false"
Also fetch and attach the backtested chart.
chartTimeRange
'7d' | '1m' | '3m' | '6m' | '1y' | 'all'
default:"1y"
Chart window. Full metrics (CAGR, Sharpe, etc.) are only computed for 1y.