@sentre/otc
v1.0.5
Published
## IMPORTANT!
Downloads
14
Readme
OTC
IMPORTANT!
In this program, we will use strict conventions that
a
is the amount of tokenA
that the MAKER wants to sell.b
is the amount of tokenB
that the MAKER wants to buy.x
is the amount of tokenA
that a TAKER takes out of the treasury.y
is the amount of tokenB
that a TAKER puts in of the treasury.maker_fee
is always about the tokenB
.taker_fee
is always about the tokenA
.
Installation
npm i @sentre/otc
or,
yarn add @sentre/otc
Usage
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',
)