@dinolab/crypto-mm
v1.0.0
Published
Crypto Market Maker
Readme
Solana Market Maker (SolMM)
A comprehensive TypeScript library for automated market making operations on the Solana blockchain. This library provides tools for token creation, liquidity management, trading volume generation, and profit tracking.
🚀 Features
- Token Creation: Create new tokens on Solana blockchain
- DEX Integration: Launch tokens on various decentralized exchanges
- Market Making: Automated boost and volume trading
- Balance Management: Multi-wallet balance operations
- Liquidity Tracking: Real-time liquidity monitoring
- Profit Tracking: Track profits across multiple wallets
- Batch Operations: Efficient batch processing for multiple operations
📦 Installation
npm install solana-market-maker🛠️ Dependencies
npm install @solana/web3.js axios🏁 Quick Start
import { SolMM } from 'solana-market-maker';
import { Keypair } from '@solana/web3.js';
// Initialize SolMM
const rpcUrl = 'https://api.mainnet-beta.solana.com';
const testnet = false;
const marketMaker = new SolMM(rpcUrl, testnet);
// Create a wallet keypair
const ownerKeypair = Keypair.generate();
// Example: Get wallet balance
const walletAddresses = ['your-wallet-address'];
const balances = await marketMaker.getBalance(walletAddresses);
console.log(balances);📖 API Reference
Constructor
new SolMM(rpcUrl: string, testnet: boolean)rpcUrl: Solana RPC endpoint URLtestnet: Boolean flag for testnet/mainnet
Balance Operations
getBalance(walletAddresses: string[])
Get native SOL balances for multiple wallet addresses.
const balances = await marketMaker.getBalance([
'wallet1_address',
'wallet2_address'
]);transferBalance(fromKeypair: Keypair, toAddresses: string[], amount: bigint)
Transfer SOL from one wallet to multiple addresses.
const signatures = await marketMaker.transferBalance(
senderKeypair,
['recipient1', 'recipient2'],
BigInt(1000000) // Amount in lamports
);Token Operations
getTokenInfo(tokenAddress: string)
Retrieve detailed information about a token.
const tokenInfo = await marketMaker.getTokenInfo('token_address');createToken(tokenParams: TokenCreateParams, ownerKeypair: Keypair)
Create a new token on Solana.
const tokenParams = {
name: 'My Token',
symbol: 'MTK',
decimals: 9,
supply: BigInt(1000000),
// ... other parameters
};
const tokenAddress = await marketMaker.createToken(tokenParams, ownerKeypair);launchToken(launchExchange, tokenParams, launchParams, ownerKeypair)
Launch a token on a specified exchange with liquidity pool creation.
const launchResult = await marketMaker.launchToken(
ExchangeType.RAYDIUM,
tokenParams,
{
tokenAmount: BigInt(500000),
nativeAmount: BigInt(1000000000)
},
ownerKeypair
);Market Making Operations
Boost Operations
// Start boosting a token
const boostId = await marketMaker.startBoostToken(
ExchangeType.RAYDIUM,
boostParams,
walletKeypair
);
// Pause/Resume/Stop boost
await marketMaker.pauseBoostToken(boostId);
await marketMaker.resumeBoostToken(boostId);
await marketMaker.stopBoostToken(boostId);Trade Volume Operations
// Start generating trade volume
const tradeId = await marketMaker.startTradeVolume(
ExchangeType.RAYDIUM,
tradeParams,
walletKeypairs
);
// Control trade volume
await marketMaker.pauseTradeVolume(tradeId);
await marketMaker.resumeTradeVolume(tradeId);
await marketMaker.stopTradeVolume(tradeId);Sell Operations
// Start selling tokens
const sellId = await marketMaker.sellToken(
sellParams,
walletKeypairs,
ownerKeypair
);
// Control selling
await marketMaker.pauseSellToken(sellId);
await marketMaker.resumeSellToken(sellId);
await marketMaker.stopSellToken(sellId);Tracking Operations
Liquidity Tracking
// Start tracking liquidity
const isTracking = marketMaker.trackLiquidity(
ExchangeType.RAYDIUM,
'pair_address'
);
// Stop tracking
marketMaker.stopTrackingLiquidity();Profit Tracking
// Start tracking profit
const isTracking = marketMaker.trackProfit(['wallet1', 'wallet2']);
// Stop tracking
marketMaker.stopTrackingProfit();Event Handling
marketMaker.on(EventType.LIQUIDITY_CHANGE, (data) => {
console.log('Liquidity changed:', data);
});
marketMaker.on(EventType.PROFIT_UPDATE, (data) => {
console.log('Profit updated:', data);
});🔧 Configuration
Environment Variables
# RPC Configuration
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
SOLANA_TESTNET=false
# Optional: Custom compute unit price
COMPUTE_UNIT_PRICE=50000Network Configuration
The library supports both mainnet and testnet operations:
- Mainnet:
https://api.mainnet-beta.solana.com - Testnet:
https://api.testnet.solana.com - Devnet:
https://api.devnet.solana.com
🔐 Security Considerations
- Never expose private keys: Always use environment variables or secure key management
- Use proper RPC endpoints: Consider using paid RPC services for production
- Implement rate limiting: Be mindful of RPC rate limits
- Test on devnet first: Always test your strategies on devnet before mainnet
📊 Supported Exchanges
The library supports integration with various Solana DEXs:
- Raydium
- Pumpfun
- Other AMM protocols
⚠️ Disclaimer
This library is for educational and research purposes. Automated trading carries significant financial risks. Users are responsible for understanding the risks and complying with all applicable regulations. The authors are not responsible for any financial losses.
Made with ❤️ for the Solana ecosystem
