Socket
Book a DemoInstallSign in
Socket

@hashflow/market-maker

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashflow/market-maker

Javascript library to facilitate interactions with Hashflow backend and smart contracts for market makers

latest
npmnpm
Version
0.0.15
Version published
Maintainers
2
Created
Source

maker-js

Typescript library which exposes the hashflow market maker APIs

HashflowMaker

All necessary functions are exposed through the HashflowMaker object. This API object takes the following arguments to its constructor:

  • name: Your market maker's name. This must match the name that used when requesting the Hashflow team to add your market maker to the allowlist.
  • authKey: Your authentication key. These are unique keys generated by the Hashflow team during the vetting phase. If you haven't gone through this process, you can contact us on Discord.
  • engine: An instance of MakerEngine which defines the configuration, pricing strategy, and callback to handle trade confirmation. See next section.
  • secp256k1Signer: A function which takes a UInt8Array, signs it with your key, and returns a signature and recid.
  • environment (optional): Allows specifying 'staging' for connecting to the non-production API. By default, this is set to 'production'.
  • makerIndex (optional): Allows specifying an index for your maker.
  • levelsUpdateRatePerSecond (optional) The rate at which to update price levels.
  • logger (optiona) A WinstonLogger for log messages.
  • apiUrl (optional) The Websocket API URL to connect to.

Once the HashflowMaker has been constructed, it will connect to the API, publish price levels, and respond to RFQs.

MakerEngine

You must provide a MakerEngine instance operate the maker. See the jsDoc in the MakerEngine interface definition and the tests in HashflowMaker.test.ts for details on how to build your MakerEngine.

Quote Hashing

We also expose quote hashing functionality directly, so you can use that within your own API client. The function getQuoteHash, given an RFQ and an unsigned Quote, will return the hash which must be signed with SECP256K1 to create the quote signature.

FAQs

Package last updated on 04 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts