Trading

MatchingEngine contract manages API for trading on orderbook exchange. To trade on Standard, Solidity developers use IMatchingEngine interface to call its functions.

pragma solidity ^0.8.24;
import {IMatchingEngine} from "standard3.0-contracts/src/exchange/interfaces/IMatchingEngine.sol";

contract CLOB {
    IMatchingEngine public matchingEngine;
 
    constructor(address _engine) {
        matchingEngine = IMatchingEngine(_engine);
    }

    function limitBuy(address base, address quote, uint256 price, uint256 quoteAmount, bool isMaker, uint32 matchingN, address recipient) public {
        matchingEngine.limitBuy(
            base,
            quote,
            price,
            quoteAmount,
            isMaker,
            matchingN,
            recipient
        );
    }
}

Limit Orders

Market Orders

Order Cancellation

Last updated