npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@metawin-pro/keepers

v0.1.0

Published

Monorepo for offchain infrastructure services.

Downloads

4

Readme

Swaps Offchain Infrastructure

Monorepo for offchain infrastructure services.

The repository leverages Nrwl's Nx monorepo management tools. This makes it very easy to link shared libraries to multiple apps while maintaining seperation and CI speeds with only running tasks affected by change and computation caching.

Nx has a lot of code generators to make it easier to maintain and enforce consistency across the monorepo. These generators automatically generate some useful targets (such as build and test), setup file structures, and link base tsconfig and eslint configuration files to the root of the monorepo.

To make it easier to remember there are two yarn scripts which can be used to generate node apps and js libs. This can be extended in the future to include ui and ui component library generators. These sripts are generate:lib and generate:node and take 1 argument being the name of the library you are generating. eg. generate:lib example-lib. This will automatically prepend @metawin-pro/ to example-lib so then you can import the library as import ExampleLib from '@metawin-pro/example-lib'

Since a lot of Nx runs on generators and file tsconfig links, they provide a lot of useful tooling for things such as renaming or moving variables (since this might have unknown side effects to the developer). An example of this can be found with @nrwl/workspace:move which provides an easy plugin to move a package from one place to another. Be sure to read the generators documentation before making any structural chages to the repository.

Getting started

Install dependencies (yarn preffered) npm install or yarn This will install all dependencies required by all packages. During the build stage packages generate their own package.json if generatePackageJson is set to true in the webpack configuration. This is optimised such that the distributed package does not have unused libraries included in the package.json.

Running packages

Task running in Nx can be done on an individual or many scale. For example to running npx nx run build swaps-js will only build the swaps-js package and all its dependencies (building swaps-prices will also build swaps-js as its a dependency). To run commands across many packages use nx run-many eg. npx nx run-many --target=build. Where --target can be replaced with any command. Nx will go through each of the packages and run the target script on any of the packages which include it in its project.json configuration.

Packages

@metawin-pro/swaps-js

A simple js package that contains reused types, utils and constants

@metawin-pro/swaps-keepers

Swaps position and price keepers

To run this in development mode run yarn dev:prices

@metawin-pro/swaps-prices

A seperate pricing service which uses the same websockets as the priceKeepers, serves these prices over a websocket and http server.

To run this in development mode run yarn dev:prices

@metawin-pro/swaps-order-keeper

Keeper to track orders and execute them when conditions are met

To run this in development mode run yarn dev:order-keeper

@metawin-pro/swaps-liquidator

A keeper to liquidate positions when they are undercollateralised

To run this in development mode run yarn dev:liquidator

Deploying to Google Container Registry

To deploy to GCR, simply create a git tag with the following structure [package-name]/v[version] eg. swaps-keepers/v1.0.0. This will trigger a CI build which will build and push the docker image of the swaps-keepers package to GCR.