fix recent trades buys/sells for perp
This commit is contained in:
parent
e5f39c5b08
commit
27cf9f973b
|
@ -120,7 +120,7 @@ const RecentTrades = () => {
|
||||||
|
|
||||||
const vol = fills.reduce(
|
const vol = fills.reduce(
|
||||||
(a: { buys: number; sells: number }, c: any) => {
|
(a: { buys: number; sells: number }, c: any) => {
|
||||||
if (c.side === 'buy' || c.takerSide === 1) {
|
if (c.side === 'buy' || c.takerSide === 0) {
|
||||||
a.buys = a.buys + c.size
|
a.buys = a.buys + c.size
|
||||||
} else {
|
} else {
|
||||||
a.sells = a.sells + c.size
|
a.sells = a.sells + c.size
|
||||||
|
@ -133,6 +133,8 @@ const RecentTrades = () => {
|
||||||
return [vol.buys / totalVol, vol.sells / totalVol]
|
return [vol.buys / totalVol, vol.sells / totalVol]
|
||||||
}, [fills])
|
}, [fills])
|
||||||
|
|
||||||
|
console.log(fills)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="thin-scroll h-full overflow-y-scroll">
|
<div className="thin-scroll h-full overflow-y-scroll">
|
||||||
|
|
|
@ -27,7 +27,7 @@ export const ConnectWalletButton: React.FC = () => {
|
||||||
disabled={!groupLoaded}
|
disabled={!groupLoaded}
|
||||||
className={` text-white focus:outline-none disabled:cursor-wait disabled:opacity-25`}
|
className={` text-white focus:outline-none disabled:cursor-wait disabled:opacity-25`}
|
||||||
>
|
>
|
||||||
<div className="relative flex h-16 w-44 bg-th-bkg-2 py-2 before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-th-bkg-4 before:to-transparent before:opacity-0 hover:overflow-hidden hover:before:-translate-x-full hover:before:animate-[shimmer_0.75s_normal] hover:before:opacity-100">
|
<div className="relative flex h-16 w-44 bg-th-bkg-3 py-2 before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-th-bkg-4 before:to-transparent before:opacity-0 hover:overflow-hidden hover:before:-translate-x-full hover:before:animate-[shimmer_0.75s_normal] hover:before:opacity-100">
|
||||||
<div className="default-transition relative z-10 flex h-full items-center justify-center space-x-3 px-4">
|
<div className="default-transition relative z-10 flex h-full items-center justify-center space-x-3 px-4">
|
||||||
{connecting ? (
|
{connecting ? (
|
||||||
<Loading className="h-[28px] w-[28px]" />
|
<Loading className="h-[28px] w-[28px]" />
|
||||||
|
|
Loading…
Reference in New Issue