Portal Operations
Description
This endpoint returns a list of Portal operations associated with a wallet. These operations include leveraged trading actions such as opening positions, borrowing, repaying, and liquidation events.
Each entry includes token movement details, collateral and debt status, and execution history.
Endpoint
Request
address
string
(Optional) The wallet's public address. address
or accountId
is required.
0xbefa...b491
accountId
string
(Optional) The unique ID of the user's Loopring DeFi account. accountId
or address
is required.
10501
operateTypes
string
(Optional) Comma-separated list of operation types to include (e.g., 1
, 2
)
1,2
limit
number
(Optional) Maximum number of results to return.
6
offset
number
(Optional) Number of records to skip (used for pagination).
0
⚠️ Either address
or accountId
must be provided — at least one is required to query portal operations.
Response
total
number
Total number of Portal operations matching the request.
927
data
array
List of Portal operation records.
[ ... ]
data[].operation.hash
string
Unique hash identifying the operation.
"0x0651...d72c"
data[].operation.operateType
string
Type of leveraged operation (e.g., VAULT_TRADE
, VAULT_OPEN_POSITION
).
"VAULT_CLOSE_OUT"
data[].operation.operateSubType
string
Subcategory of the operation, providing more context.
"VAULT_MANUAL"
data[].operation.status
string
Status of the operation (e.g., VAULT_STATUS_SUCCEED
).
"VAULT_STATUS_SUCCEED"
data[].operation.tokenIn
number
Token ID used as input for the operation.
0
data[].operation.amountIn
string
Amount of the input token (in base units). May be empty.
"7995700000000000000"
data[].operation.tokenOut
number
Token ID received/output in the operation.
8
data[].operation.amountOut
string
Amount of the output token (in base units).
"26861000000000000000000"
data[].operation.totalBalance
string
User's total asset balance at the time of operation.
"69734.97"
data[].operation.Collateral
string
Total collateral posted in the leveraged position.
"14358.44"
data[].operation.totalDebt
string
Total borrowed amount for the position.
"59089.53"
data[].operation.totalEquity
string
Total equity after liabilities.
"10645.44"
data[].operation.executionHistory
array
Step-by-step history of the operation (plain text or JSON strings).
["Repay 59065 USDT", ...]
data[].operation.accountType
number
Indicates the account type (e.g., 0
for standard).
0
data[].operation.profit
string
Profit/loss from the operation. Empty if not applicable.
"0.00"
data[].operation.exitFee
string
Fee charged when closing a position.
"0"
data[].operation.createdAt
number
Timestamp of when the operation started (in milliseconds).
1743325159943
data[].operation.updatedAt
number
Timestamp of the most recent update to the operation.
1743406029889
data[].order.hash
string
Unique hash identifying the order (if applicable).
"0x1b01...4d8d"
data[].order.clientOrderId
string
Client order ID, typically set by the app.
"iOS_Hebao_1743325159359"
data[].order.status
string
Status of the associated order.
"processed"
data[].order.tokenS
number
Token ID being sold (S stands for "sell").
0
data[].order.amountS
string
Total amount to sell (in base units).
"7995700000000000000"
data[].order.fillAmountS
string
Amount actually sold.
"2096230000000000000"
data[].order.tokenB
number
Token ID being bought.
32792
data[].order.amountB
string
Expected amount to buy.
"1"
data[].order.fillAmountB
string
Actual amount bought.
"1"
data[].order.price
string
Execution price for the trade.
"7.995700"
data[].order.fee
string
Fee paid in base units.
"0"
data[].order.createdAt
number
Timestamp of when the order was placed.
1743325159977
data[].order.updatedAt
number
Timestamp of the last update to the order.
1743405995567
Additional Information
The operateTypes
query parameter filters activity by their action type. Below is a list of supported values, along with a short description for each:
0
VAULT_OPEN_POSITION
Opens a new leveraged position by supplying collateral.
1
VAULT_MARGIN_CALL
Indicates a margin call event when the collateral ratio falls below required thresholds.
2
VAULT_BORROW
Borrows assets against the user's posted collateral.
3
VAULT_REPAY
Repays borrowed assets to reduce or close debt.
4
VAULT_TRADE
Executes a leveraged trade using borrowed funds.
5
VAULT_CLOSE_OUT
Closes the leveraged position, settling debt and returning remaining collateral.
6
VAULT_CONVERT
Converts dust assets (small token balances below 10u) into USDT for consolidation.
7
VAULT_JOIN_REDEEM
Redeems supplied collateral, exiting the vault position without active debt.
8
VAULT_CLOSE_SHORT
Settles an open short position, repurchasing and returning borrowed assets.
Last updated