Withdraw
Withdraw assets from your Bybit account. You can make an off-chain transfer if the target wallet address is from Bybit. This means that no blockchain fee will be charged.
danger
- UTA does not have SPOT account
- How do I know if my account is a UTA account? Call this endpoint, and if
uta
=1, then it is a UTA account.
caution
- Make sure you have whitelisted your wallet address here
- Can query by the master UID's api key only
formula
feeType=0:
- withdrawPercentageFee != 0: handlingFee = inputAmount / (1 - withdrawPercentageFee) * withdrawPercentageFee + withdrawFee
- withdrawPercentageFee = 0: handlingFee = withdrawFee
feeType=1:
- withdrawPercentageFee != 0: handlingFee = withdrawFee + (inputAmount - withdrawFee) * withdrawPercentageFee
- withdrawPercentageFee = 0: handlingFee = withdrawFee
HTTP Request
POST /v5/asset/withdraw/create
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
coin | true | string | Coin |
chain | false | string | Chain
|
address | true | string |
|
tag | false | string | Tag
|
amount | true | string | Withdraw amount |
timestamp | true | integer | Current timestamp (ms). Used for preventing from withdraw replay |
forceChain | false | integer | Whether or not to force an on-chain withdrawal
|
accountType | false | string | Select the wallet to be withdrawn from
|
feeType | false | integer | Handling fee option
|
requestId | false | string | Customised ID, globally unique, it is used for idempotent verification |
Response Parameters
Parameter | Type | Comments |
---|---|---|
id | string | Withdrawal ID |
Request Example
- HTTP
- Python
POST /v5/asset/withdraw/create HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672196570254
X-BAPI-RECV-WINDOW: 5000
X-BAPI-SIGN: XXXXX
Content-Type: application/json
{
"coin": "USDT",
"chain": "ETH",
"address": "0x99ced129603abc771c0dabe935c326ff6c86645d",
"tag": null,
"amount": "24",
"timestamp": 1672196561407,
"forceChain": 0,
"accountType": "FUND"
}
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.withdraw(
coin="USDT",
chain="ETH",
address="0x99ced129603abc771c0dabe935c326ff6c86645d",
amount="24",
timestamp=1672196561407,
forceChain=0,
accountType="FUND",
))
Response Example
{
"retCode": 0,
"retMsg": "success",
"result": {
"id": "10195"
},
"retExtInfo": {},
"time": 1672196571239
}