Skip to main content
POST
/
v1
/
trpc
/
v2.portfolio.actions.submit
# Client-quoted route execution
curl --request POST \
  --url 'https://api.glider.fi/v1/trpc/v2.portfolio.actions.submit' \
  --header 'Content-Type: application/json' \
  --data '{
    "input": {
      "portfolioId": "portfolio-123",
      "kind": "swap",
      "params": {
        "chainId": "8453",
        "slippageBps": 250,
        "route": {
          "id": "lifi-route-id",
          "fromChainId": 8453,
          "toChainId": 8453,
          "steps": [
            {
              "id": "step-0",
              "action": {
                "fromChainId": 8453,
                "toChainId": 8453
              }
            }
          ]
        }
      },
      "requestId": "optional-request-id",
      "correlationId": "optional-correlation-id"
    }
  }'
{
  "result": {
    "data": {
      "operationId": "op_123",
      "state": "queued",
      "refs": {
        "eventId": "evt_123"
      }
    }
  }
}
v2.portfolio.actions.submit supports two LiFi swap submission modes: kind: "swap" submits a client-supplied RouteExtended:
  • chainId (string, required): execution chain for the submitted route.
  • route (RouteExtended, required): precomputed LiFi route payload.
  • slippageBps (integer, optional): per-trade slippage override in basis points (0 to 1000). When provided, this overrides user preference and default fallback slippage for that trade.
kind: "swap_backend_quote" submits raw quote parameters and lets the backend fetch the LiFi route inside engine before execution:
  • fromChainId (string, required)
  • toChainId (string, required)
  • fromTokenAddress (string, required)
  • toTokenAddress (string, required)
  • fromAmount (string, required)
  • toAddress (string, required): must be owned by the authenticated user or one of their owned vaults
  • slippageBps (integer, optional): overrides only slippage while backend quoting still uses saved user or portfolio swap preferences plus server defaults for the remaining route settings
Both modes return a canonical swap operation handle and should be polled through v2.operations.get / v2.operations.stream.
This tRPC endpoint requires an authenticated wallet session (SIWE).
# Client-quoted route execution
curl --request POST \
  --url 'https://api.glider.fi/v1/trpc/v2.portfolio.actions.submit' \
  --header 'Content-Type: application/json' \
  --data '{
    "input": {
      "portfolioId": "portfolio-123",
      "kind": "swap",
      "params": {
        "chainId": "8453",
        "slippageBps": 250,
        "route": {
          "id": "lifi-route-id",
          "fromChainId": 8453,
          "toChainId": 8453,
          "steps": [
            {
              "id": "step-0",
              "action": {
                "fromChainId": 8453,
                "toChainId": 8453
              }
            }
          ]
        }
      },
      "requestId": "optional-request-id",
      "correlationId": "optional-correlation-id"
    }
  }'
# Backend-quoted swap execution
curl --request POST \
  --url 'https://api.glider.fi/v1/trpc/v2.portfolio.actions.submit' \
  --header 'Content-Type: application/json' \
  --data '{
    "input": {
      "portfolioId": "portfolio-123",
      "kind": "swap_backend_quote",
      "params": {
        "fromChainId": "8453",
        "toChainId": "1",
        "fromTokenAddress": "0x0000000000000000000000000000000000000001",
        "toTokenAddress": "0x0000000000000000000000000000000000000002",
        "fromAmount": "1000000",
        "toAddress": "0x1111111111111111111111111111111111111111",
        "slippageBps": 150
      },
      "requestId": "optional-request-id",
      "correlationId": "optional-correlation-id"
    }
  }'
{
  "result": {
    "data": {
      "operationId": "op_123",
      "state": "queued",
      "refs": {
        "eventId": "evt_123"
      }
    }
  }
}