# @sentre/otc

> ## IMPORTANT!

Latest version **1.0.5** (published 2022-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sentre/otc
pnpm add @sentre/otc
yarn add @sentre/otc
bun add @sentre/otc
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-11-30 |
| First published | 2022-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16 <=18 |
| Dependencies | 3 |
| Unpacked size | 157.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tu Phan |
| Maintainers | tphanson |
| Keywords | solana, sentre, otc |

## Links

- npm: https://www.npmjs.com/package/@sentre/otc
- Repository: https://github.com/DescartesNetwork/sen-otc-prog
- Homepage: https://otc.sentre.io
- Issues: https://github.com/DescartesNetwork/sen-otc-prog/issues
- npm.io page: https://npm.io/package/@sentre/otc

## Dependencies (3)

- [bs58](https://npm.io/package/bs58.md) ^5.0.0
- [js-sha3](https://npm.io/package/js-sha3.md) ^0.8.0
- [@project-serum/anchor](https://npm.io/package/@project-serum/anchor.md) ^0.24.2

## Recent versions

- 1.0.5 (latest) — 2022-11-30
- 1.0.4 — 2022-11-30
- 1.0.3 — 2022-11-25
- 1.0.2 — 2022-11-25
- 1.0.1 — 2022-11-20
- 1.0.0 — 2022-11-20

## README

# OTC

## IMPORTANT!

In this program, we will use strict conventions that

- `a` is the amount of token `A` that the MAKER wants to sell.
- `b` is the amount of token `B` that the MAKER wants to buy.
- `x` is the amount of token `A` that a TAKER takes out of the treasury.
- `y` is the amount of token `B` that a TAKER puts in of the treasury.
- `maker_fee` is always about the token `B`.
- `taker_fee` is always about the token `A`.

## Installation

```bash
npm i @sentre/otc
```

or,

```bash
yarn add @sentre/otc
```

## Usage

```js
import Otc, { DEFAULT_OTC_PROGRAM_ID, DEFAULT_RPC_ENDPOINT } from '@sentre/otc'
import { Wallet, web3 } from '@project-serum/anchor'

const wallet = new Wallet(web3.Keypair.generate())
const otc = new Otc(wallet, DEFAULT_RPC_ENDPOINT, DEFAULT_OTC_PROGRAM_ID)

const order = await otc.getOrderData(
  '9EKdURf9kaR8yeu9sWSiGQaeMz59zfigQe4mcfsGnLW8',
)
```

---
_Source: https://npm.io/package/@sentre/otc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
