Crypto Cold Storage
How do I transfer crypto in and out of cold storage?
Availability
To enable in the production environment, please contact the partner success team.
Overview
In order to support individual and business customers, as well as your bank, to store crypto in cold storage, an account of type storage
must be created. storage
accounts can be created in BTC
or USDC
on various chains, e.g., Ethereum, Stellar, Polygon and Solana, depending on the chain(s) you want to support. Any balance stored in a storage
account is held in trust with Cybrid's third party cold storage provider.
To allow a customer or your bank to store crypto in cold storage follow these steps on the Cybrid Platform:
- Create a bank or customer-level
trading
account for the crypto asset of your choosing, e.g.,BTC
; - Create a bank or customer-level
storage
account for the crypto asset of your choosing, e.g.,BTC
; - Execute trade(s) to add balance to the
trading
account; and, - Transfer some or all of the balance in the
trading
account to thestorage
account of the same asset and owner, e.g., customer or bank with aninter-account
transfer.
1. Creating accounts
If you haven't already done so, create the required customer or bank-level fiat trading
and storage
accounts. These are one-time operations.
See the guide for creating accounts at the bank-level here and the guid for creating a trading
account here.
An example POST /api/accounts
request body for creating a storage
account is below:
{
"type": "storage",
"asset": "BTC",
"customer_guid": "<customer_guid>",
"name": "<insert account descriptive name>"
}
When executed, the following response body will be returned:
{
"created_at": "<created_at timestamp>",
"updated_at": "<updated_at timestamp>",
"type": "storage",
"guid": "<created account GUID>",
"asset": "BTC",
"name": "<inserted account descriptive name>",
"customer_guid": "<customer_guid>",
"platform_balance": 0,
"platform_available": 0,
"state": "storing",
"labels": null
}
The account will begin in "state":"storing"
, and automatically progress to "state":"created"
which is the terminal state for accounts.
2. Execute trade(s) to add balance to the trading
account
trading
accountFollow 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
storage
accountFirst, an inter_account
must be executed:
{
"product_type": "inter_account",
"asset": "BTC",
"customer_guid": "<customer_guid>",
"source_platform_account": "<trading account guid>",
"destination_platform_account": "<storage account guid>",
"deliver_amount": <insert deliver_amount>,
"network_fee": 1000,
"network_fee_asset": "BTC"
}
When executed, the following response body will be returned:
{
"created_at": "<created_at timestamp>",
"updated_at": "<updated_at timestamp>",
"guid": "<created quote_guid>",
"product_type": "inter_account",
"customer_guid": "<customer_guid>",
"asset": "BTC",
"side": "deposit",
"receive_amount": <calculated receive_amount>,
"deliver_amount": <inserted deliver_amount>,
"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 the above quote GUID in the POST /api/transfers
request.
An example POST /api/transfers
request body is below:
{
"transfer_type": "inter_account",
"quote_guid": "<insert quote_guid>",
"source_platform_account": "<trading account guid>",
"destination_platform_account": "<storage account guid>",
}
When executed, the following response body will be returned:
{
"created_at": "<created_at timestamp>",
"updated_at": "<updated_at timestamp>",
"guid": "<created transfer_guid>",
"transfer_type": "inter_account",
"customer_guid": "<customer_guid>",
"quote_guid": "<inserted quote_guid>",
"external_bank_account_guid": null,
"asset": "BTC",
"side": "deposit",
"state": "storing",
"failure_code": null,
"amount": <inserted deliver_amount>,
"estimated_amount": <inserted 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 the GET /api/transfers/{transfer_guid}
endpoint to verify the "state" of the transfer.
Once the transfer has progressed to "state":"completed"
, use the GET /api/accounts/{account_guid}
endpoint to verify that the "platform_available" balance of the storage
account has been credited to the reflect the transfer amount.
4. Transfer crypto balance from the storage
account
storage
accountAt any time, crypto can be transferred out of the storage
account back to the customer or bank's trading
account by first executing a quote with the source_platform_account
set to the storage
account guid and the destination_platform_account
set to the trading
account guid.
Once a quote has been executed an inter_account
transfer can be generated from the quote.
Updated 2 days ago