Withdrawals

How assets are withdrawn from a customer wallet in Trever

Crypto Withdrawal

1. Sequence diagram of a withdrawal in Trever \

A user can initiate a withdrawal via the Trever App, on the Treasury screen, or via the Trever API. After the user submits the withdrawal, the submitted quantity is locked on the customer’s head account, due to prevention of double spending. Once the quantity is locked, the withdrawal request is sent to the Treasury venue, which serves as the source of the transaction and appears in a list of withdrawals on the Treasury screen. If the Treasury venue cannot withdraw, the submitted quantity, it returns the corresponding error code and the submitted quantity is unlocked in Trever. To fetch withdrawals from the Treasury venue on a regular basis, the Trever Treasury Integration Service uses API polling or a WebSocket, depending on the interfaces provided by the Treasury venue.

Trever distinguishes between five states:

  • PENDING: The withdrawal was submitted. The Trever Treasury Integration Service is waiting for an update.
  • PENDING_REVIEW: The withdrawal is under review from the treasury venue. (Only used by a few treasury venues)
  • FAILED: The withdrawal was not successful. The quantity was not withdrawn from the source wallet.
  • UNKNOWN: The state of the withdrawal can’t be retrieved from the Treasury Integration Service due to connection issues.
  • SUCCESS: The withdrawal was successful. The quantity was withdrawn from the source wallet and deposited to the destination wallet.