AshSwap Docs
Search
K
Comment on page
📊

Trade

Trading Flow

Currently, AshPerp only supports those types of orders:
  • Market: To be used to opening a trade immediately. It will open at the market price (+ spread).
  • Limit: To be used when you want to go long at a lower price than present, or to go short if the price reaches a higher price than present. The execution price is the determined limit price + spread.
  • Stop: To be used when you want to go long if the price reaches a higher price than present, or to go short if the price reaches a lower price than present. You might want to use this to long a breakout, or short a breakdown. The execution price is the determined stop price + spread.

Open a market order

  • When a user creates a market order, our system generates a request price and stores it in the Pending Market Orders.
  • Contract waits for all 3 oracle nodes to fulfilled aggregate price and execute callback.

Open a limit / stop order

  • When a user creates a limit/stop order, it’s immediately shown in the Orders tab with the status “Pending”.
  • Your order is monitored by a group of Matching Bots. These bots subscribe to price fluctuations and regularly fetch all open orders from the smart contract. They assess these orders off-chain to determine if they can be executed. These bots evaluate specific conditions related to price changes, select suitable orders, and initiate a request to convert your limit or stop order into a market order.
  • Contract waits for all 3 oracle nodes to fulfilled aggregate price and execute callback.
  • A small fee will be charged for opening an order.

Close an order

  • When a user closes their order, the close order awaits fulfillment through the price feed system, after which the callback is triggered to officially close it.
  • A small fee will be charged for closing an order.

Update Take Profit / Stop Loss Price

  • User edits take profit / stop loss price of an order, and new parameters will be saved to the contract.

Take Profit / Close Stop Loss

  • Whenever an order meets the take profit or stop loss condition, Matching bots will trigger the order and send a request to our system to close the order.
  • The contract waits all 3 oracle nodes to fulfilled the aggregate price and execute the callback.
  • A small fee will be charged for closing an order.

Liquidations

  • Whenever an order meets the liquidated price, Matching bots will trigger the order and send a request to our system to liquidate the order.
    • Liquidation Price Distance = Open Price * (Collateral * 0.9 - Borrowing Fees) / Collateral / Leverage.
    • Liquidation price:
      • Long: Open Price - Liquidation Price Distance
      • Short: Open Price + Liquidation Price Distance.
  • The contract waits for all 3 Oracle nodes to fulfill the aggregate price and execute a callback. Please be aware that the bots will levy a fee for the liquidation process.

1-Click Trading

About 1CT, please read the article below:
1CT (1-Click Trading) Introduction AshPerp offers a simple onboarding experience for all of the above:
  • Create PIN
  • Sign message
  • Approve 1CT wallet
  • Fund 1CT wallet
  • Enable feature
You can use the same 1CT wallet across devices by using the same PIN and connected wallet when generating.
Last modified 16d ago