Skip to main content
POST
/
v2
/
portfolios
/
{portfolioId}
/
liquidate-all
curl --request POST \
  --url 'https://api.glider.fi/v2/portfolios/a1b2c3d4/liquidate-all' \
  --header 'x-api-key: gldr_sk_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "message": {
      "portfolioId": "a1b2c3d4",
      "recipientAccountId": "eip155:1:0x4444444444444444444444444444444444444444",
      "assets": [
        {
          "assetId": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
          "amountRaw": "5000000000000000000"
        }
      ],
      "nonce": "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
      "expiresAt": 1744898400,
      "liquidate": true
    },
    "signature": "0xabc..."
  }'
{
  "success": true,
  "data": {
    "operationId": "op_01JWZEE2MF30KVRMRX53N88VA4",
    "submittedAt": "2026-04-17T12:05:00.000Z"
  }
}
Stage 2 of the two-stage liquidate-all flow. Accepts the message returned by POST .../liquidate-all/signature verbatim, plus the owner’s signature. Verifies ownership, re-checks live balances, and dispatches the swap-to-USDC + delivery to the recipient. This is functionally identical to POST .../withdraw submitting a liquidate: true authorization — same verification, idempotency (keyed on message.nonce), and polling. Echo typedData.message back as body.message; the liquidate: true flag must be present and is part of the signed bytes.
  • Auth: x-api-key header (required)
  • Scope: portfolios:withdraw
  • EVM only.

Polling for onchain status

The response returns operationId. Poll GET /v2/portfolios/{portfolioId}/operations/{operationId} until the operation reaches a terminal (completed / failed / cancelled) state. The operation tracks the swap that produces and delivers the USDC.

Common error responses

Identical to POST .../withdraw, including 400 API_219 WITHDRAW_AS_USDC_UNSUPPORTED_CHAIN when the recipient’s chain has no canonical USDC, plus the shared expiry / signature / idempotency errors.
curl --request POST \
  --url 'https://api.glider.fi/v2/portfolios/a1b2c3d4/liquidate-all' \
  --header 'x-api-key: gldr_sk_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "message": {
      "portfolioId": "a1b2c3d4",
      "recipientAccountId": "eip155:1:0x4444444444444444444444444444444444444444",
      "assets": [
        {
          "assetId": "eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f",
          "amountRaw": "5000000000000000000"
        }
      ],
      "nonce": "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
      "expiresAt": 1744898400,
      "liquidate": true
    },
    "signature": "0xabc..."
  }'
{
  "success": true,
  "data": {
    "operationId": "op_01JWZEE2MF30KVRMRX53N88VA4",
    "submittedAt": "2026-04-17T12:05:00.000Z"
  }
}