Transfer Funds
Moves funds between your CoinSwitch wallet and your HFT trading account.
| Method | POST |
| Path | /dma/api/v1/funds/transfer |
| Auth | Authenticated. |
You'll typically call this once before your first HFT trade to fund the trading account, and then again to withdraw realised PnL back to your wallet.
Settlement currency
Each HFT trading account is locked to a single settlement currency (either USDT or INR) at the time it's first funded. You can transfer either currency, but all subsequent transfers must use the same currency as your first one — the account's currency cannot be changed afterwards.
- USDT-settled accounts trade USDT-margined contracts and can only receive USDT.
- INR-settled accounts trade INR-margined contracts and can only receive INR.
If you need to switch settlement currencies, contact api@coinswitch.co.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
direction | string | Yes | IN to transfer from CoinSwitch wallet → HFT account. OUT for the reverse. |
amount | number | Yes | Amount to transfer, in your account's settlement currency. |
quote_asset | string | No | Settlement currency: USDT (default) or INR. Sets your account's currency on the first transfer; must match your account's locked currency on every subsequent transfer. |
client_txn_id | string | No | Your idempotency key. If you retry with the same client_txn_id, the duplicate is rejected — preventing double-transfers on retries. |
Request
- Python
- Java
- Go
- Node.js
from reference_client import sign_request, BASE_URL
import requests, json, uuid
payload = {
"direction": "IN",
"amount": 100.0,
"quote_asset": "USDT",
"client_txn_id": str(uuid.uuid4())
}
headers, path = sign_request("POST", "/dma/api/v1/funds/transfer")
r = requests.post(BASE_URL + path, headers=headers, data=json.dumps(payload))
print(r.json())
Map<String, Object> body = new HashMap<>();
body.put("direction", "IN");
body.put("amount", 100.0);
body.put("quote_asset", "USDT");
body.put("client_txn_id", str);
HttpResponse<String> resp = client.send(
"POST", "/dma/api/v1/funds/transfer", null, body);
System.out.println(resp.body());
body := map[string]any{
"direction": "IN",
"amount": 100.0,
"quote_asset": "USDT",
"client_txn_id": str(uuid.uuid4()),
}
bodyJSON, _ := json.Marshal(body)
headers, p, err := SignRequest("POST", "/dma/api/v1/funds/transfer", nil)
if err != nil { panic(err) }
req, _ := http.NewRequest("POST", BaseURL+p, bytes.NewReader(bodyJSON))
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const body = {
"direction": "IN",
"amount": 100.0,
"quote_asset": "USDT",
"client_txn_id": str(uuid.uuid4())
};
const {headers, path} = signRequest('POST', '/dma/api/v1/funds/transfer');
const r = await fetch(BASE_URL + path, {
method: 'POST',
headers,
body: JSON.stringify(body),
});
console.log(await r.json());
Response
{
"retCode": 0,
"retMsg": "OK",
"result": {
"amount": 100.0,
"client_txn_id": "a4a7424c-c974-4697-b253-a1d19dbb410b",
"direction": "IN",
"txn_id": "0198f537-4c12-78c9-8059-57f2259c28f2"
},
"retExtInfo": {},
"time": 1756460699967
}
This endpoint uses the standard HFT response envelope — check retCode === 0 before reading result.
| Field | Type | Description |
|---|---|---|
result.amount | number | Amount transferred. |
result.direction | string | Echo of direction. |
result.client_txn_id | string | Echo of your idempotency key (or one we assigned). |
result.txn_id | string | The transaction ID we assign on our side — store it so you can match it against your accounting later. |