close_position
Close an open position on Pear Protocol by providing position ID and selecting immediate market or time-weighted average price (TWAP) execution.
Instructions
Close one open Pear Protocol position by positionId. executionType: MARKET (immediate) or TWAP (spread over time; requires twapDuration in seconds). WRITE: executes a real trade. Requires PEAR_TRADE_ENABLED=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| positionId | Yes | ||
| executionType | Yes | ||
| twapDuration | No | ||
| twapIntervalSeconds | No | ||
| randomizeExecution | No | ||
| referralCode | No |