Tutorial: JIT Maker Bot
JIT Maker Bots maintain a local copy of the decentralised orderbook (DLOB) (see: Keepers & Decentralised Orderbook) in order to see which orders are in the auction phase and can be bid on.
☠️ This bot requires collateral to run. This tutorial is a developer's guide and holds no responsibility over bot outcomes.
The reference implementation of the JIT Maker Bot is available here.
Follow the instructions at Keeper Bots to set the required environment variables, initialise theClearingHouseUser and deposit some collateral.
Start the JIT Maker Bot:
The Typescript SDK exposes an EventSubscriber object that you can use to receive market orders on-chain.
Technical details on the JIT Auction and its pricing can be found at Just-In-Time (JIT) Auctions. The reference implementation acts on each user order received and makes the order in the opposite direction at the auction end price with a random order size between 20 and MAX_TRADE_SIZE_QUOTE.
It may be helpful to determine how much time is left in the order's auction in order to get the current dutch auction price:
The main ClearingHouse object from the SDK will update (polling or WebSocket) the user's account details behind the scenes. You can access the open orders and open positions of the user account by reading the positions and orders object of the ClearingHouseUser.