Step 1: Create an API key on the main account
Create an API key on your main account with appropriate permissions for transfers.Please refer to Creating new API key on Deribit for guidance on API key creation.
Step 2: Authenticate with the API key
Callpublic/auth to authenticate:
Example Request
refresh_token. Important: You are now authenticated as the main account, which is required for all transfer operations.
Step 2a: Switch to subaccount context (for subaccount-to-subaccount transfers)
If you need to perform transfers between subaccounts, you must first authorize as the main account (Step 2), then switch to the subaccount context usingpublic/exchange_token or public/fork_token.
Why switch to subaccount? While transfers between subaccounts require main account authorization, switching to the subaccount context allows you to perform the transfer from the subaccount’s perspective. This is the recommended approach for subaccount-to-subaccount transfers.
Using exchange_token
Usepublic/exchange_token with the refresh_token received from main account authentication:
Example Request
access_token and refresh_token for the specified subaccount.
Using fork_token (alternative)
Alternatively, you can usepublic/fork_token to create a new session token for the subaccount:
For more details on token management, see the Authentication Guide section on Fork and Exchange Tokens.
Step 3: Perform the transfer
Transfer from main account to subaccount
To transfer funds from the main account to a subaccount, callprivate/submit_transfer_to_subaccount. You must be authenticated as the main account (from Step 2):
Example Request
Response
Transfer between subaccounts
To transfer funds between two subaccounts under the same main account, callprivate/submit_transfer_between_subaccounts.
Example Request
Response
Execution details
Transfers are executed immediately and are reflected in both accounts. You can check the transfer status using theprivate/get_transfers method.
Example Request
Troubleshooting
If you encounter issues with transfers:- Insufficient balance: Ensure the source account has sufficient balance for the transfer amount
- Invalid subaccount ID: Verify that the destination subaccount ID is correct and belongs to your main account
- Authentication errors: Make sure you’re using a valid access token with appropriate permissions
- Transfer limits: Check if there are any transfer limits or restrictions on your account