feat: add guide on how to become a market maker#19
feat: add guide on how to become a market maker#19denbite wants to merge 1 commit intodefuse-protocol:mainfrom
Conversation
WalkthroughThis pull request adds comprehensive documentation for running a market-maker solver on NEAR Intents, including a new navigation entry in the documentation structure and a detailed implementation guide covering prerequisites, architecture, setup steps, code organization, and customization options. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs.json (1)
87-110:⚠️ Potential issue | 🟠 MajorNavigation tabs should be “Home” and “API reference”.
This new page is added under the “Market Makers” tab, but the guidelines require only two tabs. Please relocate the page under the “Home” tab (or adjust the tab structure) to comply.
As per coding guidelines, Configure two navigation tabs in
docs.json: 'Home' and 'API reference'.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs.json` around lines 87 - 110, The docs.json currently defines a "tab": "Market Makers" with several groups/pages; per guidelines you must have only two top-level tabs 'Home' and 'API reference'—update the navigation so the entry containing the "Market Makers" groups/pages (e.g. pages like "integration/market-makers/introduction" and all "integration/market-makers/*" entries under groups "Market Makers", "Message Bus", "Getting started") is moved under the 'Home' tab (or reorganize into two top-level objects named exactly 'Home' and 'API reference'), remove or rename the existing "tab": "Market Makers" key, and ensure any links and group objects are preserved under the new 'Home' tab so the docs.json contains only the two required tabs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs.json`:
- Around line 105-110: The "Getting started" nested group object in docs.json
(the object with "group": "Getting started" and its "pages" array) is missing a
Font Awesome icon; update that JSON object to add an "icon" property (e.g.,
"icon": "fa-compass" or another appropriate fa- name) so the nested group
includes a Font Awesome icon as required by the navigation guidelines.
In `@integration/market-makers/become-market-maker-guide.mdx`:
- Around line 7-8: The page uses absolute internal links (e.g.,
"/integration/market-makers/message-bus/introduction"); update all internal MDX
links in become-market-maker-guide.mdx (also lines ~26-28) to use relative paths
instead (for example "./message-bus/introduction" or
"../message-bus/introduction" as appropriate), ensuring every internal href that
starts with "/integration/..." is converted to the correct relative path and
that link targets remain valid.
- Around line 137-145: Replace the standalone curl health-check example with a
CodeGroup containing three language variants: a bash variant titled "curl" that
shows `curl http://localhost:3000`, a TypeScript variant (title "TypeScript")
that uses fetch to GET the same URL and logs the JSON, and a Python variant
(title "Python") that uses requests.get(...).json() and prints the result;
locate the existing curl snippet in
integration/market-makers/become-market-maker-guide.mdx and wrap/replace it with
the <CodeGroup> component containing the three code blocks.
- Around line 7-9: Rewrite the two opening sentences (the paragraph starting
"Market makers on NEAR Intents are solvers -- programs that listen for swap
requests...") into second-person voice so the reader is addressed directly (use
"you" and "your"), e.g., explain that you will set up and run an example solver
that connects to the Message Bus, receives live quote requests, and
automatically responds to ones you can fill, and end with a line telling the
reader what they will have by the end; keep the content and meaning the same but
change phrasing to second-person throughout.
---
Outside diff comments:
In `@docs.json`:
- Around line 87-110: The docs.json currently defines a "tab": "Market Makers"
with several groups/pages; per guidelines you must have only two top-level tabs
'Home' and 'API reference'—update the navigation so the entry containing the
"Market Makers" groups/pages (e.g. pages like
"integration/market-makers/introduction" and all "integration/market-makers/*"
entries under groups "Market Makers", "Message Bus", "Getting started") is moved
under the 'Home' tab (or reorganize into two top-level objects named exactly
'Home' and 'API reference'), remove or rename the existing "tab": "Market
Makers" key, and ensure any links and group objects are preserved under the new
'Home' tab so the docs.json contains only the two required tabs.
| { | ||
| "group": "Getting started", | ||
| "pages": [ | ||
| "integration/market-makers/become-market-maker-guide" | ||
| ] | ||
| }, |
There was a problem hiding this comment.
Add a Font Awesome icon to the new “Getting started” group.
Nested groups should include an icon.
🧭 Suggested update
- {
- "group": "Getting started",
- "pages": [
- "integration/market-makers/become-market-maker-guide"
- ]
- },
+ {
+ "group": "Getting started",
+ "icon": "rocket",
+ "pages": [
+ "integration/market-makers/become-market-maker-guide"
+ ]
+ },As per coding guidelines, Use nested groups with Font Awesome icons for navigation in docs.json.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| "group": "Getting started", | |
| "pages": [ | |
| "integration/market-makers/become-market-maker-guide" | |
| ] | |
| }, | |
| { | |
| "group": "Getting started", | |
| "icon": "rocket", | |
| "pages": [ | |
| "integration/market-makers/become-market-maker-guide" | |
| ] | |
| }, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs.json` around lines 105 - 110, The "Getting started" nested group object
in docs.json (the object with "group": "Getting started" and its "pages" array)
is missing a Font Awesome icon; update that JSON object to add an "icon"
property (e.g., "icon": "fa-compass" or another appropriate fa- name) so the
nested group includes a Font Awesome icon as required by the navigation
guidelines.
| Market makers on NEAR Intents are solvers -- programs that listen for swap requests, decide whether to fill them, and respond with signed quotes. In this guide, you'll set up and run an example solver that connects to the [Message Bus](/integration/market-makers/message-bus/introduction), receives live quote requests, and automatically responds to the ones it can fill. | ||
|
|
There was a problem hiding this comment.
Switch internal links to relative paths.
Internal links currently use absolute paths (e.g., /integration/...). Please convert all internal links on this page to relative paths.
🔧 Example adjustments
-...connects to the [Message Bus](/integration/market-makers/message-bus/introduction)...
+...connects to the [Message Bus](./message-bus/introduction)...
-...transmitted to the [Verifier contract](/integration/verifier-contract/introduction)...
+...transmitted to the [Verifier contract](../verifier-contract/introduction)...As per coding guidelines, Use relative paths for all internal links in MDX documentation files.
Also applies to: 26-28
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@integration/market-makers/become-market-maker-guide.mdx` around lines 7 - 8,
The page uses absolute internal links (e.g.,
"/integration/market-makers/message-bus/introduction"); update all internal MDX
links in become-market-maker-guide.mdx (also lines ~26-28) to use relative paths
instead (for example "./message-bus/introduction" or
"../message-bus/introduction" as appropriate), ensuring every internal href that
starts with "/integration/..." is converted to the correct relative path and
that link targets remain valid.
| Market makers on NEAR Intents are solvers -- programs that listen for swap requests, decide whether to fill them, and respond with signed quotes. In this guide, you'll set up and run an example solver that connects to the [Message Bus](/integration/market-makers/message-bus/introduction), receives live quote requests, and automatically responds to the ones it can fill. | ||
|
|
||
| By the end, you'll have a working solver running locally and a clear understanding of how to customize it. |
There was a problem hiding this comment.
Rewrite the opening definition in second-person voice.
The intro is written in third-person; please address the reader directly.
✏️ Suggested rewrite
-Market makers on NEAR Intents are solvers -- programs that listen for swap requests, decide whether to fill them, and respond with signed quotes. In this guide, you'll set up and run an example solver that connects to the [Message Bus](/integration/market-makers/message-bus/introduction), receives live quote requests, and automatically responds to the ones it can fill.
+As a market maker on NEAR Intents, you run a solver — a program that listens for swap requests, decides whether to fill them, and responds with signed quotes. In this guide, you'll set up and run an example solver that connects to the [Message Bus](/integration/market-makers/message-bus/introduction), receives live quote requests, and automatically responds to the ones you can fill.As per coding guidelines, Write in second-person voice ('you') in all documentation content.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@integration/market-makers/become-market-maker-guide.mdx` around lines 7 - 9,
Rewrite the two opening sentences (the paragraph starting "Market makers on NEAR
Intents are solvers -- programs that listen for swap requests...") into
second-person voice so the reader is addressed directly (use "you" and "your"),
e.g., explain that you will set up and run an example solver that connects to
the Message Bus, receives live quote requests, and automatically responds to
ones you can fill, and end with a line telling the reader what they will have by
the end; keep the content and meaning the same but change phrasing to
second-person throughout.
| Check the health endpoint to confirm the solver is running: | ||
|
|
||
| ```bash | ||
| curl http://localhost:3000 | ||
| ``` | ||
|
|
||
| ```json | ||
| {"ready": true} | ||
| ``` |
There was a problem hiding this comment.
Wrap the health-check example in a CodeGroup with curl/TypeScript/Python variants.
The curl-only example should be presented as a multi-language CodeGroup.
🧩 Suggested structure
-```bash
-curl http://localhost:3000
-```
+<CodeGroup>
+```bash title="curl"
+curl http://localhost:3000
+```
+```ts title="TypeScript"
+const res = await fetch("http://localhost:3000");
+console.log(await res.json());
+```
+```py title="Python"
+import requests
+print(requests.get("http://localhost:3000").json())
+```
+</CodeGroup>As per coding guidelines, Use component with curl, TypeScript, and Python code variants for code examples.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Check the health endpoint to confirm the solver is running: | |
| ```bash | |
| curl http://localhost:3000 | |
| ``` | |
| ```json | |
| {"ready": true} | |
| ``` | |
| Check the health endpoint to confirm the solver is running: | |
| <CodeGroup> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@integration/market-makers/become-market-maker-guide.mdx` around lines 137 -
145, Replace the standalone curl health-check example with a CodeGroup
containing three language variants: a bash variant titled "curl" that shows
`curl http://localhost:3000`, a TypeScript variant (title "TypeScript") that
uses fetch to GET the same URL and logs the JSON, and a Python variant (title
"Python") that uses requests.get(...).json() and prints the result; locate the
existing curl snippet in integration/market-makers/become-market-maker-guide.mdx
and wrap/replace it with the <CodeGroup> component containing the three code
blocks.
No description provided.