diff --git a/examples/marketOrderIOC.ts b/examples/marketOrderIOC.ts index 32c9f74..8ad9c05 100644 --- a/examples/marketOrderIOC.ts +++ b/examples/marketOrderIOC.ts @@ -21,62 +21,24 @@ async function main() { const NO_TOKEN = "1343197538147866997676250008839231694243646439454152539053893078719042421992" - await clobClient.postOrder(await clobClient.createLimitOrder({ - tokenID: NO_TOKEN, - price: 0.5, - side: Side.BUY, - size: 100, - })); - await clobClient.postOrder(await clobClient.createLimitOrder({ - tokenID: NO_TOKEN, - price: 0.5, - side: Side.BUY, - size: 100, - })); await clobClient.postOrder(await clobClient.createLimitOrder({ tokenID: NO_TOKEN, price: 0.4, side: Side.BUY, - size: 100, + size: 200, })); await clobClient.postOrder(await clobClient.createLimitOrder({ tokenID: NO_TOKEN, - price: 0.4, + price: 0.45, side: Side.BUY, - size: 100, + size: 250, })); - // FOK, error expected - const fok_order = await clobClient.createMarketOrder({ - tokenID: NO_TOKEN, - side: Side.SELL, - size: 500, - timeInForce: "FOK" - }) - console.log(`FOK market order: `); - console.log(fok_order); - - console.log(await clobClient.postOrder(fok_order)); - - // Create a IOC market sell that will fail because the slippage check - const ioc_slippage_check_order = await clobClient.createMarketOrder({ - tokenID: NO_TOKEN, - side: Side.SELL, - size: 500, - worstPrice: 0.5, - timeInForce: "IOC" - }); - console.log(`IOC market order: `); - console.log(ioc_slippage_check_order); - - console.log(await clobClient.postOrder(ioc_slippage_check_order)); - - // Create a IOC market sell that will match const ioc_order = await clobClient.createMarketOrder({ tokenID: NO_TOKEN, side: Side.SELL, - size: 250, + size: 500, worstPrice: 0.45, timeInForce: "IOC" });