POST
/
portfolio
/
:portfolioId
/
execute
Portfolio Execute
curl --request POST \
  --url https://api.glider.fi/portfolio/:portfolioId/execute \
  --header 'Content-Type: <content-type>' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '{
  "chainId": "<string>",
  "params": {
    "calls": {
      "to": "<string>",
      "data": "<string>",
      "value": "<string>"
    },
    "nonce": "<string>"
  }
}'
{
  "success": true,
  "data": {
    "status": "<string>",
    "executionId": "<string>",
    "transaction": {
      "hash": "<string>",
      "status": "<string>",
      "blockNumber": 123,
      "timestamp": 123
    },
    "result": {
      "success": true,
      "gasUsed": "<string>",
      "events": [
        {}
      ]
    },
    "error": {
      "code": "<string>",
      "message": "<string>",
      "details": "<string>"
    }
  },
  "NOT_FOUND": {},
  "UNAUTHORIZED": {},
  "FORBIDDEN": {},
  "BAD_REQUEST": {},
  "SIMULATION_FAILED": {},
  "EXECUTION_FAILED": {}
}
This endpoint allows you to execute transactions on behalf of a portfolio. It can be used for custom transactions, manual rebalancing, or any operation that requires using the portfolio’s vault to interact with other contracts.

Path Parameters

portfolioId
string
required
The unique identifier of the portfolio

Query Parameters

dryRun
boolean
default:"false"
If true, simulate the transaction without executing it on-chain

Request Headers

X-API-KEY
string
required
Your API key
Content-Type
string
required
Must be set to application/json

Request Body

chainId
string
required
Chain ID for transaction execution
params
object
required
Transaction parameters

Response

success
boolean
Indicates if the request was successful
data
object

Check Execution Status

GET /portfolio/:portfolioId/execute/status/:executionId
This endpoint allows you to check the status of a previously submitted execution.

Path Parameters

portfolioId
string
required
The unique identifier of the portfolio
executionId
string
required
The execution identifier returned from the execute endpoint

Response

success
boolean
Indicates if the request was successful
data
object

Example Request

curl -X POST "https://api.glider.fi/portfolio/port_1a2b3c4d5e6f/execute" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chainId": "1",
    "params": {
      "calls": [
        {
          "to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045000000000000000000000000000000000000000000000000000000002540be400",
          "value": "0"
        }
      ]
    }
  }'

Example Response

{
  "success": true,
  "data": {
    "executionId": "exec_a1b2c3d4e5f6",
    "status": "pending",
    "transaction": {
      "hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
      "data": "0x...",
      "from": "0x1234...5678",
      "to": "0xA0b8...eB48",
      "chainId": "1"
    }
  }
}

Example Status Check

curl -X GET "https://api.glider.fi/portfolio/port_1a2b3c4d5e6f/execute/status/exec_a1b2c3d4e5f6" \
  -H "X-API-KEY: YOUR_API_KEY"

Example Status Response

{
  "success": true,
  "data": {
    "status": "completed",
    "executionId": "exec_a1b2c3d4e5f6",
    "transaction": {
      "hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
      "status": "confirmed",
      "blockNumber": 16123456,
      "timestamp": 1684147200
    },
    "result": {
      "success": true,
      "gasUsed": "51234",
      "events": [
        {
          "name": "Transfer",
          "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "args": {
            "from": "0x1234...5678",
            "to": "0xd8da...6045",
            "value": "1000000000"
          }
        }
      ]
    }
  }
}

Error Codes

NOT_FOUND
404
The specified portfolio or execution ID could not be found
UNAUTHORIZED
401
Invalid or missing API key
FORBIDDEN
403
The API key does not have permission to execute transactions for this portfolio
BAD_REQUEST
400
The request body is invalid or missing required fields
SIMULATION_FAILED
400
Transaction simulation failed
EXECUTION_FAILED
500
Transaction execution failed

Notes

  • Use the dryRun parameter to simulate transactions before executing them
  • The execution process is asynchronous - use the status endpoint to check completion
  • Transactions are executed through the portfolio’s vault, which must have sufficient permissions and balances
  • For security reasons, transactions have built-in limits and validations to protect portfolio assets
  • Multiple calls can be batched into a single transaction for efficiency