Customer Trading
Customer Trading
A User can trade crypto assets for customers. Therefore, the user creates an execution
in Trever. An execution
contains all the information a trading venue needs to place an order
plus the information Trever needs to do its internal bookings
for the customer accounts. With the information of an execution, Trever can place an order
on a trading venue and fills
are returned.
A user can initiate an execution in the Trever front-end, on the Trading screen, or via API. Prices are streamed from the integrated venue by the Trever Pricestream Integration Service, which also is accessible via the API. To get the exact price for a particular quantity the user can check the provided order book or create a RFQ (Request for Quote) for an exact quantity.
If the user decides to place an order, the Trever Trading Integration Service creates an execution and locks the required assets on the customer’s account. On a BUY
execution, the locked quantity is a predicted volume of the quote asset that is necessary to purchase the desired quantity of the base asset. On a SELL
execution, it is the exact quantity of the asset the customer wants to sell. By locking the required assets, Trever ensures that they are not used elsewhere while the execution is pending. Therefore, the assets are booked from the customer’s HEAD
account to a LOCK
account.
After the assets for the execution are locked, the resulting order is placed on the trading venue. If the trading venue was able to place the order, the user is now able to see the pending execution on the trading screen or retrieve it via API. The Trever Trading Integration Service now monitors the state of the execution via API polling or a web socket on the trading venue. The information about when and how an order has been filled reaches Trever asynchronously.
Once an execution is successful, the required assets are booked from the LOCK
account to an OUTGOING
or EXECUTION
account while the base asset is booked to an INCOMING
account. On a SELL execution, it is the other way around.
The difference between the price paid by the customer for the trade and the price actually paid or achieved on the exchange is the margin
. The margin is booked to the revenue account.