Skip to content

Conversation

@Bodo171
Copy link
Collaborator

@Bodo171 Bodo171 commented Feb 19, 2025

No description provided.

@Bodo171 Bodo171 requested a review from hasanbal February 19, 2025 23:41
@Bodo171 Bodo171 merged commit f98bc78 into main Feb 20, 2025
0 of 10 checks passed
jace1970 pushed a commit to jace1970/lighter-python that referenced this pull request Oct 23, 2025
…0-prefix quantity adjustment

PROBLEM:
Position sizing completely broken after incorrect "fixes":
- XRP: $7026 instead of $10 (700x too large!)
- BNB/LINK/DOGE/PUMP: $1000 instead of $10 (100x)
- 1000BONK: $1500 instead of $10 (150x)

ROOT CAUSE elliottech#1: My previous decimal "fixes" were WRONG
- Changed BNBUSDC decimals 4→2 (WRONG! Should be 4)
- Changed LINKUSDC decimals 3→1 (WRONG! Should be 3)
- Changed PUMPUSDC decimals 2→0 (WRONG! Should be 2)
- The ORIGINAL example config had CORRECT decimals all along!

ROOT CAUSE elliottech#2: 1000-prefix markets need quantity adjustment
- Taapi returns price for 1 BONK token ($0.00001)
- Bot calculates: $10 / $0.00001 = 1,000,000 BONK
- But Lighter's "1000BONK" market expects qty in "1000-BONK units"
- 1 unit = 1000 tokens
- Need to send: 1,000,000 / 1000 = 1,000 units (not 1,000,000)

SOLUTION:
1. Reverted base_decimals back to original example values:
   - BNBUSDC: 2 → 4 ✓
   - LINKUSDC: 1 → 3 ✓
   - PUMPUSDC: 0 → 2 ✓
   - DOGEUSDC: Already correct at 2 ✓

2. Removed incorrect price adjustment code

3. Added quantity adjustment for 1000-prefix markets:
   - Divides calculated quantity by 1000 before sending to Lighter
   - Applies to: 1000PEPE, 1000SHIB, 1000BONK, 1000FLOKI

All positions should now be $10 as intended.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants