curl --request POST \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/rebalance/schedule/start' \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: your_api_key_here' \ --data '{ "runRebalanceImmediately": true, "initializeScheduleAutomatically": true, "interval": 21600000 }'
{ "success": true, "data": { "portfolioId": "port_abc123", "rebalanceScheduleId": "sched_abc123", "status": "started", "message": "Portfolio automation started successfully", "runRebalanceImmediately": true, "isAutomated": true, "intervalMs": 21600000 }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }
Endpoints for automating portfolio rebalancing
curl --request POST \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/rebalance/schedule/pause' \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: your_api_key_here' \ --data '{ "reason": "Pausing for market volatility" }'
{ "success": true, "data": { "portfolioId": "port_abc123", "scheduleId": "sched_abc123", "status": "paused", "message": "Portfolio automation paused successfully", "paused": true, "pausedAt": "2023-05-21T13:45:12.345Z", "reason": "Paused via API: Pausing for market volatility" }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }
curl --request POST \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/rebalance/schedule/resume' \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: your_api_key_here' \ --data '{ "reason": "Market stabilized" }'
{ "success": true, "data": { "portfolioId": "port_abc123", "scheduleId": "sched_abc123", "status": "active", "message": "Portfolio automation resumed successfully", "paused": false, "resumedAt": "2023-05-21T13:45:12.345Z", "reason": "Resumed via API: Market stabilized" }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }
curl --request POST \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/rebalance/schedule/trigger' \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: your_api_key_here' \ --data '{ "skipScheduleValidation": false }'
{ "success": true, "data": { "portfolioId": "port_abc123", "scheduleId": "sched_abc123", "rebalanceId": "rebal_def456", "status": "triggered", "message": "Portfolio rebalance triggered successfully", "triggerTime": 1684734312 }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }
curl --request GET \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/automation/status' \ --header 'X-API-KEY: your_api_key_here'
{ "success": true, "data": { "portfolioId": "port_abc123", "status": "active", // or "paused", "inactive", "archived", "error" "hasAutomation": true, "message": "Portfolio automation is active", "rebalanceScheduleId": "sched_abc123", "details": { "totalExecutions": 5, "paused": false, "pauseReason": null, "recentActions": [ { "workflowId": "rebal_def456", "takenAt": "2023-05-21T13:30:00.000Z", "scheduledAt": "2023-05-21T13:30:00.000Z" }, { "workflowId": "rebal_ghi789", "takenAt": "2023-05-21T07:30:00.000Z", "scheduledAt": "2023-05-21T07:30:00.000Z" } ], "nextScheduledExecution": "2023-05-21T19:30:00.000Z" } }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }
curl --request GET \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/rebalance/status?limit=5' \ --header 'X-API-KEY: your_api_key_here'
{ "success": true, "data": { "portfolioId": "port_abc123", "status": "active", // or "paused", "inactive", "error" "message": "Rebalance schedule is active", "rebalanceScheduleId": "sched_abc123", "details": { "totalExecutions": 5, "paused": false, "pauseReason": null, "nextScheduledExecution": "2023-05-21T19:30:00.000Z" }, "recentWorkflows": [ { "workflowId": "rebal_def456", "runId": "run_jkl012", "scheduledAt": "2023-05-21T13:30:00.000Z", "startedAt": "2023-05-21T13:30:00.123Z", "status": "triggered" }, { "workflowId": "rebal_ghi789", "runId": "run_mno345", "scheduledAt": "2023-05-21T07:30:00.000Z", "startedAt": "2023-05-21T07:30:00.456Z", "status": "triggered" } ] }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }
curl --request GET \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/rebalance/status/rebal_def456' \ --header 'X-API-KEY: your_api_key_here'
{ "success": true, "data": { "portfolioId": "port_abc123", "workflowId": "rebal_def456", "runId": "run_jkl012", "status": "completed", "startTime": "2023-05-21T13:30:00.123Z", "closeTime": "2023-05-21T13:32:45.678Z", "executionTime": "2023-05-21T13:30:00.123Z", "taskQueue": "rebalance-queue", "result": { "transactionHash": "0xTransactionHash789", "blockNumber": 12345680, "gasUsed": "125000", "effectiveGasPrice": "1000000000", "status": "success" }, "error": null, "historyLength": 32 }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }
curl --request POST \ --url 'https://api.glider.fi/v1/portfolio/port_abc123/update-schedule-interval' \ --header 'Content-Type: application/json' \ --header 'X-API-KEY: your_api_key_here' \ --data '{ "interval": { "every": 43200000, "offset": 0 } }'
{ "success": true, "data": { "portfolioId": "port_abc123", "scheduleId": "sched_abc123", "previousInterval": { "every": 21600000, "offset": 0 }, "newInterval": { "every": 43200000, "offset": 0, "humanReadable": "12 hours" }, "message": "Portfolio rebalance schedule updated to run every 12 hours", "nextScheduledRun": "2023-05-22T01:30:00.000Z" }, "correlationId": "corr_abc123", "requestId": "req_xyz789", "timestamp": "2023-05-21T13:45:12.345Z" }