Skip to main content
POST
/
collateral_management
/
operations
Create a new operation
curl --request POST \
  --url https://api.anchorage-staging.com/v2/collateral_management/operations \
  --header 'Api-Access-Key: <api-key>' \
  --header 'Api-Signature: <api-signature>' \
  --header 'Api-Timestamp: <api-timestamp>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "asset": {
    "assetType": "<string>"
  },
  "quantity": "<string>",
  "typeId": "<string>",
  "idempotentId": "<string>",
  "notes": "<string>"
}
'
{
  "operationId": "<string>"
}

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

Body

application/json

Operation details

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,
REHYPE_IN,
REHYPE_OUT
asset
object
required

Asset symbol or ticker (e.g. BTC)

quantity
string
required

The quantity of the asset to be used in the operation, expressed as a decimal 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
typeId
string
required

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

idempotentId
string

Idempotency single key

Maximum string length: 128
notes
string

Optional notes or comments related to the operation

Response

operationId

operationId
string
required