On-Chain Order API

This document describes how to place an order directly through the smart contract
The current Orderly architecture has an off-chain order book, and the orders are placed through an off-chain RESTful API.
Users might want to perform a swap without interacting with off-chain components. We have created on-chain order support, where orders can be placed directly through the smart contract rather than the RESTful API.
Please note, all quotes and trades are against USDC as the quote currency
Before placing an order, a user first has to announce Orderly Key, Trading Key, and deposit funds, more info here.
After the required steps are completed, the following smart contract function can be called to initiate an order in the following format:
Creates an order via a Smart Contract method
Each order requires a fee to be paid, the amount for which can be retrieved using the following method:
Retrieves the required fee required for an on-chain order.