This repository contains example implementations and full projects for interacting with the Octarine protocol (Mystic Finance).
market-maker/: A complete Market Maker bot for handling Instant Redemption Bids and Liquidation Triggers.user/: A React-based web application for users to Request Quotes and Swap Tokens.examples/: Standalone scripts demonstrating specific API interactions (Redemption, Liquidation, Swap).
A centralized bot for market makers to participate in the Octarine ecosystem.
- Instant Redemption Bidding: Automatically polls for RFQ requests and submits bids based on configurable spread.
- Liquidation Triggers: Monitors for underwater positions and triggers liquidations to earn bonuses.
- Unified Execution: Run both services concurrently.
- Navigate to the directory:
cd market-maker - Install dependencies:
npm install
- Configure environment:
- Create a
.envfile (see.env.exampleor strictly follow the template). - Set
PRIVATE_KEY,MARKET_MAKER_ADDRESS, andACCEPTED_TOKENS.
- Create a
- Run the bot:
npm start
A simple frontend for end-users to redemptions/swaps.
- Wallet Connection: Supports MetaMask and other Injected Wallets.
- Swap Interface: Simple UI to input Token In, Token Out, and Amount.
- Smart Routing: Automatically handles "Instant" (Pre-Approved) swaps vs. "RFQ" (Bidding) flows.
- Navigate to the directory:
cd user - Install dependencies:
npm install
- Start Development Server:
npm run dev
- Open
http://localhost:3000(or the URL shown in terminal).
Original reference scripts for understanding individual components.
redemption/instant-redemption-bidding.ts: Reference logic for bidding.liquidation/liquidation-trigger.ts: Reference logic for liquidations.swap/verify-swap.ts: Reference logic for user swaps.
Make sure to construct your .env files correctly in each project directory.
Note: The root .gitignore is set up to exclude .env files and node_modules to prevent accidental commits of sensitive data.