PerpsClient.updatePositionMargin. The SDK-managed agent signs the action; the user’s wallet is not prompted.
The examples on this page use Hyperliquid (
provider: 'hyperliquid'). Replace the provider value with any supported DEX from getProviders().updatePositionMargin
action: 'remove' (with a positive amount) to withdraw margin from the position without changing its size.
API Reference: POST /createAction · /executeAction