buyMarketTotal

The buyMarketTotal() method of Nectar instances places a buy market order on the given market.

Usage

import { Nectar } from "@wasd3rplay/nectar-sdk";

const nectar = new Nectar();

const symbol = "WETH_ETHSEPOLIA:USDT_ETHSEPOLIA";

const market = await nectar.getMarket(symbol);
const orderId = await nectar.buyMarketTotal(market, "420.5");

Parameters

  • market: Market

    • A market to trade on.

  • total: string

    • The amount of quote token you want to spend.

  • signer?: Wallet

    • Optional

    • Default to userWallet property of Nectar instances.

    • A wallet placing the order.

Returns

  • string

    • An order ID, which is a unique value created by Nectar.

Last updated