Skip to main content

Operator

What is the Operator

The operator is the client's agent and can sign an order on your behalf. Users can set the account operator by calling IDealer#setOperator.

Operator Uses Case

Users can authorize a professional trading team to operate their accounts, helping them achieve higher returns through the team's experience.

JOJO Operator

The JOJO team has an official operator that users can authorize in the personal center. After authorization, the limit, market, and TPSL orders no longer need to be signed in the wallet, significantly improving user experience.

Smart Contract Account Trading Guide

In the JOJO system, smart contract accounts can also initiate positions, breaking the limitation of only using externally owned accounts (EOAs). This enhancement provides users with more flexibility and convenience when trading on JOJO.

Enable deposit and withdraw operations in the smart contract account.

Before trading using smart contracts, ensuring that the smart contract supports deposit and withdrawal operations on JOJO is essential. This enables assets such as USDC or JUSD to be deposited or withdrawn from the JOJO system through calls to the relevant functions in the smart contract.

Set a trusted EOA account as an operator.

To allow smart contracts to execute trades, we need to set a trusted External Owned Account (EOA) as an operator for the smart contract. By performing a setOperator operation, we can specify which EOA account has the authority to sign transactions on behalf of the smart contract account.

Call the trading API to place orders

Once the smart contract account operator has been set, users can initiate trades on JOJO through the smart contract. Below are the specific steps to follow:

  1. Construct the trade information: Refer to JOJO's API documentation to find the relevant API endpoint. When constructing a trade, provide essential trade information, such as the trading pair, trade type, and quantity.
  2. Use the operator to sign the transaction: When constructing the trade, use the smart contract account as the account and the previously set trusted operator account to sign the transaction. This step ensures the legitimacy of the trade request; only a valid operator can sign off the transaction, which is then sent to the JOJO exchange for processing.

Following these steps, users can conduct trades on JOJO using smart contract accounts. Smart contract accounts can automatically execute trade strategies based on predefined rules, providing users with an optimized trading experience.