GuidesRecipesAPI ReferenceChangelog
Guides

Crypto Cold Storage

How do I transfer crypto in and out of cold storage?

Availability

ℹ️

Production access

To enable crypto cold storage in production, contact the partner success team.

Overview

To store crypto in cold storage for individual customers, business customers, or your bank, create an account of type storage. You can create storage accounts in BTC or USDC on various chains (Ethereum, Stellar, Polygon, and Solana), depending on the chain(s) you want to support. Any balance in a storage account is held in trust with Cybrid's third party cold storage provider.

To store crypto in cold storage, follow these steps:

  1. Create a bank or customer-level trading account for the crypto asset of your choosing, e.g., BTC;
  2. Create a bank or customer-level storage account for the crypto asset of your choosing, e.g., BTC;
  3. Execute trade(s) to add balance to the trading account; and,
  4. Transfer some or all of the balance in the trading account to the storage account of the same asset and owner (e.g., customer or bank) with an inter_account transfer.

1. Creating accounts

If you haven't already done so, create the required customer or bank-level trading and storage accounts. These are one-time operations.

See the guide for creating accounts at the bank-level and the guide for creating a trading account.

An example POST /api/accounts request body for creating a storage account:

{
  "type": "storage",
  "asset": "BTC",
  "customer_guid": "<customer_guid>",
  "name": "<account_name>"
}

The response:

{
  "created_at": "<created_at timestamp>",
  "updated_at": "<updated_at timestamp>",
  "type": "storage",
  "guid": "<account_guid>",
  "asset": "BTC",
  "name": "<account_name>",
  "customer_guid": "<customer_guid>",
  "platform_balance": 0,
  "platform_available": 0,
  "state": "storing",
  "labels": null
}

The account begins in "state": "storing" and automatically progresses to "state": "created", the terminal state for accounts.

2. Execute trade(s) to add balance to the trading account

Follow the guides for creating a quote and executing a trade to add balance to your trading account.

3. Transfer crypto balance to the storage account

First, create an inter_account quote using POST /api/quotes:

{
  "product_type": "inter_account",
  "asset": "BTC",
  "customer_guid": "<customer_guid>",
  "source_account_guid": "<trading_account_guid>",
  "destination_account_guid": "<storage_account_guid>",
  "deliver_amount": 100000
}

The response includes the calculated receive_amount and any applicable network_fee:

{
  "created_at": "<created_at timestamp>",
  "updated_at": "<updated_at timestamp>",
  "guid": "<quote_guid>",
  "product_type": "inter_account",
  "customer_guid": "<customer_guid>",
  "asset": "BTC",
  "side": "deposit",
  "receive_amount": 99000,
  "deliver_amount": 100000,
  "fee": 0,
  "issued_at": "<issued_at timestamp>",
  "expires_at": "<expires_at timestamp>",
  "network_fee": 1000,
  "network_fee_asset": "BTC"
}

For crypto inter_account transfers it is important to understand that any on-chain network or gas fees that are required for the transfer to take place can be seen on the quote in the network_fee field. Network fees on the Cybrid Platform are tracked as a liability to the partner in their gas account, and subtracted from any partner trade revenue or invoiced at the beginning of each month.

Use the above quote GUID in the POST /api/transfers request:

{
  "transfer_type": "inter_account",
  "quote_guid": "<quote_guid>",
  "source_account_guid": "<trading_account_guid>",
  "destination_account_guid": "<storage_account_guid>"
}

The response includes the transfer details:

{
  "created_at": "<created_at timestamp>",
  "updated_at": "<updated_at timestamp>",
  "guid": "<transfer_guid>",
  "transfer_type": "inter_account",
  "customer_guid": "<customer_guid>",
  "quote_guid": "<quote_guid>",
  "external_bank_account_guid": null,
  "asset": "BTC",
  "side": "deposit",
  "state": "storing",
  "failure_code": null,
  "amount": "<deliver_amount>",
  "estimated_amount": "<deliver_amount>",
  "fee": 0,
  "source_account": {
    "type": "trading",
    "guid": "<trading_account_guid>",
    "customer_guid": "<customer_guid>"
  },
  "source_participants": null,
  "destination_account": {
    "type": "storage",
    "guid": "<storage_account_guid>",
    "customer_guid": "<customer_guid>"
  },
  "destination_participants": null,
  "labels": null
}

Use GET /api/transfers/{transfer_guid} to verify the transfer state.

Once the transfer reaches "state": "completed", use GET /api/accounts/{account_guid} to verify that the platform_available balance of the storage account reflects the transfer amount.

4. Transfer crypto balance from the storage account

At any time, transfer crypto out of the storage account back to the customer or bank's trading account by creating a quote with source_account_guid set to the storage account GUID and destination_account_guid set to the trading account GUID.

Once the quote is created, generate an inter_account transfer from the quote.