Get Long Term Order Details

How to get details of placed Long Term Order?

There is an external function available in the pool contract, that returns the details of the order placed. You need to have the orderId of the order you want to fetch.

This is how the function prototype looks like:

function getLongTermOrder(uint256 orderId)
        external
        view
        returns (
            uint256 orderId,
            uint256 expirationBlock,
            uint256 salesRate,
            address owner,
            uint256 sellTokenIndex,
            uint256 buyTokenIndex,
            uint256 boughtAmount
        )

Details of the response parameters:

  1. orderId - The order of the ID

  2. expirationBlock - The block at which the order will complete

  3. salesRate - Per block sales rate of the order

  4. sellTokenIndex - The index of the token being sold

  5. buyTokenIndex - The index of the token being bought

  6. boughtAmount - The actual token amount bought so far.

To get the estimated amount of the tokens if cancel/withdrawn been called right now, you can call Cancel Long Term Order or Withdraw Long Term Order respectively in callStatic way.

Last updated