Skip to main content
PATCH
/
collateral_management
/
operations
/
{operationId}
Update an operation
curl --request PATCH \
  --url https://api.anchorage-staging.com/v2/collateral_management/operations/{operationId} \
  --header 'Api-Access-Key: <api-key>' \
  --header 'Api-Signature: <api-signature>' \
  --header 'Api-Timestamp: <api-timestamp>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "notes": "<string>",
  "quantity": "<string>",
  "typeId": "<string>"
}
'
{
  "asset": {
    "assetType": "<string>"
  },
  "createdAt": "2019-01-02T12:34:56.000Z",
  "id": "<string>",
  "quantity": "<string>",
  "typeId": "<string>",
  "updatedAt": "2019-01-02T12:34:56.000Z",
  "liquidationCollateralPackageId": "<string>",
  "liquidationProceedAsset": {
    "assetType": "<string>"
  },
  "liquidationProceedQuantity": "<string>",
  "notes": "<string>"
}
Requires Api-Signature. Replace OPERATION_ID in the path with the actual operation ID before signing.

Authorizations

Api-Access-Key
string
header
required

An API key associated with a security role

Headers

Api-Signature
string
required

A hex-encoded Ed25519 signature of timestamp_epoch_seconds + uppercase(http_method) + request_path + request_body.

Construction example:

toHex(
  ed25519Sign(
    signing_key,
    '{}{}{}{}'.format(timestamp_epoch_seconds, toUpper(httpMethod), httpRequestPath, httpBody)
  )
)
Pattern: ^[0-9A-Fa-f]{128,160}$
Api-Timestamp
integer<int64>
required

Current timestamp, represented as unix epoch seconds

Path Parameters

operationId
string
required

The unique identifier of the operation to update.

Body

application/json

The fields to update on the operation.

Fields for updating a Collateral Management operation. Any fields left null or omitted will not be updated.

action
enum<string>

The specific action to be performed in the operation.

Valid actions for exposures are:

  1. INITIAL_FUNDING
  2. PAY_DOWN
  3. PAY_UP
  4. INTEREST_PAYDOWN
  5. INTEREST_ACCRUAL

Valid actions for collateral packages are:

  1. INITIAL_DEPOSIT
  2. MARGIN_RETURN,
  3. TOP_UP
  4. CLOSE_RETURN.
  5. REHYPE_IN
  6. REHYPE_OUT
Available options:
INITIAL_DEPOSIT,
INITIAL_FUNDING,
MARGIN_RETURN,
PAY_DOWN,
PAY_UP,
INTEREST_PAYDOWN,
INTEREST_ACCRUAL,
TOP_UP,
CLOSE_RETURN,
REHYPE_IN,
REHYPE_OUT
asset
object

Asset symbol or ticker (e.g. BTC)

notes
string

Optional notes or comments related to the operation. Providing a new value will overwrite existing notes.

quantity
string

The quantity of the asset to be used in the operation, expressed as a decimal string.

type
enum<string>

The type of entity the operation is being performed on. This can be either a COLLATERAL_PACKAGE or an EXPOSURE.

Available options:
COLLATERAL_PACKAGE,
EXPOSURE
typeId
string

The ID of the collateral package (packageId) or exposure (exposureId) for this operation

Response

The updated operation.

Contains the full, updated operation object.

action
enum<string>
required

The specific action to be performed in the operation.

Valid actions for exposures are:

  1. INITIAL_FUNDING
  2. PAY_DOWN
  3. PAY_UP
  4. INTEREST_PAYDOWN
  5. INTEREST_ACCRUAL

Valid actions for collateral packages are:

  1. INITIAL_DEPOSIT
  2. MARGIN_RETURN
  3. TOP_UP
  4. CLOSE_RETURN.
  5. REHYPE_IN
  6. REHYPE_OUT
Available options:
INITIAL_DEPOSIT,
INITIAL_FUNDING,
MARGIN_RETURN,
PAY_DOWN,
PAY_UP,
INTEREST_PAYDOWN,
INTEREST_ACCRUAL,
TOP_UP,
CLOSE_RETURN,
FULL_LIQUIDATION,
PARTIAL_LIQUIDATION,
SWEEP,
REHYPE_IN,
REHYPE_OUT,
GAS_FEE
asset
object
required

Asset symbol or ticker (e.g. BTC)

createdAt
string<date-time>
required

The timestamp of when this record was created not necessarily when the operation was executed.

Example:

"2019-01-02T12:34:56.000Z"

id
string
required

Unique identifier for the operation (operationId)

quantity
string
required

The decimal amount of the asset being added, removed, or modified in the operation, expressed as a string

type
enum<string>
required

The type of entity the operation is being performed on. This can be either a COLLATERAL_PACKAGE or an EXPOSURE.

Available options:
COLLATERAL_PACKAGE,
EXPOSURE,
LIQUIDATION
typeId
string
required

Contains the unique identifier of either the collateral package (packageId) or exposure (exposureId) that the operation is being performed on, depending on the value in the type field

updatedAt
string<date-time>
required

The timestamp of when this record was last updated

Example:

"2019-01-02T12:34:56.000Z"

liquidationCollateralPackageId
string

The unique identifier of the collateral package that is being liquidated

liquidationProceedAsset
object

Asset symbol or ticker (e.g. BTC)

liquidationProceedQuantity
string

The decimal quantity of the proceeds received from the liquidation

notes
string

An optional field for additional comments or contextual information related to the operation.