VaultClawback

[Source]

Performs a Clawback from the vault, exchanging the shares of an account for assets.

Under the hood, the transaction performs a VaultWithdraw on behalf of the account from which assets are clawed back, converting its shares into assets and transferring the funds to the asset’s issuing account. Because of this, VaultClawback must respect any applicable fees or penalties (e.g., unrealized loss).

Warning

Clawbacks cannot be performed on native XRP.

(Requires the Single Asset Vault amendment )

Example VaultClawback JSON

{
  "TransactionType": "VaultClawback",
  "Account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
  "Fee": "12",
  "Flags": 0,
  "LastLedgerSequence": 7108682,
  "Sequence": 8,
  "VaultID": "77D6234D074E505024D39C04C3F262997B773719AB29ACFA83119E4210328776",
  "Holder": "ruazs5h1qEsqpke88pcqnaseXdm6od2xc",
  "Amount" : "10000"
}

VaultClawback Fields

Field NameJSON TypeInternal TypeRequired?Description
VaultIDStringHash256YesThe unique identifier of the vault from which assets are withdrawn.
HolderStringAccountIDYesThe unique identifier of the account from which to claw back the assets.
AmountNumberNumberNoThe asset amount to claw back. When this field is set to 0, the transaction claws back all funds, up to the total shares the Holder owns.

If the requested amount exceeds the vault’s available assets, the transaction claws back only up to the vault's AssetsAvailable balance. Otherwise, it retrieves the exact asset amount specified in the transaction.

VaultClawback Flags

There are no flags defined for VaultClawback transactions.

Error Cases

Besides errors that can occur for all transactions, VaultClawback transactions can result in the following transaction result codes:

Error CodeDescription
tecNO_ENTRYThe Vault object with the specified VaultID does not exist on the ledger.
tecNO_PERMISSIONThe transaction attempts to claw back XRP, or the asset is a Fungible Token or MPT and the transaction isn't submitted by the issuing account.
tecWRONG_ASSETThe asset in the transaction does not match the vault's asset type.
tecINSUFFICIENT_FUNDSThe MPToken object for the vault share of the Holder account does not exist, or the MPToken.MPTAmount is 0.
temDISABLEDThe Single Asset Vault amendment is not enabled.
temMALFORMEDThe transaction was not validly formatted. For example, if the VaultID is not provided.