POST
/api/v1/agents/{entityPublicId}/trading/spot/quotesTrading_CreateSpotQuote
- 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_CreateSpotQuote",
"summary": "POST /api/v1/agents/{entityPublicId}/trading/spot/quotes",
"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)$"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"walletPublicId": {
"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)$"
},
"inputAssetPublicId": {
"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)$"
},
"outputAssetPublicId": {
"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)$"
},
"inputUnits": {
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
"slippageBps": {
"default": 50,
"type": "integer",
"minimum": 1,
"maximum": 5000
}
},
"required": [
"walletPublicId",
"inputAssetPublicId",
"outputAssetPublicId",
"inputUnits"
],
"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)$"
},
"provider": {
"type": "string",
"enum": [
"JUPITER_SWAP_V2",
"ZEROX_ALLOWANCE_HOLDER"
]
},
"providerApiVersion": {
"type": "string",
"minLength": 1
},
"providerRequestId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"quoteDigest": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"network": {
"type": "string",
"minLength": 1
},
"walletPublicId": {
"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)$"
},
"inputAsset": {
"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)$"
},
"network": {
"type": "string",
"minLength": 1
},
"locator": {
"type": "string",
"minLength": 1
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"symbol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"decimals": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"imageUri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"metadataObservedAt": {
"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))$"
},
"metadataFresh": {
"type": "boolean"
}
},
"required": [
"publicId",
"network",
"locator",
"name",
"symbol",
"decimals",
"imageUri",
"metadataObservedAt",
"metadataFresh"
],
"additionalProperties": false
},
"outputAsset": {
"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)$"
},
"network": {
"type": "string",
"minLength": 1
},
"locator": {
"type": "string",
"minLength": 1
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"symbol": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"decimals": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"imageUri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"metadataObservedAt": {
"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))$"
},
"metadataFresh": {
"type": "boolean"
}
},
"required": [
"publicId",
"network",
"locator",
"name",
"symbol",
"decimals",
"imageUri",
"metadataObservedAt",
"metadataFresh"
],
"additionalProperties": false
},
"inputUnits": {
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
"expectedOutputUnits": {
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
"minimumOutputUnits": {
"type": "string",
"pattern": "^[1-9][0-9]{0,77}$"
},
"slippageBps": {
"type": "integer",
"minimum": 0,
"maximum": 10000
},
"priceImpactPpm": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"route": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"feeDetails": {
"anyOf": [
{},
{
"type": "null"
}
]
},
"networkFeeUnits": {
"anyOf": [
{
"type": "string",
"pattern": "^(0|[1-9][0-9]{0,77})$"
},
{
"type": "null"
}
]
},
"observedAt": {
"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))$"
},
"expiresAt": {
"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))$"
},
"lastValidBlockHeight": {
"anyOf": [
{
"type": "string",
"pattern": "^(0|[1-9][0-9]*)$"
},
{
"type": "null"
}
]
},
"expired": {
"type": "boolean"
}
},
"required": [
"publicId",
"provider",
"providerApiVersion",
"providerRequestId",
"quoteDigest",
"network",
"walletPublicId",
"inputAsset",
"outputAsset",
"inputUnits",
"expectedOutputUnits",
"minimumOutputUnits",
"slippageBps",
"priceImpactPpm",
"route",
"feeDetails",
"networkFeeUnits",
"observedAt",
"expiresAt",
"lastValidBlockHeight",
"expired"
],
"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"
}