diff --git a/components/MarginBalances.tsx b/components/MarginBalances.tsx
index 85d3ee7c..8718d8cf 100644
--- a/components/MarginBalances.tsx
+++ b/components/MarginBalances.tsx
@@ -60,7 +60,7 @@ export default function MarginBalances() {
-
Margin Account
+
Account
{selectedMangoAccount ? (
diff --git a/components/TradeForm.tsx b/components/TradeForm.tsx
index 5a13fd28..3f6ede79 100644
--- a/components/TradeForm.tsx
+++ b/components/TradeForm.tsx
@@ -186,14 +186,12 @@ export default function TradeForm() {
async function onSubmit() {
if (!price && tradeType === 'Limit') {
- console.warn('Missing price')
notify({
title: 'Missing price',
type: 'error',
})
return
} else if (!baseSize) {
- console.warn('Missing size')
notify({
title: 'Missing size',
type: 'error',
@@ -215,8 +213,9 @@ export default function TradeForm() {
}
const orderType = ioc ? 'ioc' : postOnly ? 'postOnly' : 'limit'
+ let txid
if (market instanceof Market) {
- await mangoClient.placeSpotOrder(
+ txid = await mangoClient.placeSpotOrder(
mangoGroup,
mangoAccount,
mangoGroup.mangoCache,
@@ -228,7 +227,7 @@ export default function TradeForm() {
orderType
)
} else {
- await mangoClient.placePerpOrder(
+ txid = await mangoClient.placePerpOrder(
mangoGroup,
mangoAccount,
mangoGroup.mangoCache,
@@ -241,8 +240,7 @@ export default function TradeForm() {
)
}
- console.log('Successfully placed trade!')
-
+ notify({ title: 'Successfully placed trade', txid })
setPrice('')
onSetBaseSize('')
actions.fetchMangoAccounts()
diff --git a/hooks/useBalances.tsx b/hooks/useBalances.tsx
index c299c0a0..e2855b0f 100644
--- a/hooks/useBalances.tsx
+++ b/hooks/useBalances.tsx
@@ -38,7 +38,7 @@ export function useBalances(): Balances[] {
const tokenIndex = marketIndex
- const net = (locked, tokenIndex) => {
+ const net = (nativeBaseLocked, tokenIndex) => {
const amount = mangoAccount
.getUiDeposit(
mangoCache.rootBankCache[tokenIndex],
@@ -46,7 +46,7 @@ export function useBalances(): Balances[] {
tokenIndex
)
.add(
- I80F48.fromNumber(locked).sub(
+ I80F48.fromNumber(nativeBaseLocked).sub(
mangoAccount.getUiBorrow(
mangoCache.rootBankCache[tokenIndex],
mangoGroup,