feat: implement symbol-specific position sizing for multi-asset trading
- Extended MarketConfig with optional positionSize and leverage fields
- Configured ETH-PERP at @ 1x leverage for minimal-risk data collection
- Created getPositionSizeForSymbol() helper function in config/trading.ts
- Integrated symbol-specific sizing into execute endpoint
- Added comprehensive guide in docs/guides/SYMBOL_SPECIFIC_SIZING.md
Purpose: Enable ETH trading for faster signal quality data collection
while preserving SOL's profit-generation sizing (0 @ 10x)
Next: Create ETH alert in TradingView and restart bot
This commit is contained in:
@@ -54,6 +54,9 @@ export interface MarketConfig {
|
||||
pythPriceFeedId: string
|
||||
minOrderSize: number
|
||||
tickSize: number
|
||||
// Position sizing overrides (optional)
|
||||
positionSize?: number
|
||||
leverage?: number
|
||||
}
|
||||
|
||||
// Default configuration for 5-minute scalping with $1000 capital and 10x leverage
|
||||
@@ -108,6 +111,7 @@ export const SUPPORTED_MARKETS: Record<string, MarketConfig> = {
|
||||
pythPriceFeedId: '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
|
||||
minOrderSize: 0.1, // 0.1 SOL minimum
|
||||
tickSize: 0.0001,
|
||||
// Use default config values (positionSize: 50, leverage: 10)
|
||||
},
|
||||
'BTC-PERP': {
|
||||
symbol: 'BTC-PERP',
|
||||
@@ -115,6 +119,7 @@ export const SUPPORTED_MARKETS: Record<string, MarketConfig> = {
|
||||
pythPriceFeedId: '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
|
||||
minOrderSize: 0.001, // 0.001 BTC minimum
|
||||
tickSize: 0.01,
|
||||
// Use default config values
|
||||
},
|
||||
'ETH-PERP': {
|
||||
symbol: 'ETH-PERP',
|
||||
@@ -122,6 +127,9 @@ export const SUPPORTED_MARKETS: Record<string, MarketConfig> = {
|
||||
pythPriceFeedId: '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
|
||||
minOrderSize: 0.01, // 0.01 ETH minimum
|
||||
tickSize: 0.01,
|
||||
// DATA COLLECTION MODE: Minimal risk
|
||||
positionSize: 1, // $1 USD base capital only
|
||||
leverage: 1, // 1x leverage = $1 position size total
|
||||
},
|
||||
}
|
||||
|
||||
@@ -147,6 +155,16 @@ export function getMarketConfig(symbol: string): MarketConfig {
|
||||
return config
|
||||
}
|
||||
|
||||
// Get position size for specific symbol (with market-specific overrides)
|
||||
export function getPositionSizeForSymbol(symbol: string, baseConfig: TradingConfig): { size: number; leverage: number } {
|
||||
const marketConfig = getMarketConfig(symbol)
|
||||
|
||||
return {
|
||||
size: marketConfig.positionSize ?? baseConfig.positionSize,
|
||||
leverage: marketConfig.leverage ?? baseConfig.leverage
|
||||
}
|
||||
}
|
||||
|
||||
// Validate trading configuration
|
||||
export function validateTradingConfig(config: TradingConfig): void {
|
||||
if (config.positionSize <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user