Skip to content

Commit

Permalink
Add Market Making mode & Manifest cleanup (#144)
Browse files Browse the repository at this point in the history
# Pull Request Description
Adds an AI guided Market Making mode and moves all Manifest tools to a
single file

## Changes Made
This PR adds the following changes:
<!-- List the key changes made in this PR -->
- Creates a new mm mode (3) for market making
- Combines all manifest related tools into a single file
  
## Implementation Details
<!-- Provide technical details about the implementation -->
- Added a mode which prompts the user to enter parameters to market make
on Manifest

## Transaction executed by agent 
<!-- If applicable, provide example usage, transactions, or screenshots
-->
Example transaction:
https://solscan.io/tx/5qKGhpPuoFs2GtmQ5kGKQmu6NTZTG39DGY8YZVifXwx3BFQhkA9tANhVHPC3yRcEZYFy7hxy4SAjSh6WTSxUGxap

## Prompt Used
<!-- If relevant, include the prompt or configuration used -->
Prompt for AI guided mm

![image](https://github.com/user-attachments/assets/2dbfe04e-4cfe-4495-86d2-24a9573b7c3f)
Subsequent aiMM

![image](https://github.com/user-attachments/assets/70cecd37-0acd-4cc4-b5d2-fa0ad863c821)

## Additional Notes
<!-- Any additional information that reviewers should know -->

## Checklist
- [x] I have tested these changes locally
- [x] I have updated the documentation
- [x] I have added a transaction link
- [x] I have added the prompt used to test it
  • Loading branch information
thearyanag authored Jan 6, 2025
2 parents 249cd70 + f03f5dd commit f987d8b
Show file tree
Hide file tree
Showing 11 changed files with 6,610 additions and 192 deletions.
3 changes: 3 additions & 0 deletions examples/market-making-agent/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OPENAI_API_KEY=
RPC_URL=
SOLANA_PRIVATE_KEY=
50 changes: 50 additions & 0 deletions examples/market-making-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# AI Guided Market Making Agent

This agent showcases an ai guided market maker on Manifest, Solana's CLOB DEX. The agent guides the user to setup basic two-sided quotes on Manifest markets.
[Reference](https://github.com/CKS-Systems/manifest)

## Key Features

- **Automated Quoting**: The agent automatically refreshes quotes on an interval.
- **Reducing Complexity**: Designed to abstract away parameters for setting up market making.
- **Random Model**: The market making introduces randomness to prevent front running or other negative botting behavoirs.


## Example
=== Market Maker Configuration ===

Enter the market ID: 2Uj8277fkaVBtTU6Wp2GPRbQC86SkSdgQ2mp1Q5N2LHc
Enter the base token symbol (e.g., SEND): SEND
Enter the quote token symbol (e.g., USDC): USDC

=== Quote Parameters (applies to both buy and sell sides) ===
Enter number of quotes to place on each side: 4
Enter minimum quote depth (% distance from mid price): 0.1
Enter maximum quote depth (% distance from mid price): 2

=== Token Allowances ===
Enter total SEND allowance: 2
Enter total USDC allowance: 3

Enter update interval in seconds: 20

=== Configuration Summary ===
{
"marketId": "2Uj8277fkaVBtTU6Wp2GPRbQC86SkSdgQ2mp1Q5N2LHc",
"baseToken": "SEND",
"quoteToken": "USDC",
"quoteParams": {
"number": 4,
"minDepth": 0.1,
"maxDepth": 2
},
"allowance": {
"base": 2,
"quote": 3
},
"intervalSeconds": 20
}

Is this configuration correct? (yes/no): yes

Starting market maker mode for SEND/USDC...
Loading

0 comments on commit f987d8b

Please sign in to comment.