class TradeServiceImpl implements TradeService {

    @Override
    public Trade addTrade(long assetId, AskOrder askOrder, BidOrder bidOrder) {
        final Block block = blockchain.getLastBlock();
        final DbKey dbKey = tradeTable.getDbKey(askOrder.getId(), bidOrder.getId());
        log.trace(">> addTrade() newDbKey={}, assetId={}, askOrder={}, bidOrder={}, height={}",
            dbKey, assetId, askOrder, bidOrder, block.getHeight());
        Trade trade = new Trade(
            assetId,
            askOrder,
            bidOrder,
            dbKey,
            block.getId(),
            block.getHeight(),
            block.getTimestamp()
        );
        tradeTable.insert(trade);
        log.trace("<< addTrade() assetId={}, askOrder={}, bidOrder={}, trade={}", assetId, askOrder, bidOrder, trade);
        return trade;
    }

    public  TradeServiceImpl(
        final DatabaseManager databaseManager,
        final Blockchain blockchain,
        final TradeTable tradeTable,
        final IteratorToStreamConverter<Trade> converter
    );
    @Inject public  TradeServiceImpl(
        final DatabaseManager databaseManager,
        final Blockchain blockchain,
        final TradeTable tradeTable
    );

}