API does not call `MangroveOrder` in a coherent manner
jkrivine opened this issue · 2 comments
jkrivine commented
Expected behavior should be:
- 1 for IOC with partialfill allowed use direct calls to
marketOrder
- 2 for IOC with no partialfill (aka Fill or Kill) call
MangroveOrder.take
with no provision andpartialFillNotAllowed:true
,restingOrder:false
- 3 for GTC call
MangroveOrder.take
with some provisions andpartialFillNotAllowed:false
andrestingOrder:true
Currently it is not possible to use the API for point 2
jkrivine commented
I suggest changing TradeParams
to something like:
export type TradeParams = {
slippage?: number;
} & ({ advanced?: AdvancedOrderParams } | { offerId?: number }) &
(
| { volume: Bigish; price: Bigish | null }
| { total: Bigish; price: Bigish | null }
| { wants: Bigish; gives: Bigish; fillWants?: boolean }
);
export type AdvancedOrderParams = {
partialFillNotAllowed?: boolean;
restingOrder?: restingOrderParams
};
export type RestingOrderParams = {
timeToLive?: number;
provision: Bigish;
}
peterMangrove commented
This has been solved. It is now possible to create an FoK order