Manually Trigger Trade Execution

The two-step trading procedure of the Deri Protocol relies on the platform's executor service to complete the latter phase of a trade. This reliance presents a challenge due to the centralized nature of the executor service: what happens if it malfunctions or becomes unavailable? Thankfully, the decentralized framework of Deri Protocol provides a solution. The second phase of a trade, specifically the execution step, can be initiated by anyone. Thus, while users can typically rely on the "official executor service" to handle the second step, they also have the autonomy to step in and complete the process themselves should the official service face interruptions.
In the event that the Deri platform's executor service becomes unavailable, users may need to manually trigger the executeTrade function to complete their trades.
Please note, if your transaction has been pending for more than 5 minutes, it will be cancelled when the executor processes it. Therefore, please resubmit the transaction and ensure the executor is triggered to execute within 5 minutes
Step-by-Step Instructions:
  1. 1.
    Identify Chain and Pool:
    • First, determine which chain and pool your trade market is located in. This is crucial because the Router contract address will differ based on the chain and pool.
  1. 2.
    Interact with the Router Contract:
  • Once you've identified the correct Router, navigate to the appropriate explorer, such as arbiscan or bscscan.
2.1. Switch to Read Mode:
  • Select "Contract" and then choose "Read as Proxy."
2.2. Retrieve the Current TradeIndex:
  • Get the current TradeIndex value, as you will need it later.
2.3. Switch to Write Mode:
  • Switch to "Write as Proxy" mode.
  • Connect to any wallet with some gas token.
2.4. Initiate executeTrade:
  • Choose the executeTrade function.
  • For the endIndex field, input the TradeIndex value you noted in step 2.2.
  • For the oracleSignature field, input the value indicated from frontend page.
2.5. Submit:
  • Click on "Write" to submit your request to the blockchain, completing the trade.
By following these steps, you can manually execute trades on Deri. Afterward, you can return to the website to check if your position has been executed as expected.