curl --request PATCH \
--url https://api.anchorage-staging.com/v2/collateral_management/packages/{packageId} \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"acceleratedMarginCall": {
"curePeriod": "<string>",
"ltv": "<string>"
},
"autoDeleveraging": {
"levels": [
{
"liquidationPercentage": "<string>",
"price": "<string>"
}
]
},
"clientReferenceId": "<string>",
"collateralAssetsConfig": [
{
"asset": {
"assetType": "<string>"
},
"liquidationPriority": 123,
"maxStalenessMinutes": 123,
"notes": "<string>",
"weight": "<string>"
}
],
"critical": {
"defaultNotice": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"isActive": true,
"ltvRoundingPrecision": 123,
"marginCall": {
"curePeriod": "<string>",
"curePeriodProtection": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"marginReturn": {
"ltv": "<string>",
"returnToLtv": "<string>",
"returnType": "<string>"
}
}
'import requests
url = "https://api.anchorage-staging.com/v2/collateral_management/packages/{packageId}"
payload = {
"acceleratedMarginCall": {
"curePeriod": "<string>",
"ltv": "<string>"
},
"autoDeleveraging": { "levels": [
{
"liquidationPercentage": "<string>",
"price": "<string>"
}
] },
"clientReferenceId": "<string>",
"collateralAssetsConfig": [
{
"asset": { "assetType": "<string>" },
"liquidationPriority": 123,
"maxStalenessMinutes": 123,
"notes": "<string>",
"weight": "<string>"
}
],
"critical": {
"defaultNotice": True,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"isActive": True,
"ltvRoundingPrecision": 123,
"marginCall": {
"curePeriod": "<string>",
"curePeriodProtection": True,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"marginReturn": {
"ltv": "<string>",
"returnToLtv": "<string>",
"returnType": "<string>"
}
}
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
acceleratedMarginCall: {curePeriod: '<string>', ltv: '<string>'},
autoDeleveraging: {levels: [{liquidationPercentage: '<string>', price: '<string>'}]},
clientReferenceId: '<string>',
collateralAssetsConfig: [
{
asset: {assetType: '<string>'},
liquidationPriority: 123,
maxStalenessMinutes: 123,
notes: '<string>',
weight: '<string>'
}
],
critical: {
defaultNotice: true,
ltv: '<string>',
returnToLtv: '<string>',
warningLtv: '<string>'
},
isActive: true,
ltvRoundingPrecision: 123,
marginCall: {
curePeriod: '<string>',
curePeriodProtection: true,
ltv: '<string>',
returnToLtv: '<string>',
warningLtv: '<string>'
},
marginReturn: {ltv: '<string>', returnToLtv: '<string>', returnType: '<string>'}
})
};
fetch('https://api.anchorage-staging.com/v2/collateral_management/packages/{packageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"active": true,
"clientReferenceId": "<string>",
"collateralAssets": [
{
"asset": {
"assetType": "<string>",
"type": "ANCHORAGECUSTODY"
},
"weight": "<string>",
"autoWalletAddress": "<string>",
"autoWalletID": "<string>",
"price": "<string>",
"priceSource": "COINBASEPRO",
"priceStrategy": "DEFAULT",
"quantity": "<string>",
"weightedValue": "<string>"
}
],
"critical": {
"action": "NONE",
"defaultNotice": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"packageId": "<string>",
"pledgorId": "<string>",
"securedPartyId": "<string>",
"acceleratedMarginCall": {
"action": "NONE",
"curePeriod": "<string>",
"ltv": "<string>"
},
"currentLtv": "<string>",
"exposureValue": "<string>",
"ltvTimestamp": "<string>",
"marginCall": {
"action": "NONE",
"curePeriod": "<string>",
"curePeriodProtection": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"topUpType": "LTV",
"warningLtv": "<string>"
},
"marginReturn": {
"action": "NONE",
"ltv": "<string>",
"returnToLtv": "<string>"
},
"packageValue": "<string>",
"state": "MARGIN_RETURN"
}{
"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'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Update a collateral package
Permissions required: Manage Collateral Packages and Read vault activity
Updates an existing collateral package in the Collateral Management service.
curl --request PATCH \
--url https://api.anchorage-staging.com/v2/collateral_management/packages/{packageId} \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"acceleratedMarginCall": {
"curePeriod": "<string>",
"ltv": "<string>"
},
"autoDeleveraging": {
"levels": [
{
"liquidationPercentage": "<string>",
"price": "<string>"
}
]
},
"clientReferenceId": "<string>",
"collateralAssetsConfig": [
{
"asset": {
"assetType": "<string>"
},
"liquidationPriority": 123,
"maxStalenessMinutes": 123,
"notes": "<string>",
"weight": "<string>"
}
],
"critical": {
"defaultNotice": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"isActive": true,
"ltvRoundingPrecision": 123,
"marginCall": {
"curePeriod": "<string>",
"curePeriodProtection": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"marginReturn": {
"ltv": "<string>",
"returnToLtv": "<string>",
"returnType": "<string>"
}
}
'import requests
url = "https://api.anchorage-staging.com/v2/collateral_management/packages/{packageId}"
payload = {
"acceleratedMarginCall": {
"curePeriod": "<string>",
"ltv": "<string>"
},
"autoDeleveraging": { "levels": [
{
"liquidationPercentage": "<string>",
"price": "<string>"
}
] },
"clientReferenceId": "<string>",
"collateralAssetsConfig": [
{
"asset": { "assetType": "<string>" },
"liquidationPriority": 123,
"maxStalenessMinutes": 123,
"notes": "<string>",
"weight": "<string>"
}
],
"critical": {
"defaultNotice": True,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"isActive": True,
"ltvRoundingPrecision": 123,
"marginCall": {
"curePeriod": "<string>",
"curePeriodProtection": True,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"marginReturn": {
"ltv": "<string>",
"returnToLtv": "<string>",
"returnType": "<string>"
}
}
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
acceleratedMarginCall: {curePeriod: '<string>', ltv: '<string>'},
autoDeleveraging: {levels: [{liquidationPercentage: '<string>', price: '<string>'}]},
clientReferenceId: '<string>',
collateralAssetsConfig: [
{
asset: {assetType: '<string>'},
liquidationPriority: 123,
maxStalenessMinutes: 123,
notes: '<string>',
weight: '<string>'
}
],
critical: {
defaultNotice: true,
ltv: '<string>',
returnToLtv: '<string>',
warningLtv: '<string>'
},
isActive: true,
ltvRoundingPrecision: 123,
marginCall: {
curePeriod: '<string>',
curePeriodProtection: true,
ltv: '<string>',
returnToLtv: '<string>',
warningLtv: '<string>'
},
marginReturn: {ltv: '<string>', returnToLtv: '<string>', returnType: '<string>'}
})
};
fetch('https://api.anchorage-staging.com/v2/collateral_management/packages/{packageId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"active": true,
"clientReferenceId": "<string>",
"collateralAssets": [
{
"asset": {
"assetType": "<string>",
"type": "ANCHORAGECUSTODY"
},
"weight": "<string>",
"autoWalletAddress": "<string>",
"autoWalletID": "<string>",
"price": "<string>",
"priceSource": "COINBASEPRO",
"priceStrategy": "DEFAULT",
"quantity": "<string>",
"weightedValue": "<string>"
}
],
"critical": {
"action": "NONE",
"defaultNotice": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"warningLtv": "<string>"
},
"packageId": "<string>",
"pledgorId": "<string>",
"securedPartyId": "<string>",
"acceleratedMarginCall": {
"action": "NONE",
"curePeriod": "<string>",
"ltv": "<string>"
},
"currentLtv": "<string>",
"exposureValue": "<string>",
"ltvTimestamp": "<string>",
"marginCall": {
"action": "NONE",
"curePeriod": "<string>",
"curePeriodProtection": true,
"ltv": "<string>",
"returnToLtv": "<string>",
"topUpType": "LTV",
"warningLtv": "<string>"
},
"marginReturn": {
"action": "NONE",
"ltv": "<string>",
"returnToLtv": "<string>"
},
"packageValue": "<string>",
"state": "MARGIN_RETURN"
}{
"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'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}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}$Path Parameters
Body
The details for updating an existing collateral package
The request payload for updating an existing collateral package. All fields are optional - only provide the fields you want to update.
Deprecated: set priceStrategy on each collateralAssetsConfig entry instead. When sent, every asset on the package takes this value, listed in collateralAssetsConfig or not, and no collateralAssetsConfig entry may carry its own priceStrategy.
DEFAULT, BID, ASK, MID, LAST, CHAINLINK_STRATEGY Response
Successfully updated collateral package
A package of different types of collateral which, together, secure a collection of exposures.
Was this page helpful?