Inspiration

We wanted to use the Gemini market maker rebates program in order to create a staking protocol on Solana. This lets people take part in market making without having to build their own bot, and helps provide market making for Gemini prediction markets.

What it does

Deposit USDC on Solana, get mvUSDC shares. This works by utilizing a market-maker bot on Gemini which we created. Profit and NAV flow back through epoch settlement, and the app lets you stake, inspect every gate condition, and watch the bot.

How we built it

We built three pieces: an Anchor program in escrow/ which supports deposits, draw gate, NAV, epochs, and bond slashes. A TypeScript bot/ on the Gemini SDK that quotes, attributes PnL, and runs the relayer against either a simulated vault or the real program. And a web/ Next.js app with wallet-adapter for on-chain deposit and withdraw. Test mode runs about a minute per simulated day so a demo can show rebates, NAV, and settlement without waiting for 5pm ET.

Challenges we ran into

Gemini's developer API gateway was not working for us, so we used the Gemini sandbox gateway instead. Prediction books are thin in real time which would make it difficult to demo, so we replay each contract’s reported 24h volume across an epoch while still quoting live top-of-book.

Accomplishments that we're proud of

We have an end-to-end demo on devnet. We created our first defi protocol. This is also one of our teammate's first hackathon.

What we learned

Even though we wanted to, it simply wasn't possible to keep all of our logic on-chain. A compromise we had to make was running the market maker off-chain and enforcing guard rails on it using our on-chain escrow. This allowed for the speed and flexibility of an off-chain app while ensuring the money stored on the protocol stays safe.

What's next for Mouse Trap

Next, we want independent attestors and zkTLS to help verify and secure the staking pool. We also want to have several market makers running at once across many different prediction markets on Gemini, to help grow the protocol and gain more yield.

Built With

Share this project:

Updates

Submission history