open-index/open-npm huggingface dataset:
npm package: @matrixlabs/cli
Description: Cli tool for interacting with matrix perpetual dex
Author: Yash M
Latest version: 1.0.3

## @matrixlabs/cli

cli tool for info on amms, positions and portfolios on matrixlabs perpetual dex

### Prerequisites

-   node >= 14
-   git

### Installation

```sh
npm i -g @matrixlabs/cli
```

## Commands

-   `amm`: shows amms stats
-   `position`: shows trades
-   `porfolio`: show traders portfolio
-   `help`: info on available commands

### amm

```sh
matrix amm
```

example output

```
BTC/USDC
- Proxy Address: 0xB4b83a3C2A304599C0d790F026e13f0D26dEDBb0
- Open Interest: 1978.434307616432917304 USDC
- Open Interest Cap: 30000000 USDC
- Max Holding: 30 BTC
- Mark Price: 44558.283861776188303059 USDC
- Index Price: 43506.66 USDC
- Quote Asset Reserve: 14528000.131841416432946374 USDC
- Base Asset Reserve: 326.044875895772421656 BTC
- Price Feed: 0xC4F6696422e81652bF2F4696DBe220866c8f181A
- Est. Funding Rate: 0.11803 %
```

-   options

    -   `--amm`: filter by amm address

### position

shows

```sh
matrix position
```

example output

```
Trade event #1
- timestamp: 2022/3/3 15:24
- trader: 0x9510a5cbde44227c00cf36ff5d2f8b6b72ddcd55
- asset: BTC
- side: LONG
- size: 0.00002244251757843 BTC
- price: 44558.283861776188303059 USDC

Trade event #2
...
```

-   displays last 10 trades by default
-   options

    -   `--limit`: limit the number of trades displayed
    -   `--trader`: filter for a specific trader
    -   `--amm`: filter for a specific amm

-   portfolio
    -   shows trader portfolio

### portfolio

```sh
matrix portfolio <trader>
```

example output

```
BTC/USDC
- position size: 0.00002244251757843 BTC
- margin (with funding payment): 1 USDC
- margin ratio: 100%
- leverage: 1
- pnl: -0.000000000000017342 USDC
- liq. price: 2784.8956 USDC
- open notional: 1 USDC
```