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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"positionId": "<positionId>",
"executionType": "<executionType>"
},
"name": "close_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| positionId | Yes | ||
| executionType | Yes | ||
| twapDuration | No | ||
| twapIntervalSeconds | No | ||
| randomizeExecution | No | ||
| referralCode | No |