import * as Knex from "knex"; import { Address } from "../types"; import { Percent, Shares, Tokens } from "./dimension-quantity"; import { DisplayRange, MarketCreatorFeeRate, MarketMaxPrice, MarketMinPrice, ReporterFeeRate, TotalFeeRate, TradePrice } from "./financial-math"; export interface QuantityAtPrice extends TradePrice { quantity: Shares; } export interface BidsAndAsks { bidsSortedByPriceDescending: Array; asksSortedByPriceAscending: Array; } interface MarketOrderBooks extends MarketMinPrice, MarketMaxPrice, ReporterFeeRate, MarketCreatorFeeRate, TotalFeeRate, DisplayRange { numOutcomes: number; endDate: Date; orderBooks: Array<{ outcome: number; orderBook: OrderBook; }>; } export declare function getMarketOrderBooks(db: Knex, marketId: Address): Promise; interface OrderBookOptions { dryRun: boolean; } export interface OrderBook { getBidsAndAsks(): BidsAndAsks; closeLongFillOnly(quantityToSell: Shares, opts?: OrderBookOptions): Tokens; closeLongFillOnlyWithFeeAdjustment(quantityToSell: Shares, feeRate: Percent, opts?: OrderBookOptions): Tokens; closeShortFillOnly(quantityToSell: Shares, opts?: OrderBookOptions): Tokens; closeShortFillOnlyWithFeeAdjustment(quantityToSell: Shares, feeRate: Percent, opts?: OrderBookOptions): Tokens; } export {};