LogoLogo
  • Loopring DeFi
  • Getting Started
    • Overview
    • Connecting Your Wallet
    • Depositing Assets
  • Withdrawing Assets
  • Products
    • Dual Investment
      • Covered Gain
      • Auto Reinvest
      • Risks & Considerations
      • Dual Investment FAQ
    • Portal
      • Opening a Position
      • Managing Your Position
      • Collateral Management
      • Margin & Liquidation
      • Advanced Strategies
      • Risks & Considerations
      • Portal FAQ
  • Block Trade
    • How Block Trade Works
    • Trading Options
    • Supported Tokens & Pairs
    • Risks & Considerations
    • Block Trade FAQ
  • Resources
    • API Documentation
      • Base URLs
      • Account Owner Lookup
      • Wallet Type Lookup
      • Token Balances
      • Transaction History
      • Block Trade Orders
      • Portal Operations
      • Postman Collection
  • Change Logs
    • 2025
      • May 22
      • May 19
      • May 15
      • Apr 3
      • Apr 2
      • Mar 3
      • Feb 25
      • Jan 15
    • 2024
      • 25 Dec
Powered by GitBook
On this page
  • Description
  • Endpoint
  • Request
  • Response
  • Additional Information
Export as PDF
  1. Resources
  2. API Documentation

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

GET /api/v3/vault/getOperations

Request

Field
Type
Description
Example

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

Field
Type
Description
Example

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

💡 Values such as amountIn, amountOut, totalDebt, and totalEquity are returned in base units. Use the token's decimals to convert to human-readable values. The decimals value can be retrieved using GET /api/v3/exchange/tokens.


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:

operateTypes
Operation Type
Description

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.

PreviousBlock Trade OrdersNextPostman Collection

Last updated 1 month ago