curl --request POST \
--url https://api.anchorage-staging.com/v2/collateral_management/packages \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"collateralAssetsConfig": [
{
"asset": {
"assetType": "<string>"
},
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
'import requests
url = "https://api.anchorage-staging.com/v2/collateral_management/packages"
payload = {
"collateralAssetsConfig": [
{
"asset": { "assetType": "<string>" },
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
collateralAssetsConfig: [
{
asset: {assetType: '<string>'},
liquidationPriority: 123,
weight: '<string>',
maxStalenessMinutes: 123,
notes: '<string>'
}
],
pledgorId: '<string>',
securedPartyId: '<string>',
clientReferenceId: '<string>',
ltvRoundingPrecision: 123
})
};
fetch('https://api.anchorage-staging.com/v2/collateral_management/packages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"packageId": "<string>"
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Create a new collateral package
Permissions required: Manage Collateral Packages and Read vault activity
Creates a new collateral package in the Collateral Management service.
curl --request POST \
--url https://api.anchorage-staging.com/v2/collateral_management/packages \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"collateralAssetsConfig": [
{
"asset": {
"assetType": "<string>"
},
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
'import requests
url = "https://api.anchorage-staging.com/v2/collateral_management/packages"
payload = {
"collateralAssetsConfig": [
{
"asset": { "assetType": "<string>" },
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
collateralAssetsConfig: [
{
asset: {assetType: '<string>'},
liquidationPriority: 123,
weight: '<string>',
maxStalenessMinutes: 123,
notes: '<string>'
}
],
pledgorId: '<string>',
securedPartyId: '<string>',
clientReferenceId: '<string>',
ltvRoundingPrecision: 123
})
};
fetch('https://api.anchorage-staging.com/v2/collateral_management/packages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"packageId": "<string>"
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Authorizations
An API key associated with a security role
Headers
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) ) )
^[0-9A-Fa-f]{128,160}$Current timestamp, represented as unix epoch seconds
Body
The details for creating a new collateral package
The request payload for creating a new collateral package.
Show child attributes
Show child attributes
Collateral management participant ID of the Pledgor (borrower) associated with this collateral package
This field specifies the pricing strategy to be used for the collateral package. To be implemented in the future
DEFAULT, BID, ASK, MID, LAST, CHAINLINK_STRATEGY Unique identifier of the secured party (lender) associated with this collateral package
Accelerated Margin Call level config
Show child attributes
Show child attributes
A reference identifier provided by the client for this collateral package
Critical level config
Show child attributes
Show child attributes
Number of decimal places to round LTV values to
Margin Call level config
Show child attributes
Show child attributes
Margin Return level config
Show child attributes
Show child attributes
Response
Successfully created collateral package
Was this page helpful?