🤖
Perps Market Making Bot
Show quotes on both sides of the orderbook to profit from trading activity
We've open-sourced an example market-maker bot. The bot provides liquidity to Zeta DEX by issuing bid & ask quotes per asset and instrument. It monitors mark prices from an external exchange via web sockets, and monitors quote orders via both web sockets and periodic refreshes.
Makers pay no fees on Zeta DEX (excluding SOL transaction fees), so go crazy!
If things are going well and you want to scale it up, reach out to us about our Market Maker Rewards program.
Ensure
makerWallet.json
file exists in project root dir, in format:[
111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
111, 111, 111, 111
]
Install dependencies and start:
npm i
ts-node src/app.ts

Market-maker bot example
app.ts
- Entrypoint with stale price checkmaker.ts
- Listens to external exchange (Bybit) orderbooks for mark price, monitors Zeta order updates, maintains current statestate.ts
- Keeps mark prices (theos) and issued quotestypes.ts
- Defines common typesutils.ts
&math.ts
- Mathematical and utility functionsconfiguration.ts
- Parametrizes quoting strategy as per config.json
Parameters specified in
config.json
- Exchange/connection params
network
- Network on which the Zeta DEX program is deployedprogramId
- Zeta DEX programIdendpoint
- RPC node urlmarkExchange
- Which exchange to source mark prices from
- Time-based params
requoteIntervalMs
- Frequency of Zeta quote periodic refreshmarkPriceStaleIntervalMs
- Frequency of the stale price check, breach of which results in program exit
- Asset params
quoteLotSize
- Lot sizes for the given instrumentwidthBps
- Defines the spread between bid & askrequoteBps
- Defines the margin which once breached triggers re-quotingquoteCashDelta
- Cash amount offered on bid & ask
Last modified 2mo ago