Changelogs
| version | time | content |
|---|---|---|
| V1.0.0 | 2023-09-28 |
initial version |
| V1.0.1 | 2023-11-29 |
Update endpoints for "Account Transfer Records"(GET /credit/agency/v1/account/funds), add new response field transfer_fee for cross transfer withdrawal fee |
| V1.0.2 | 2024-12-02 |
Update Transfer API |
Introduction
Communication Protocol
HTTPS Protocol.
Encoding
The request and response data code for all interfaces is formatted according to UTF-8. Content for responses in all interfaces is formatted according to JSON.
Permission Selection
Prime Broker API Key needs Read, Earn permissions. If you need to access your Prime account wallet data, select wallet permission. Querying data through the wallet interface
| Get | Post |
|---|---|
| Read | Earn |
Read Earn
API Request Structure
| Name | Description | Notes |
|---|---|---|
| API Address | Address for API interface | Eg. https://mapi.matrixport.com/collateral-lending/api/v1/product |
| Public Parameters | Universal parameters for all interfaces | |
| Private Parameter | Special parameters for each interface | See each API interface description for details |
API hosts (production)
- REST API:
https://mapi.matrixport.com
Public Parameters
Public parameters are used for interface authentication. Unless otherwise necessary, these parameters will be omitted for each interface. Each request must contain these parameters unless stated otherwise.
| Parameter Name | Type | Mandatory | Limit | Description |
|---|---|---|---|---|
| x-request-id | string | N | - | Globally unique trace id, used for tracing requests, Strongly recommended to pass in the request header. |
Response Format Strings
All interface response values are formatted according to JSON. Unless otherwise stated, all request return values contain the following text strings:
| Parameter Name | Type | Description |
|---|---|---|
| code | int | Interface call status, (ie. error code): 0: Normal, Others: Call error. |
| message | string | Error message is description of API errors |
| data | object | Results will return as defined by each interface |
Error Codes
- Response return calls indicate the call and execution result summary for current API services. Return code messages provide additional information for the user to determine API execution.
- All interface call return values contain an error code (value) and message (error description). See below:
| Return Codes | Details |
|---|---|
| 0 | OK. |
| 12070131 | User Not Activated |
| 12070106 | Account Type Mismatch |
| 12070108 | Account Not Activated |
| 12070316 | Order ID Mismatch |
| 12070317 | Account ID Mismatch |
| 12070318 | Renewal Time Not Yet Reached |
| 12070319 | Not Enough Margin Amount |
| 12070323 | Contract is Active |
| 12070337 | Interest Amount Too Small |
| 12070338 | Insufficient Withdrawable Margin |
| 12070339 | There are Outstanding Bills |
| 12070340 | The current order status does not support this operation |
| 12070341 | Loan Application Amount Does Not Match Leverage Amount |
| 12070342 | Renewal Application: Renewal Amount must be less than or equal to the original order amount |
| 12070343 | Renewal Application in Progress or Already Renewed |
| 12070345 | Product Unavailable |
| 12070349 | Currently Unavailable for Purchase |
| 12070350 | Product Information has been Updated |
| 12070524 | Decimal Places Exceed Limit |
| 12070525 | Withdrawal Amount Too Low |
| 12070526 | Exchange Maintenance in Progress |
| 12070527 | Currency Maintenance in Progress |
| 12070528 | Repeated Request |
| 12070538 | transfer serial no invalid |
| 12070353 | Failed to Retrieve Daily Interest Rate |
| 12070368 | Margin Operation in Progress |
| 12070370 | Exceeded RCU Limit |
| 12070519 | The current exchange does not support this currency at the moment |
| 12070521 | System Maintenance in Progress |
| 12070135 | Currency Does Not Support Real-Time Transfers |
| 12070136 | Insufficient Exchange Limit for Instant Transfers |
| 12070137 | Exchange Does Not Support Instant Transfers |
| 12070129 | Account Verification Failed |
| 12070130 | Transfer Verification Failed |
| 12070132 | Duplicate Serial No |
| 12070134 | KYC Compliance Check Failed |
Enum
- Order Status Enum
| code | description |
|---|---|
| 0 | OK. |
| -1 | Canceled |
| 6 | Pending Margin Deposit |
| 7 | Pending Loan |
| 11 | Pending Repayment |
| 12 | Overdue |
| 13 | Repaid |
| 15 | Renewal Application in Progress |
| 17 | Renewal in Progress |
| 19 | Renewed |
| 20 | Loan in Progress |
| 22 | Contract Pending Update |
| 23 | Pending Approval |
- Order Type Enum
| code | description |
|---|---|
| 1 | Margin Loan |
| 2 | Fund Accelerator |
| 3 | Custody |
| 4 | Basis Trading |
- Account Status Enum
| code | description |
|---|---|
| 1 | Pending Approval |
| 2 | Account Opened |
| 3 | Account Opening |
| 4 | Reject |
| 5 | Pending Exchange Account Opening |
| 6 | Deleted |
- Account Type Enum
| code | description |
|---|---|
| matrix.user.bal | Matrix Wallet |
| exchange.sub | Exchange Sub-Account |
- Exchange Type Enum
| code | description |
|---|---|
| 1 | CEX |
| 2 | DEX |
- DMA Bill Status Enum
| code | description |
|---|---|
| 1 | Pending Payment |
| 2 | Repaying |
| 3 | Repaid |
| 4 | Reduction Pending Approval |
- Op Status Enum
| code | description |
|---|---|
| 1 | Pending Approval |
| 2 | Approved |
| 3 | Reject |
| 4 | Processing |
| 5 | Processed |
| 6 | Failed |
- Op Type Enum
| code | description |
|---|---|
| 1 | Transfer Margin |
| 2 | Principal Repay |
| 4 | Renew |
| 7 | Loan |
| 8 | Interest Repay |
| 10 | Business Approval |
| 13 | Order Contract Approval |
| 14 | Withdraw Margin |
| 15 | Modify Equity Amount |
| 18 | Loan Lock Amount |
| 19 | Loan UnLock Amount |
| 21 | Order Margin Migration |
| 23 | Create Order Extra Fee |
| 24 | Repay Order Extra Fee |
| 25 | Profit Allocation to Margin |
| 26 | Order Margin Migration In |
| 27 | Create Distribution Fee |
| 30 | Modify Order Due Time |
| 35 | Delete Order Extra Fee |
- Scenario Enum
| code | description |
|---|---|
| add_margin | Transfer Margin |
| make_credit | Loan |
| ex_sub_repay_interest | Exchange Sub-Account Pays Interest |
| bal_repay_interest | Matrix Wallet Pays Interest |
| ex_sub_repay_principal | Exchange Sub-Account Pays Principal |
| take_profit | Profit Accrual |
| allocate | Exchange Transfer |
| take_margin | Withdraw Margin |
| share_profit | Profit Sharing Provision |
| lock_credit | Lock Loan Amount |
| un_lock_credit | UnLock Loan Amount |
| trading_fee_deduction | Withdraw Transaction Fee |
| ex_sub_repay_order_extra | Exchange Sub-Account Pays Order Extra Fee |
| bal_repay_order_extra | Matrix Wallet Pays Order Extra Fee |
| refund | Exchange Transfer Refund |
| instant_transfer | Instant Transfer |
| instant_transfer_refund | Instant Transfer Refund |
| bal_repay_credit_statement | Matrix Wallet Pays Credit Statement |
| bal_repay_dma | Matrix Wallet Pays Direct Market Access Bill |
| ex_sub_repay_dma | Exchange Sub-Account Pays Direct Market Access Bill |
| ex_sub_clear | Exchange Sub-Account Asset Clear |
- Bill Status Enum
| code | description |
|---|---|
| 1 | Pending Payment |
| 2 | Repaid |
| 3 | Repaying |
- Bill Type Enum
| code | description |
|---|---|
| 1 | Interest |
| 2 | Penalty Interest |
| 3 | Pre Repay Penalty Interest |
| 4 | Order Extra Fee |
Exchange Parameter
| Exchange Name | Exchange Unique ID |
|---|---|
| Binance | binance |
| Huobi | huobi |
| OKX | okex |
| bit.com | bit.com |
| Bybit | bybit |
| Deribit | deribit |
| Coinbase | coinbase |
| Kucoin | kucoin |
| Kraken | kraken |
| Gate.io | gate |
| Bitget | bitget |
Authentication
Trading Accounts API
Transfer
Interface Description
- Funds transfer between trading accounts bound to the same RCU
- For accounts without RCU or non-Margin Lending RCU this interface can be used to transfer funds between Prime wallet and trading accounts
POST
/credit/agency/v1/allocateRequest Parameters
- Request Parameter Location: body
- from_account / to_account: Get the account ID from “Trading”--” Account List” Account Number
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| from_account | string | Y | account_id from accounts |
888.bal | |
| from_wallet_type | integer | N | default 0. wallet_type returned by wallet types |
0 | |
| to_account | string | Y | account_id from accounts |
888_binance_1 | |
| to_wallet_type | integer | N | default 0, wallet_type returned by wallet types |
0 | |
| currency | string | Y | currency returned by currencies | BTC | |
| chain | string | N | the chain you preferred returned by chains | ERC20 | |
| amount | string | Y | transfer amount, minimum limit | "1.23" | |
| is_instant_transfer | boolean | N | using the instant transfer, | true/false | |
| serial_no | string | Y | 8 to 32 character string | example: timestamp, comply with rules "^[a-zA-Z0-9_-]+$" | "1695634589886" |
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
Data Structure & Description:
Transfer Case
| Case | Transfer limitations | Required parameter | Support instant transfers |
|---|---|---|---|
| PB wallet to CEX | No limits | amount, currency, from_account, to account, serial_no | N |
| PB wallet to Defi a/c | No limits | amount, currency, chain, from_account, to account, serial_no | N |
| CEX to CEX | 1. Bind the same RCU accounts 2. Unbound RCU accounts |
amount, currency, from_account, to account, serial_no | Y |
| CEX to PB wallet | 1. Unbound RCU accounts | amount, currency, from_account, to account, serial_no | N |
| CEX to Defi a/c | 1. Bind the same RCU accounts 2. Unbound RCU accounts |
amount, currency, chain, from_account, to account, serial_no | N |
| Defi a/c to PB wallet | 1. Unbound RCU accounts | amount, currency, chain, from_account, to account, serial_no | N |
| Defi a/c to Defi a/c | 1. Bind the same RCU accounts 2. Unbound RCU accounts |
amount, currency, chain, from_account, to account, serial_no | N |
| Defi a/c to CEX | 1. Bind the same RCU accounts 2. Unbound RCU accounts |
amount, currency, chain, from_account, to account, serial_no | N |
- Python Demo (Signature and Request)
import hmac
import time
from hashlib import sha256
import requests
access_key = "Your Access Key" # keep secret
secret_key = (
"Your Secret Key" # keep secret
)
def sign(data, api_path):
s = [api_path]
ss = ["{}={}".format(j, k) for j, k in sorted(list(data.items()))]
s.extend(ss)
str_to_sign = "&".join(s)
signature = (
hmac.new(
secret_key.encode("utf-8"), str_to_sign.encode("UTF-8"), digestmod=sha256
)
.hexdigest()
.upper()
)
return signature
def transfer(host, api_path):
now = int(round(time.time() * 1000))
data = {
"amount": "1",
"currency": "BTC",
"from_account": "9547_huobi_1",
"timestamp": now,
"to_account": "9547_okex_1",
"serial_no": str(now),
}
signature = sign(data, api_path)
data["signature"] = signature
print(data)
header = {
"X-MatrixPort-Access-Key": access_key,
"X-MatrixPort-Access-Signature": signature,
"Content-Type": "application/json",
}
res = requests.post(host + api_path, headers=header, json=data)
print(res.text)
if __name__ == "__main__":
# prod host
_host = "https://mapi.matrixport.com"
_api_path = "/credit/agency/v1/allocate"
transfer(_host, _api_path)
{
"code": 0,
"data": null,
"message": "string"
}
Transfer Record
Interface Description
- Includes records of cross-transfers and profit accrual withdrawals.
GET
/credit/agency/v1/allocateRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit |
|---|---|---|---|
| serial_no | string | Y | 8 to 32 character string |
curl "https://mapi.matrixport.com/credit/agency/v1/allocate?serial_no=1695634589886"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"amount": "string",
"currency": "string",
"from_account": "string",
"process": 0,
"scenario": "string",
"serial_no": "string",
"to_account": "string",
"user_id": "string"
},
"message": "string"
}
| Parameter Name | Type | Description |
|---|---|---|
| process | integer | 1:Pending 2:Processing 3:Processed 4:Failed |
| scenario | string | Scenario [Enum:allocate,instant_transfer] |
Wallet Types
Interface Description
- Wallet Types
GET
/credit/agency/v1/exchange/walletsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| account_id | string | Y | account_id from accounts |
888_binance_1 |
curl "https://mapi.matrixport.com/credit/agency/v1/exchange/wallets?account_id=888_binance_1"
- Response Results
- Response is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"wallets": [
{
"wallet_type": 0,
"wallet_name": "spot"
},
{
"wallet_type": 1,
"wallet_name": "unified"
},
{
"wallet_type": 2,
"wallet_name": "contract"
}
]
},
"message": ""
}
Available Currencies
Interface Description
- Available Currencies
GET
/credit/agency/v1/allocate_currenciesRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| from_account | string | Y | account_id from accounts |
888.bal | |
| to_account | string | Y | account_id from accounts |
888_binance_1 |
curl "https://mapi.matrixport.com/credit/agency/v1/allocate_currencies?from_account=888.bal&to_account=888_binance_1"
- Response Results
- Response is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"currencies": [
"BTC",
"ETH",
"USDT"
]
},
"message": ""
}
Available Chains
Interface Description
- Available Chains
GET
/credit/agency/v1/available_chainsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| from_account | string | Y | account_id from accounts |
888.bal | |
| to_account | string | Y | account_id from accounts |
888_binance_1 | |
| currency | string | Y | currency from currencies | BTC |
curl "https://mapi.matrixport.com/credit/agency/v1/available_chains?currency=BTC&from_account=888.bal&to_account=888_binance_1"
- Response Results
- Response is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"chains": [
"BTC",
"ERC20"
]
},
"message": ""
}
Exchange Minimum Transfer Amount Limit
Interface Description
- querying amount supports decimal places and minimum amount limit
GET
/credit/agency/v1/exchange/minimum_amountRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit |
|---|---|---|---|
| exchange | string | Y | huobi,binance,okex... |
| currency | string | N |
curl "https://mapi.matrixport.com/credit/agency/v1/exchange/minimum_amount?exchange=binance"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"exchange": "binance",
"currency_info": [
{
"currency": "ETH",
"minimum_amount": "0.02",
"digit": 5
},
{
"currency": "USDT",
"minimum_amount": "10",
"digit": 6
},
{
"currency": "USDC",
"minimum_amount": "10",
"digit": 1
},
{
"currency": "BUSD",
"minimum_amount": "50",
"digit": 3
},
{
"currency": "BTC",
"minimum_amount": "0.001",
"digit": 6
},
{
"currency": "BCH",
"minimum_amount": "1",
"digit": 5
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| minimum_amount | string | Minimum Transfer Amount |
| digit | integer | Maximum Supported Decimal Places |
Profit Accrual
Interface Description
- Users withdraw profits through exchange sub-accounts
- After applying, funds will be transferred back to prime wallet upon approval
- The application sub-account must be associated with a loan order RCU (Margin lending / Basis trading). The trading account id associated with the RCU can be queried through the “Rcu Accounts” interface
POST
/credit/agency/v1/user/profit_accrualRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| amount | string | Y | transfer amount | "1.23" | |
| currency | string | Y | currency | BTC | |
| account_id | string | Y | from account id | 888_binance_1 | |
| serial_no | string | Y | 8 to 32 character string | example: timestamp | "1695634589886" |
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": "string",
"message": "string"
}
| Parameter Name | Type | Description |
|---|---|---|
| data | string | serial no |
Create Account
Interface Description
- custody_id can be queried through the “Exchange Custody” interface
POST
/credit/agency/v1/accountRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| exchange | string | Y | huobi,binance,okex... | binance | |
| custody_id | string | N | Supported Custody ID on the Exchange | "7053683719172829184" | |
| request_id | string | Y | 8 to 32 character string | example: timestamp | "1695634589886" |
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": "string",
"message": "string"
}
| Parameter Name | Type | Description | example |
|---|---|---|---|
| data | string | account id | 888_binance_1 |
Account Balance
Interface Description
- Check Exchange Spot/Fund Account Balance.
- This balance is the amount of coins that can be withdrawn from the exchange account via the transfer interface.
GET
/credit/agency/v1/account/balanceRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| account_id | string | Y | account id | 888_binance_1 |
curl "https://mapi.matrixport.com/credit/agency/v1/account/balance?account_id=888_binance_1"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": [
{
"currency": "RACA",
"amount": "1000000"
},
{
"currency": "LUNA",
"amount": "1000000"
},
{
"currency": "STETH",
"amount": "1000000"
},
{
"currency": "BTC",
"amount": "1000114.540727"
}
],
"message": ""
}
Account Flows
Interface Description
- Account Flows
GET
/credit/agency/v1/account/flowsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| account_id | string | N | account id | 888_binance_1 | |
| account_type | string | N | Account Type [Enum:matrix.user.bal,exchange.sub] | exchange.sub | |
| currency | string | N | currency | BTC | |
| start_time | integer | N | start time | 1693497600000 | |
| end_time | integer | N | end time | 1694188800000 | |
| exchange | string | N | huobi,binance,okex... | binance | |
| scenario | string | N | Scenario Enum | allocate | |
| serial_no | string | N | transfer step serial no | 1694188800000_1 | |
| transfer_serial_no | string | N | transfer serial no | 1694188800000 |
curl "https://mapi.matrixport.com/credit/agency/v1/account/flows?limit=10&exchange=binance"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 2,
"items": [
{
"serial_no": "cell_ao_repaid_7112336969107267584",
"user_id": "606113",
"exchange": "matrixport",
"account_id": "606113.bal",
"account_type": "matrix.user.bal",
"scenario": "bal_repay_interest",
"direction": 2,
"currency": "USDT",
"amount": "1.933767",
"instant_transfer_fee": "0",
"created_at": 1695713279182
},
{
"serial_no": "7112336969107267584-0",
"user_id": "606113",
"exchange": "matrixport",
"account_id": "606113.bal",
"account_type": "matrix.user.bal",
"scenario": "bal_repay_interest",
"direction": 1,
"currency": "USDT",
"amount": "1.933767",
"instant_transfer_fee": "0",
"created_at": 1695713274489
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| serial_no | string | Serial NO |
| user_id | string | User ID |
| exchange | string | Exchange |
| account_id | string | account id |
| account_type | string | Account Type [Enum:matrix.user.bal,exchange.sub] |
| scenario | string | Scenario Enum |
| direction | integer | Deposit and Withdrawal Direction [Enum:1 IN,2 OUT] |
| currency | string | currency |
| amount | string | amount |
| instant_transfer_fee | string | instant transfer fee |
| created_at | integer | created time, ms |
Account Transfer Records
Interface Description
- Account Transfer Records
GET
/credit/agency/v1/account/fundsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| currency | string | N | currency | BTC | |
| start_time | integer | N | start time | 1693497600000 | |
| end_time | integer | N | end time | 1694188800000 | |
| from_account_id | string | N | from account id | 888_binance_1 | |
| from_exchange | string | N | from exchange | binance | |
| to_account_id | string | N | to account id | 888.bal | |
| to_exchange | string | N | to exchange | huobi | |
| process | integer | N | 1:Pending 2:Processing 3:Processed 4:Failed | 1 | |
| scenario | string | N | Scenario Enum | allocate | |
| serial_no | string | N | serial no | 1694188800000 |
curl "https://mapi.matrixport.com/credit/agency/v1/account/funds?limit=10&exchange=binance"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 802,
"items": [
{
"user_id": "606113",
"serial_no": "7112336969107267584",
"from_account": "606113.bal",
"to_account": "606113.bal",
"currency": "USDT",
"amount": "1.933767",
"process": 3,
"scenario": "bal_repay_interest",
"created_at": 1695801849000,
"instant_transfer_fee": "0",
"transfer_fee": "0"
},
{
"user_id": "606113",
"serial_no": "7112336870213967872",
"from_account": "606113.bal",
"to_account": "capital_Matrixport",
"currency": "USDT",
"amount": "22",
"process": 3,
"scenario": "bal_repay_order_extra",
"created_at": 1695801849000,
"instant_transfer_fee": "0",
"transfer_fee": "0"
},
{
"user_id": "644052",
"serial_no": "71352102757831147522",
"from_account": "644052_binance_8",
"to_account": "644052_deribit_523712",
"currency": "ETH",
"amount": "8",
"process": 3,
"scenario": "allocate",
"created_at": 1701166695988,
"instant_transfer_fee": "0",
"transfer_fee": "0.0023"
},
{
"user_id": "644052",
"serial_no": "71355872015635578881",
"from_account": "644052_bit.com_132800",
"to_account": "644052_okex_8",
"currency": "BTC",
"amount": "11",
"process": 2,
"scenario": "allocate",
"created_at": 1701256561715,
"instant_transfer_fee": "0",
"transfer_fee": "0"
},
{
"user_id": "606113",
"serial_no": "7112013725087064064USDT",
"from_account": "606113_binance_865408",
"to_account": "master_binance",
"currency": "USDT",
"amount": "100",
"process": 3,
"scenario": "ex_sub_clear",
"created_at": 1695801849000,
"instant_transfer_fee": "0",
"transfer_fee": "0"
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| user_id | string | User ID |
| serial_no | string | Serial NO |
| from_account | string | from account id |
| to_account | string | to account id |
| currency | string | currency |
| amount | string | amount |
| scenario | string | Scenario Enum |
| instant_transfer_fee | string | instant transfer fee. the received amount = amount - instant_transfer_fee |
| transfer_fee | string | transfer fee. the received amount = amount - transfer_fee |
| created_at | string | created time,ms |
Account List
Interface Description
- Account List
GET
/credit/agency/v1/accountsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| account_id | string | N | account id | 888_binance_1 | |
| account_type | string | N | Account Type [Enum:matrix.user.bal,exchange.sub] | exchange.sub | |
| custody_id | string | N | exchange custody id | 7053683719172829184 | |
| exchange | string | N | huobi,binance,okex... | binance | |
| exchange_type | integer | N | Exchange Type Enum[1.CEX 2.DEFI] | binance | |
| rcu_id | integer | N | rcu id | 20 | |
| status | integer | N | Account Status Enum | 2 |
curl "https://mapi.matrixport.com/credit/agency/v1/accounts?limit=10&exchange=binance"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 7,
"items": [
{
"account_id": "606113_binance_582144",
"user_id": "606113",
"type": "exchange.sub",
"exchange": "Binance",
"ex_account_id": "",
"name": "",
"status": 1,
"ex_value": "binance",
"custody_id": "",
"custody_key": "",
"rcu_id": 0
},
{
"account_id": "606113_binance_7066697928613625856",
"user_id": "606113",
"type": "exchange.sub",
"exchange": "Binance",
"ex_account_id": "lgz_binance_ceffu_1",
"name": "lgz_binance_ceffu_1",
"status": 2,
"ex_value": "binance",
"custody_id": "7064499428551372800",
"custody_key": "lgz_binance_ceffu_1_custody",
"rcu_id": 0
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| user_id | string | User ID |
| account_id | string | account id |
| type | string | Account Type [Enum:matrix.user.bal,exchange.sub] |
| exchange | string | huobi,binance,okex... |
| ex_account_id | string | exchange sub account primary key |
| name | string | account name |
| status | string | Account Status Enum |
| ex_value | string | huobi,binance,okex... |
| custody_id | string | exchange custody id |
| custody_key | string | exchange custody sub account primary key |
| rcu_id | integer | RCU ID Associated with the Account,0 Indicates Unassociated |
DMA Bills
Interface Description
- Direct Market Access Bills
GET
/credit/agency/v1/dma/billsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| bill_start_time_start | integer | N | filter by billing start time,start | 1693497600000 | |
| bill_start_time_end | integer | N | filter by billing start time,end | 1694188800000 | |
| currency | string | N | currency | BTC | |
| serial_no | string | N | serial no | 1694188800000 | |
| status | integer | N | DMA Bill Status Enum | 1 |
curl "https://mapi.matrixport.com/credit/agency/v1/dma/bills?limit=10¤cy=BTC"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 2,
"items": [
{
"user_id": "606113",
"amount": "1",
"reduction_amount": "0",
"currency": "BTC",
"serial_no": "7104432572440215554DMA",
"status": 1,
"start_time": 1693526400000,
"end_time": 1696118400000,
"spot_trading_volume_maker": "0",
"spot_trading_volume_taker": "0",
"derivatives_trading_volume_maker": "0",
"derivatives_trading_volume_taker": "0",
"option_trading_volume_maker": "0",
"option_trading_volume_taker": "0",
"fee_rate": "0"
},
{
"user_id": "606113",
"amount": "20",
"reduction_amount": "0",
"currency": "ETH",
"serial_no": "7100678207011196928DMA",
"status": 1,
"start_time": 1690848000000,
"end_time": 1693526400000,
"spot_trading_volume_maker": "0",
"spot_trading_volume_taker": "0",
"derivatives_trading_volume_maker": "0",
"derivatives_trading_volume_taker": "0",
"option_trading_volume_maker": "0",
"option_trading_volume_taker": "0",
"fee_rate": "0"
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| user_id | string | User ID |
| amount | string | amount |
| reduction_amount | string | reduction amount |
| currency | string | currency |
| status | integer | DMA Bill Status Enum |
| start_time | integer | bill start time |
| end_time | integer | bill end time |
| spot_trading_volume_maker | string | volume |
| spot_trading_volume_taker | string | volume |
| derivatives_trading_volume_maker | string | volume |
| derivatives_trading_volume_taker | string | volume |
| option_trading_volume_maker | string | volume |
| option_trading_volume_taker | string | volume |
| fee_rate | string | fee rate |
DMA Bill Repay
Interface Description
- Direct Market Access Bill Repay
POST
/credit/agency/v1/dma/bill/repayRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| request_id | string | Y | 8 to 32 character string | example: timestamp | "1695634589886" |
| account_id | string | Y | account id, for repay | "888.bal" | |
| serial_no | string | Y | dma bill serial no | "7053683719172829184 |
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": null,
"message": "string"
}
Exchange Custody
Interface Description
- Exchange Custody
GET
/credit/agency/v1/exchange/custodyRequest Parameters
- Request Parameter Location: query
curl "https://mapi.matrixport.com/credit/agency/v1/exchange/custody"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": [
{
"ex_name": "Huobi",
"ex_value": "huobi",
"custody": null
},
{
"ex_name": "Binance",
"ex_value": "binance",
"custody": [
{
"custody_id": "7053668623214227456",
"name": "Copper"
},
{
"custody_id": "7053683719172829184",
"name": "FTX Custody"
},
{
"custody_id": "7064499428551372800",
"name": "BinanceCeffu"
}
]
},
{
"ex_name": "OKX",
"ex_value": "okex",
"custody": [
{
"custody_id": "7053668623214227456",
"name": "Copper"
}
]
},
{
"ex_name": "Coinbase",
"ex_value": "coinbase",
"custody": [
{
"custody_id": "7053668623214227456",
"name": "Copper"
}
]
}
],
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| ex_name | string | exchange name,for show,mutable |
| ex_value | string | exchange primary key,for param,immutable |
| custody | string | obj |
| custody_id | string | custody primary key |
| name | integer | custody name |
Exchange Trading Fee Rate
Interface Description
- Exchange Trading Fees
GET
/credit/agency/v1/exchange/trading_fee/rateRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| exchange | string | N | huobi,binance,okex... | binance |
curl "https://mapi.matrixport.com/credit/agency/v1/exchange/trading_fees?limit=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 1,
"items": [
{
"ex_name": "Binance",
"ex_value": "binance",
"trading_fees": [
{
"vip": "VIP5",
"base_coin": "USDT",
"updated_time": 0,
"spot_maker": "0",
"spot_taker": "0.00048",
"prep_maker": "-0.00001",
"prep_taker": "0.00027",
"futures_maker": "-0.00001",
"futures_taker": "0.00027",
"option_maker": "0.00004",
"option_taker": "0.00018"
},
{
"vip": "VIP5",
"base_coin": "USDC",
"updated_time": 0,
"spot_maker": "0",
"spot_taker": "0.00048",
"prep_maker": "-0.00001",
"prep_taker": "0.00027",
"futures_maker": "-0.00001",
"futures_taker": "0.00027",
"option_maker": "",
"option_taker": ""
},
{
"vip": "VIP5",
"base_coin": "BUSD",
"updated_time": 0,
"spot_maker": "0",
"spot_taker": "0.00048",
"prep_maker": "-0.00014",
"prep_taker": "0.00023",
"futures_maker": "-0.00014",
"futures_taker": "0.00023",
"option_maker": "",
"option_taker": ""
},
{
"vip": "VIP5",
"base_coin": "COIN",
"updated_time": 0,
"spot_maker": "0",
"spot_taker": "0.00048",
"prep_maker": "-0.00005",
"prep_taker": "0.00024",
"futures_maker": "-0.00005",
"futures_taker": "0.00024",
"option_maker": "",
"option_taker": ""
}
]
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| vip | string | VIP Name,Differs for Each Exchange |
| base_coin | string | Base Coin |
| updated_time | integer | Data Latest Update Time /ms |
| spot_maker | string | trade fee rate |
| spot_taker | string | trade fee rate |
| prep_maker | string | trade fee rate |
| prep_taker | string | trade fee rate |
| futures_maker | string | trade fee rate |
| futures_taker | string | trade fee rate |
| option_maker | string | trade fee rate |
| option_taker | string | trade fee rate |
Rcu Accounts
Interface Description
- Get the list of RCU associated sub-accounts
GET
/credit/agency/v1/rcu/accountsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| rcu_id | integer | Y | rcu id | 10 |
curl "https://mapi.matrixport.com/credit/agency/v1/rcu/accounts?rcu_id=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": [
{
"account_id": "644052_binance_10",
"user_id": "644052",
"type": "exchange.sub",
"exchange": "binance",
"ex_account_id": "zzl-007",
"name": "zzl-007",
"ex_value": "binance",
"custody_id": "",
"custody_key": "",
"rcu_id": 0
}
],
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| account_id | string | account id |
| user_id | string | user id |
| type | integer | Account Type [Enum:matrix.user.bal,exchange.sub] |
| exchange | string | Parent Exchange of the Sub-Account |
| ex_account_id | string | exchange sub account primary key |
| name | string | account name |
| ex_value | string | Exchange Where the Sub-Account Resides |
| custody_id | string | exchange custody id |
| custody_key | string | exchange custody sub account primary key |
| rcu_id | integer | RCU ID Associated with the Account,0 Indicates Unassociated |
Margin Loan API
Loan Bills
Interface Description
- Loan Bills
GET
/credit/agency/v1/billsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| bill_id | string | N | bill id | 0 | |
| bill_time_start | integer | N | filter by billing start time,start | 0 | |
| bill_time_end | integer | N | filter by billing start time,end | 0 | |
| order_biz_type | integer | N | Order Biz Type Enum | 1 | |
| order_id | string | N | order id | ||
| status | integer | N | Bill Status Enum | 1 | |
| type | integer | N | Bill Type Enum | 1 |
curl "https://mapi.matrixport.com/credit/agency/v1/bills?limit=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 185,
"items": [
{
"bill_time_mill": 1693958400000,
"allocate_amount": "1234",
"need_pay_allocate_amount": "0",
"close_day": 30,
"interest_rate": "0.35",
"interest": "0",
"penalty": "0",
"reduction_amount": "0",
"repaid_amount": "100",
"need_pay_amount": "0",
"currency": "USDT",
"payment_status": 1,
"order_id": "7086513693608996864",
"bill_id": "7105127171873775616",
"type": 4,
"name": [
{
"language": "zh-CN",
"text": "to cell"
},
{
"language": "zh-TW",
"text": "to cell"
},
{
"language": "en",
"text": "to cell"
}
],
"repaying": "0",
"distribution_of_performance_fee": "0",
"distribution_fee": "0"
},
{
"bill_time_mill": 1693958400000,
"allocate_amount": "1234",
"need_pay_allocate_amount": "0",
"close_day": 30,
"interest_rate": "0.35",
"interest": "0",
"penalty": "0",
"reduction_amount": "0",
"repaid_amount": "500",
"need_pay_amount": "0",
"currency": "USDT",
"payment_status": 1,
"order_id": "7086513693608996864",
"bill_id": "7105127937665605632",
"type": 4,
"name": [
{
"language": "zh-CN",
"text": "22"
},
{
"language": "zh-TW",
"text": "22"
},
{
"language": "en",
"text": "22"
}
],
"repaying": "0",
"distribution_of_performance_fee": "0",
"distribution_fee": "0"
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| bill_time_mill | string | bill time /ms |
| allocate_amount | string | order allocate amount |
| need_pay_allocate_amount | string | unpaid principal of the order |
| interest_rate | string | interest rate |
| interest | string | interest amount |
| penalty | string | penalty amount |
| reduction_amount | string | reduction amount |
| repaid_amount | string | bill repaid amount |
| need_pay_amount | string | remaining outstanding balance on the bill |
| currency | string | |
| payment_status | integer | Payment Status [Enum 0.Pending Payment 1.Paid 2.Payment in Progress] |
| order_id | string | order id |
| bill_id | string | bill id |
| type | integer | Bill Type [Enum 1.Interest Bill 2.Penalty Interest Bill 3.Pre Repay Penalty Interest 4.Order Fee Bill] |
| repaying | string | amount in repayment |
| distribution_of_performance_fee | string | order distribution of performance fee rate |
| distribution_fee | string | distribution fee |
Bill Repay
Interface Description
- Only the trading account with the RCU bound to the loan order can be selected for payment
POST
/credit/agency/v1/bill/repayRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| bill_id | string | Y | bill id | 6916386190560079872S202204 | |
| account_id | string | Y | account id, for repay | 888_binance_1 | |
| request_id | string | Y | 8 to 32 character string | example: timestamp | "1695634589886" |
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": null,
"message": "string"
}
Order Detail
Interface Description
- Order Detail
GET
/credit/agency/v1/orderRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| order_id | string | Y | order id |
curl "https://mapi.matrixport.com/credit/agency/v1/order?order_id=6917353775912984576"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"created_at": 1693389856901,
"user_id": "606113",
"order_id": "7102591850338496512",
"allocation_currency": "USDT",
"allocation_amount": "212",
"allocated_amount": "0",
"allocating_amount": "0",
"equity_currency": "USDT",
"equity_amount": "42.4",
"margin_currency": "USDT",
"margin_amount": "42.4",
"interest_rate": "0.032",
"close_day": 30,
"value_time": 1693353600000,
"due_time": 1695945600000,
"allocation_ratio": "5",
"status": -1,
"order_biz_type": 2,
"amount_repaid": "0",
"repaying": "0",
"overdue_rate": "0",
"pre_repay_penalty_ratio": "0",
"pre_order_id": "",
"distribution_of_performance_fee": "0.043",
"guaranteed_hurdle_rate_of_return": 1,
"binance_managed_sub_account": 1,
"frequency_of_performance_fee_payment": 1,
"interest": "0",
"penalty": "0",
"penalty_days": 0,
"pre_repay_penalty": "0"
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| created_at | integer | created time /ms |
| user_id | string | user id |
| order_id | string | order id |
| allocation_currency | string | loan currency |
| allocation_amount | string | approved loan amount for the order |
| allocated_amount | string | disbursed Amount |
| allocating_amount | string | disbursing Amount |
| equity_currency | string | designated pledged currency |
| equity_amount | string | designated pledged amount |
| margin_currency | string | Actual Collateral Currency |
| margin_amount | string | Actual Collateral Amount |
| interest_rate | string | interest rate |
| close_day | integer | order days |
| value_time | integer | interest start date |
| due_time | integer | interest accrual end date |
| allocation_ratio | string | leverage ratio |
| status | integer | Order Status Enum |
| order_biz_type | integer | Order Biz Type Enum |
| amount_repaid | string | amount repaid as principal |
| repaying | string | amount repaying as principal |
| overdue_rate | string | principal penalty interest rate |
| pre_repay_penalty_ratio | string | prepayment penalty interest rate |
| pre_order_id | string | previous renewal order id |
| distribution_of_performance_fee | string | distribution of performance_fee |
| guaranteed_hurdle_rate_of_return | integer | guaranteed hurdle rate of return |
| binance_managed_sub_account | integer | binance managed sub account |
| frequency_of_performance_fee_payment | integer | frequency of performance fee_payment |
| interest | string | interest |
| penalty | string | penalty |
| penalty_days | integer | penalty days |
| pre_repay_penalty | string | prepayment penalty amount |
Set Lending Account
Interface Description
- Set Lending Account
POST
/credit/agency/v1/order/leading_accountRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| order_id | string | Y | order id | 7094504820274515968 | |
| lending_accounts | list | Y | order disbursement account configuration | ||
| lending_accounts.account_id | object | Y | account id,only supporting exchange sub-accounts | 888_binance_1 | |
| lending_accounts.amount | object | Y | amount | "100.1" |
- Request Body
{
"lending_accounts": [
{
"account_id": "string",
"amount": 0
}
],
"order_id": "string"
}
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": null,
"message": "string"
}
Add Order Margin
Interface Description
- Add Order Margin
POST
/credit/agency/v1/order/marginRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| account_id | string | Y | account id | 888_binance_1 | |
| amount | string | Y | amount | "10" | |
| order_id | string | Y | order id | "7053683719172829184" | |
| request_id | string | Y | 8 to 32 character string | example: timestamp | "1695634589886" |
- Request Body
{
"account_id": "string",
"amount": 0,
"order_id": "string",
"request_id": "string"
}
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": null,
"message": "string"
}
Margin Records
Interface Description
- Margin Records
GET
/credit/agency/v1/order/margin/recordsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| order_id | string | N | order id | "7094504820274515968" | |
| currency | string | N | currency | BTC |
curl "https://mapi.matrixport.com/credit/agency/v1/order/margin/records?limit=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 121,
"items": [
{
"serial_no": "7102592020061007872",
"user_id": "606113",
"order_id": "7102591850338496512",
"currency": "USDT",
"amount": "42.4",
"status": 5
},
{
"serial_no": "7102591363878924289",
"user_id": "606113",
"order_id": "7102591293565612032",
"currency": "USDT",
"amount": "24.4",
"status": 4
},
{
"serial_no": "7086649416970530816",
"user_id": "606113",
"order_id": "7086513693608996864",
"currency": "USDC",
"amount": "411.3",
"status": 5
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| serial_no | string | Serial NO |
| user_id | string | User ID |
| order_id | string | order id |
| currency | string | currency |
| amount | string | amount |
| status | Op Status [Enum 1.WaitApprove 2.Approved 3.Rejected 4.Processing 5.Processed 6.Failed] | status |
Order Operation Records
Interface Description
- Order Operation Records
GET
/credit/agency/v1/order/operationsRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| order_id | string | N | order id | "7094504820274515968" | |
| currency | string | N | currency | BTC |
curl "https://mapi.matrixport.com/credit/agency/v1/order/operations?limit=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 890,
"items": [
{
"created_at": 1695713274324,
"serial_no": "7112336969107267584",
"user_id": "606113",
"request_id": "7112336969086296064",
"order_id": "7081471674939437056S202308",
"op_type": 8,
"currency": "USDT",
"amount": "1.9337672209670088",
"status": 5
},
{
"created_at": 1695713250731,
"serial_no": "7112336870213967872",
"user_id": "606113",
"request_id": "7112336870213967872",
"order_id": "7104400032983646208",
"op_type": 24,
"currency": "USDT",
"amount": "22",
"status": 5
},
{
"created_at": 1695353634384,
"serial_no": "7110828530019303424",
"user_id": "606113",
"request_id": "7110828530015109120",
"order_id": "606113_binance_865408",
"op_type": 22,
"currency": "",
"amount": "0",
"status": 5
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| created_at | integer | created time /ms |
| serial_no | string | Serial NO |
| user_id | string | User ID |
| request_id | string | User ID |
| order_id | string | order id |
| currency | string | currency |
| op_type | integer | Op Type Enum |
| amount | string | amount |
| status | integer | Op Status [Enum 1.WaitApprove 2.Approved 3.Rejected 4.Processing 5.Processed 6.Failed] |
Order List
Interface Description
- Order List
GET
/credit/agency/v1/ordersRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| order_biz_type | integer | N | Order Biz Type Enum | 1 | |
| order_id | string | N | order id | "7094504820274515968" | |
| rcu_id | integer | N | rcu id | 1 | |
| status | integer | N | Order Status Enum | 1 |
curl "https://mapi.matrixport.com/credit/agency/v1/orders?limit=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 253,
"items": [
{
"user_id": "606113",
"order_id": "7102593191773384704",
"allocation_currency": "USDT",
"allocation_amount": "1122",
"allocated_amount": "0",
"margin_currency": "USDT",
"margin_amount": "0",
"interest_rate": "0.032",
"value_time": 1693353600000,
"due_time": 1695945600000,
"allocation_ratio": "5",
"status": -1,
"amount_repaid": "0",
"repaying": "0",
"overdue_rate": "0",
"pre_repay_penalty_ratio": "0",
"pre_order_id": "",
"distribution_of_performance_fee": "0.043",
"guaranteed_hurdle_rate_of_return": 1,
"binance_managed_sub_account": 1,
"frequency_of_performance_fee_payment": 1,
"interest": "0",
"penalty": "0",
"penalty_days": 0,
"pre_repay_penalty": "0"
},
{
"user_id": "606113",
"order_id": "7102591850338496512",
"allocation_currency": "USDT",
"allocation_amount": "212",
"allocated_amount": "0",
"margin_currency": "USDT",
"margin_amount": "42.4",
"interest_rate": "0.032",
"value_time": 1693353600000,
"due_time": 1695945600000,
"allocation_ratio": "5",
"status": -1,
"amount_repaid": "0",
"repaying": "0",
"overdue_rate": "0",
"pre_repay_penalty_ratio": "0",
"pre_order_id": "",
"distribution_of_performance_fee": "0.043",
"guaranteed_hurdle_rate_of_return": 1,
"binance_managed_sub_account": 1,
"frequency_of_performance_fee_payment": 1,
"interest": "0",
"penalty": "0",
"penalty_days": 0,
"pre_repay_penalty": "0"
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| user_id | string | user id |
| order_id | string | order id |
| allocation_currency | string | loan currency |
| allocation_amount | string | approved loan amount for the order |
| allocated_amount | string | disbursed Amount |
| allocating_amount | string | disbursing Amount |
| margin_currency | string | Actual Collateral Currency |
| margin_amount | string | Actual Collateral Amount |
| interest_rate | string | interest rate |
| close_day | integer | order days |
| value_time | integer | interest start date |
| due_time | integer | interest accrual end date |
| allocation_ratio | string | leverage ratio |
| status | integer | Order Status Enum |
| order_biz_type | integer | Order Biz Type Enum |
| amount_repaid | string | amount repaid as principal |
| repaying | string | amount repaying as principal |
| overdue_rate | string | principal penalty interest rate |
| pre_repay_penalty_ratio | string | prepayment penalty interest rate |
| pre_order_id | string | previous renewal order id |
| distribution_of_performance_fee | string | distribution of performance_fee |
| guaranteed_hurdle_rate_of_return | integer | guaranteed hurdle rate of return |
| binance_managed_sub_account | integer | binance managed sub account |
| frequency_of_performance_fee_payment | integer | frequency of performance fee_payment |
| interest | string | interest |
| penalty | string | penalty |
| penalty_days | integer | penalty days |
| pre_repay_penalty | string | prepayment penalty amount |
Order Renew
Interface Description
- Add Order Margin
POST
/credit/agency/v1/order/renewRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| allocation_amount | string | Y | renewal leverage amount | "1000" | |
| order_id | string | Y | order_id | "7053683719172829184" | |
| time_milli | int64 | Y | renewal until date, 12:00 AM (Midnight) UTC | 1696118400000 | |
| request_id | string | Y | 8 to 32 character string | example: timestamp | "1695634589886" |
- Request Body
{
"allocation_amount": 0,
"order_id": "string",
"request_id": "string",
"time_milli": 0
}
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": null,
"message": "string"
}
Order Repay
Interface Description
- Add Order Margin
POST
/credit/agency/v1/order/repayRequest Parameters
- Request Parameter Location: body
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| amount | string | Y | repay amount | "1000" | |
| order_id | string | Y | order_id | "7053683719172829184" | |
| account_id | string | Y | repay account id,only support exchange sub account | "888_binance_1" | |
| request_id | string | Y | 8 to 32 character string | example: timestamp | "1695634589886" |
- Request Body
{
"account_id": "string",
"amount": 0,
"order_id": "string",
"request_id": "string"
}
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": null,
"message": "string"
}
Risk Control API
Rcu List
Interface Description
- Rcu List
GET
/credit/agency/v1/rcusRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| limit | integer | Y | limit | 10 | |
| offset | integer | N | offset | 0 | |
| order_biz_type | integer | N | Order Biz Type Enum | 1 |
curl "https://mapi.matrixport.com/credit/agency/v1/rcus?limit=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"count": 8,
"items": [
{
"rcu_id": 749,
"rcu_name": "FA-USDT-38496512",
"total_value": "0",
"loan_size": "0",
"skitg": "0",
"initial_margin_ratio": "0.2",
"order_id": "7102591850338496512",
"is_enable": false
},
{
"rcu_id": 820,
"rcu_name": "ML-USDT-62044672",
"total_value": "3041618.3137269737",
"loan_size": "3025726",
"skitg": "1000240",
"initial_margin_ratio": "0.3333",
"order_id": "7109485224484110336",
"is_enable": true
}
]
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| rcu_id | integer | rcu id |
| rcu_name | string | rcu name |
| total_value | string | total value USD |
| loan_size | string | loan size USD |
| skitg | string | skitg USD |
| initial_margin_ratio | string | integer |
| order_id | string | order id |
| is_enable | boolean | is enable true/false |
Rcu Detail
Interface Description
- Rcu Detail
GET
/credit/agency/v1/rcuRequest Parameters
- Request Parameter Location: query
| Parameter Name | Type | Mandatory | Limit | Description | example |
|---|---|---|---|---|---|
| rcu_id | integer | Y | rcu id | 10 |
curl "https://mapi.matrixport.com/credit/agency/v1/rcu?rcu_id=10"
- Response Results
- Response string is as follows. General string text has been omitted. See Response Format Strings for more details:
- Data Structure & Description:
{
"code": 0,
"data": {
"rcu_id": 346,
"timestamp_in_us": 1695784202046241,
"rcu_name": "tiger 0411",
"total_asset": "3041618.3137269737",
"total_skitg": "1000240",
"total_loan": "3025726",
"total_fund": "3268784.32",
"glr": "0",
"nlr": "0",
"nav": "0.3954016829101757",
"risk_ratio": "1.0052523968551592",
"user_id": "tiger 0411"
},
"message": ""
}
| Parameter Name | Type | Description |
|---|---|---|
| rcu_id | integer | rcu id |
| rcu_name | string | rcu name |
| timestamp_in_us | integer | data updated time /us |
| total_asset | string | total value USD |
| total_loan | string | loan size USD |
| total_skitg | string | skitg |
| total_fund | string | fund |
| glr | string | glr |
| nlr | string | nlr |
| nav | string | nav |
| risk_ratio | string | risk ratio |