Account Endpoints

Account Information

  • Path: /api/v1/account/balance

  • Method: GET

  • Description: Query account information

  • Parameters:

  • Response:

β”œβ”€ code: Number
β”œβ”€ msg: String
└─ data: Object
   β”œβ”€ totalWalletBalance: String  (total wallet balance, only for USDT asset)
   β”œβ”€ totalUnrealizedProfit: String  (total unrealized profit, only for USDT asset)
   β”œβ”€ totalMarginBalance: String  (total margin balance, only for USDT asset)
   β”œβ”€ totalPositionMargin: String  (initial margin required for positions with current mark price, only for USDT asset)
   β”œβ”€ totalFrozenMargin: String  (initial margin required for open orders with current mark price, only for USDT asset)
   β”œβ”€ totalFrozenMoney: String  (total frozen money, only for USDT asset)
   β”œβ”€ totalAvailableBalance: String  (available balance, only for USDT asset)
   └─ assets: Array
      β”œβ”€ asset: String
      β”œβ”€ walletBalance: String  (wallet balance)
      β”œβ”€ unrealizedProfit: String  (unrealized profit)
      β”œβ”€ marginBalance: String  (margin balance)
      β”œβ”€ positionMargin: String  (total initial margin required with current mark price)
      β”œβ”€ frozenMargin: String  (initial margin required for open orders with current mark price)
      β”œβ”€ frozenMoney: String  (frozen money)
      β”œβ”€ availableBalance: String  (available balance)
      └─ updateTime: Number
  • Example:

Request:

https://api.aboard.exchange/arbitrum/api/v1/account/balance

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "totalWalletBalance": "23.72469206",
    "totalUnrealizedProfit": "0.00000000",
    "totalMarginBalance": "23.72469206",
    "totalPositionMargin": "0.00000000",
    "totalFrozenMargin": "0.00000000",
    "totalFrozenMoney": "0.00000000",
    "totalAvailableBalance": "23.72469206",
    "assets": [
      {
        "asset": "USDT",
        "walletBalance": "23.72469206",
        "unrealizedProfit": "0.00000000",
        "marginBalance": "23.72469206",
        "positionMargin": "0.00000000",
        "frozenMargin": "0.00000000",
        "frozenMoney": "0.00000000",
        "availableBalance": "23.72469206",
        "updateTime": 1625474304765
      }
    ]
  }
}

Query Position

  • Path: /api/v1/account/positions

  • Method: GET

  • Description: Query position

  • Parameters:

└─ symbol: String
  • Response:

β”œβ”€ code: Number
β”œβ”€ msg: String
└─ data: Array
   β”œβ”€ symbol: String
   β”œβ”€ positionSide: String
   β”œβ”€ marginType: String  (margin mode:ISOLATED/CROSSED)
   β”œβ”€ positionAmt: String  (Position quantity. The symbol represents the long and short direction. Positive numbers are many and negative numbers are empty)
   β”œβ”€ availableAmt: String  (Open position quantity)
   β”œβ”€ leverage: String
   β”œβ”€ openPrice: String
   β”œβ”€ unRealizedProfit: String  (Unrealized profits and losses of positions)
   β”œβ”€ positionMargin: String  (Position margin)
   β”œβ”€ isAutoAddMargin: String  (If increase margin when Isolated)
   β”œβ”€ isolatedMargin: String  (Isolated margin)
   β”œβ”€ markPrice: String  (Mark price)
   β”œβ”€ liquidationPrice: String  (Liquidation price)
   β”œβ”€ marginRate: String  (Margin rate)
   └─ updateTime: Number
  • Example:

Request:

https://api.aboard.exchange/arbitrum/api/v1/account/positions?symbol=ETH-USDC

Response:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "symbol": "ETH-USDC",
      "positionSide": "NET",
      "marginType": "CROSSED",
      "positionAmt": "-234.78",
      "availableAmt": "200",
      "leverage": "10",
      "openPrice": "0.00000",
      "unRealizedProfit": "0.00",
      "positionMargin": "0.00",
      "isAutoAddMargin": "false",
      "isolatedMargin": "0.00",
      "markPrice": "6679.50671178",
      "liquidationPrice": "0",
      "marginRate": "0",
      "updateTime": 1625474304765
    }
  ]
}

Get Income History

  • Path: /api/v1/account/bills

  • Method: GET

  • Description: Get income history

  • Parameters:

β”œβ”€ symbol: String
β”œβ”€ billType: String (DEPOSIT, WITHDRAW, REALIZED_PNL,FUNDING_FEE, COMMISSION, LIQUIDATION)
β”œβ”€ startTime: Number
β”œβ”€ endTime: Number
└─ limit: Number (Number of result sets returned, default:100 maximum:500)
  • Response:

β”œβ”€ code: Number
β”œβ”€ msg: String
└─ data: Array
   β”œβ”€ symbol: String  (trade symbol, if existing)
   β”œβ”€ billType: String  (income type)
   β”œβ”€ amount: String  (income amount)
   β”œβ”€ asset: String  (income asset)
   β”œβ”€ info: String  (extra information)
   β”œβ”€ insertTime: Number
   └─ id: String  (trade id)
  • Example:

Request:

https://api.aboard.exchange/arbitrum/api/v1/account/bills?symbol=ETH-USDC&billType=REALIZED_PNL&startTime=1628575642000&endTime=1628585642000&limit=100

Response:

{
  "code": 0,
  "msg": "",
  "data": [
    {
      "symbol": "ETH-USDC",
      "billType": "REALIZED_PNL",
      "amount": "-0.37500000",
      "asset": "USDT",
      "info": "REALIZED_PNL",
      "insertTime": 1570608000000,
      "id": "9689322392"
    }
  ]
}

User Commission Rate

  • Path: /api/v1/account/commissionRate

  • Method: GET

  • Description: Query user commission rate

  • Parameters:

└─ symbol: String
  • Response:

β”œβ”€ code: Number
β”œβ”€ msg: String
└─ data: Object
   β”œβ”€ symbol: String
   β”œβ”€ makerCommissionRate: String  (maker commission rate)
   └─ takerCommissionRate: String  (taker commission rate)
  • Example:

Request:

https://api.aboard.exchange/arbitrum/api/v1/account/commissionRate?symbol=ETH-USDC

Response:

{
  "code": 0,
  "msg": "",
  "data": {
    "symbol": "",
    "makerCommissionRate": "0.0002",
    "takerCommissionRate": "0.0004",
    "withdrawFee": "5"
  }
}

Deposit

Web3 interaction. Refer to SDK.

Withdraw

- Path: /api/v1/account/withdraw
- Method: POST
- Description: Withdraw
- Body:
    β”œβ”€ asset: String (Mandatory)
    β”œβ”€ amount: Number (Mandatory)
    └─ destination: String (Mandatory)  (Must be the same address with your account. )

Requests Web3 contract function params.

  • Response:

β”œβ”€ code: Number
β”œβ”€ msg: String
└─ data: Object  # Web3 contract function params
    β”œβ”€withdrawId: String
    β”œβ”€expiringTimestamp: Number
    └─signature: String
        β”œβ”€ r: String
        β”œβ”€ s: String
        └─ v: String
  • Example:

Request:
```
{
  "asset": "USDC",
  "amount": "1000",
  "destination": "0x2222..."
}
```

Response:

```
{
    'code': 0,
    'msg': '',
    'data': {
        'withdrawId': '50211378',
        'signature': {
            'r': '0x32951xxxx',
            's': '0x662e7xxxx',
            'v': '0x1c'},
        'expiringTimestamp': 1672718184}
}
```

Then call the Web3 contract function to withdraw. Please refer to the method in SDK.

Last updated