PearPear

Time-Weighted Average Price

Spread a basket entry into timed chunks.

A TWAP schedule splits the basket entry into evenly spaced chunks over a duration, reducing market impact versus a single market order.

Create one with POST /schedules (SDK: sdk.core.schedules.create). You set the total duration and the interval; the schedule submits a chunk each interval until it is filled.

List schedules with GET /schedules; cancel one with PATCH /schedules/:scheduleId/cancel (its pending chunks stop), or all with PATCH /schedules/cancel-all. Progress streams over the WebSocket as schedule.created, per-chunk executions, and schedule.completed.

The exact request shape (duration, interval, sizing) is defined by @pear-protocol/types and the API Specification.