amountRaw) or percentage-based (closePercentage).
Request Body
gains or lighter.Chain of the position (e.g.,
evm:42161, lighter:301).Mobula market identifier (e.g.,
lighter-btc-usd).Gains trade index. Required for Gains. Not used for Lighter.
Portion of the position to close, in percent (
0 < value ≤ 100). Use 100 for a full close. Mutually exclusive with amountRaw.Raw base-token amount to close. Mutually exclusive with
closePercentage.Additional DEX-specific parameters. For Gains partial closes, the API transparently injects
currentCollateralRaw from the position cache when available, so you do not need to supply it.Endpoint-specific errors
| Status | message |
|---|---|
| 400 | close-position payload generation failed — position not found, invalid close size, or DEX refusal |