> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glider.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# User Swap Preferences (tRPC)

> User-global and portfolio-scoped swap preference overrides.

This namespace exposes authenticated wallet-scoped settings endpoints:

* `userSwapPreferences.getUserGlobal`
* `userSwapPreferences.upsertUserGlobal`
* `userSwapPreferences.resetUserGlobal`
* `userSwapPreferences.getPortfolio`
* `userSwapPreferences.upsertPortfolio`
* `userSwapPreferences.resetPortfolio`
* `userSwapPreferences.getEffective`

<Note>
  No endpoint exists to mutate Glider defaults. Defaults are code constants and are read-only.
</Note>

## Payload Contract

`config` is a patch object with optional keys:

* `thresholdUsd`: decimal string (for example `"2.00"`)
* `slippageBps`: integer `0..1000`
* `priceImpactBps`: integer `0..1000`

Empty patches are rejected. Null-clears are not supported. Use reset endpoints for clears.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.glider.fi/v1/trpc/userSwapPreferences.upsertPortfolio' \
    --header 'Content-Type: application/json' \
    --data '{
      "input": {
        "strategyInstanceId": "portfolio-123",
        "config": {
          "thresholdUsd": "2.00",
          "slippageBps": 600
        }
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "result": {
      "data": {
        "config": {
          "thresholdUsd": "2.00",
          "slippageBps": 600
        },
        "updatedAt": "2026-02-26T20:00:00.000Z"
      }
    }
  }
  ```
</ResponseExample>
