Skip to content

Commit

Permalink
add tick size to list market (solana-labs#2029)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Jan 6, 2024
1 parent 3035fe0 commit 8f21bbe
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions components/instructions/programs/mangoV4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,13 @@ const instructions = () => ({
const banks = [...mangoGroup.banksMapByMint.values()].map((x) => x[0])
let baseMint = banks.find((x) => x.publicKey.equals(baseBank))?.mint
let quoteMint = banks.find((x) => x.publicKey.equals(quoteBank))?.mint
const currentMarket = await Market.load(
connection,
openbookMarketPk,
undefined,
openBookProgram
)
if (!baseMint || !quoteMint) {
const currentMarket = await Market.load(
connection,
openbookMarketPk,
undefined,
openBookProgram
)
baseMint = currentMarket.baseMintAddress
quoteMint = currentMarket.quoteMintAddress
}
Expand Down Expand Up @@ -672,6 +672,21 @@ const instructions = () => ({
Proposed Openbook market link
</a>
</div>
{console.log(currentMarket)}
<div className="my-4">
<div>Tick Size: {currentMarket.tickSize}</div>
<div>
Base Lot Size: {currentMarket.decoded?.baseLotSize?.toNumber()}
</div>
<div>
Quote Lot Size:{' '}
{currentMarket.decoded?.quoteLotSize?.toNumber()}
</div>
<div>
Quote decimals: {currentMarket['_quoteSplTokenDecimals']}
</div>
<div>Base decimals: {currentMarket['_baseSplTokenDecimals']}</div>
</div>
{info}
</div>
)
Expand Down

0 comments on commit 8f21bbe

Please sign in to comment.