POST
/api/v1/agents/{entityPublicId}/trading/copy/strategiesTrading_CreateCopyStrategy
- Authentication
- required-user
- Cache policy
- none
- Success and errors
- 201, 400, 401, 403, 404, 409, 422, 500
- Stability
- v1 stable contract
OpenAPI operation
{
"operationId": "Trading_CreateCopyStrategy",
"summary": "POST /api/v1/agents/{entityPublicId}/trading/copy/strategies",
"tags": [
"Trading"
],
"parameters": [
{
"name": "entityPublicId",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
{
"name": "Idempotency-Key",
"in": "header",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"targetWalletPublicId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"sourceAddress": {
"type": "string",
"minLength": 32,
"maxLength": 44
},
"enabled": {
"default": true,
"type": "boolean"
},
"sizingMode": {
"type": "string",
"enum": [
"FIXED",
"SOURCE_RATIO",
"PORTFOLIO_RATIO"
]
},
"fixedAtomicAmount": {
"anyOf": [
{
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
{
"type": "null"
}
]
},
"sourceRatioBps": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 10000
},
{
"type": "null"
}
]
},
"portfolioRatioBps": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 10000
},
{
"type": "null"
}
]
},
"maxPerTradeAtomic": {
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
"maxPeriodSpendAtomic": {
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
"maxExposureAtomic": {
"anyOf": [
{
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
{
"type": "null"
}
]
},
"periodSeconds": {
"default": 86400,
"type": "integer",
"minimum": 60,
"maximum": 31536000
},
"mirrorBuys": {
"default": true,
"type": "boolean"
},
"mirrorSells": {
"default": true,
"type": "boolean"
},
"allowedAssetPublicIds": {
"default": [],
"maxItems": 200,
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"blockedAssetPublicIds": {
"default": [],
"maxItems": 200,
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"minLiquidityMinor": {
"anyOf": [
{
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
{
"type": "null"
}
]
},
"liquidityCurrency": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Z]{3,12}$"
},
{
"type": "null"
}
]
},
"maxPriceImpactBps": {
"type": "integer",
"minimum": 1,
"maximum": 10000
},
"maxSlippageBps": {
"type": "integer",
"minimum": 1,
"maximum": 5000
},
"maxSourceEventAgeMs": {
"type": "integer",
"minimum": 1000,
"maximum": 86400000
},
"approvalPolicy": {
"type": "string",
"enum": [
"ALWAYS",
"ABOVE_THRESHOLD",
"POLICY_DRIVEN",
"NEVER"
]
},
"approvalThresholdAtomic": {
"anyOf": [
{
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
{
"type": "null"
}
]
}
},
"required": [
"targetWalletPublicId",
"sourceAddress",
"sizingMode",
"maxPerTradeAtomic",
"maxPeriodSpendAtomic",
"maxPriceImpactBps",
"maxSlippageBps",
"maxSourceEventAgeMs",
"approvalPolicy"
],
"additionalProperties": false
}
}
}
},
"security": [
{
"cookieAuth": []
}
],
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"required": [
"data",
"meta"
],
"properties": {
"data": {
"type": "object",
"properties": {
"publicId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"enabled": {
"type": "boolean"
},
"sourceNetwork": {
"type": "string"
},
"sourceAddress": {
"type": "string"
},
"targetWalletPublicId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"targetWalletLabel": {
"type": "string"
},
"version": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"policyDigest": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"policy": {
"type": "object",
"properties": {
"sizingMode": {
"type": "string",
"enum": [
"FIXED",
"SOURCE_RATIO",
"PORTFOLIO_RATIO"
]
},
"fixedAtomicAmount": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"sourceRatioBps": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"portfolioRatioBps": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
]
},
"maxPerTradeAtomic": {
"type": "string"
},
"maxPeriodSpendAtomic": {
"type": "string"
},
"maxExposureAtomic": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"periodSeconds": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"mirrorBuys": {
"type": "boolean"
},
"mirrorSells": {
"type": "boolean"
},
"allowedAssetPublicIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"blockedAssetPublicIds": {
"type": "array",
"items": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"minLiquidityMinor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"liquidityCurrency": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"maxPriceImpactBps": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"maxSlippageBps": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"maxSourceEventAgeMs": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"approvalPolicy": {
"type": "string",
"enum": [
"ALWAYS",
"ABOVE_THRESHOLD",
"POLICY_DRIVEN",
"NEVER"
]
},
"approvalThresholdAtomic": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"sizingMode",
"fixedAtomicAmount",
"sourceRatioBps",
"portfolioRatioBps",
"maxPerTradeAtomic",
"maxPeriodSpendAtomic",
"maxExposureAtomic",
"periodSeconds",
"mirrorBuys",
"mirrorSells",
"allowedAssetPublicIds",
"blockedAssetPublicIds",
"minLiquidityMinor",
"liquidityCurrency",
"maxPriceImpactBps",
"maxSlippageBps",
"maxSourceEventAgeMs",
"approvalPolicy",
"approvalThresholdAtomic"
],
"additionalProperties": false
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
}
},
"required": [
"publicId",
"enabled",
"sourceNetwork",
"sourceAddress",
"targetWalletPublicId",
"targetWalletLabel",
"version",
"policyDigest",
"policy",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"meta": {
"type": "object",
"additionalProperties": true,
"required": [
"requestId",
"schemaVersion",
"buildVersion",
"generatedAt",
"freshness"
],
"properties": {
"requestId": {
"type": "string",
"format": "uuid"
},
"schemaVersion": {
"type": "string"
},
"buildVersion": {
"type": "string"
},
"generatedAt": {
"type": "string",
"format": "date-time"
},
"freshness": {
"type": "object",
"additionalProperties": false,
"required": [
"projectedAt",
"sourceWatermark"
],
"properties": {
"projectedAt": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"sourceWatermark": {
"type": [
"string",
"null"
]
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "invalid request",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"401": {
"description": "unauthenticated",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"403": {
"description": "forbidden",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"404": {
"description": "not found",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"409": {
"description": "conflict",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"422": {
"description": "configuration missing",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"500": {
"description": "internal error",
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
},
"x-auth-mode": "required-user",
"x-cache-policy": "none",
"x-required-scopes": [],
"x-rate-cost": 1,
"x-stability": "STABLE"
}