project-serum / serum-ts

Project Serum TypeScript monorepo

Home Page:https://projectserum.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check lot size <= coin decimals

tomjohn1028 opened this issue · comments

Screen Shot 2021-09-16 at 3 30 04 PM

I had a real fun error where the MarketProxy wasn't even making it to the Serum DEX. Turns out it was caused by a Mint decimal change during a refactor and the lot size became larger than the mint's decimals. So everything was failing silently. The market initialized fine, but posting orders failed to proxy because the instruction data got mangled.

A simple fix would be on initialize market & new order instruction creation, validate the lots against the mint decimals.