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

@gnosis.pm/dex-liquidity-provision

v0.0.1

Published

Scripts to deploy and manage automated traders on the Gnosis Protocol exchange

Downloads

3

Readme

Gnosis Liquidity Provision

We want to employ different liquidity strategies when the Gnosis Protocol is launched. This repo is responsible for testing and execution.

The code is this repository is work in progress: it will be subject to significant changes and has known rough edges that break some functionalities. Do not use unless you fully understand the code!

How to use

Install needed dependencies:

yarn install

Note that the installation might be successful even if errors are shown in the console output. In case of doubt, running echo $? immediately after yarn install should return 0 if the installation was successful.

Build Truffle artifacts:

yarn build

This concludes the setup procedures. Any liquidity provision script can be run at this point. See scripts/README.md for details.

How to test

Start and keep the test Ethereum network running in the background:

yarn testnet

Run tests:

yarn test

Use scripts as described in scripts/README.md`.

Synthetix Liquidity Provision

This service requires a service that runs a script every 5 minutes. We have configured this to run inside a Docker container that can be interacted with as follows:

docker build -t gnosispm/dex-liquidity-provision .
docker run -e PK=$YOUR_PRIVATE_KEY -t gnosispm/dex-liquidity-provision:latest "truffle exec scripts/synthetix/facilitate_trade.js --network rinkeby"

Safe Token Distribution (Airdrop)

Create your own transferFile, or use our sample examples/sampleTransferFile.json. With a fundAccount (aka Gnosis Safe) containg sufficient funds that you own execute:

 export PK=<your private key>
export INFURA_KEY=<your infura key>
export FUND_ACCOUNT=<your gnosis safe>
export TRANSFER_FILE=<path to your transfer file>

Alternatively, there is a sample .sample_env file that is not tracked by the project where you can paste these values, rename to .env (i.e. mv .sample_env .env) source via source .sample_env

With all configuration in place, we are ready to run the script.

npx truffle exec scripts/airdrop.js --fundAccount=$FUND_ACCOUNT --transferFile=$TRANSFER_FILE --network=$NETWORK_NAME

Then, you will be provided with logs containing all the transfer details followed by a prompt asking "Are you sure you want to send this transaction to the EVM?"

Transfer File Standard

The airdrop script accepts both .json and .csv file extensions with the following format

[
  {
    "amount": "0.001",
    "tokenAddress": "0x4dbcdf9b62e891a7cec5a2568c3f4faf9e8abe2b",
    "receiver": "0x100000000000000000000000000000000000000"
  },
  {
    "amount": "0.002",
    "tokenAddress": "0x4dbcdf9b62e891a7cec5a2568c3f4faf9e8abe2b",
    "receiver": "0x2000000000000000000000000000000000000000"
  }
]
receiver,amount,token_address
0x90d26c3805030a05c7fdd89326a4a2a99cbade31,3.14159,0x6810e776880C02933D47DB1b9fc05908e5386b96
0x399c7819840329e2b73449d6afcf7f4fd71399b2,2.5,0x6810e776880C02933D47DB1b9fc05908e5386b96
0x274df99cf90c55f18f079f482750d03209b02f92,2,0x6810e776880C02933D47DB1b9fc05908e5386b96

Note that additional columns may beincluded in the CSV or JSON, but the above shown must be available.

Selecting yes yields a link to the Gnosis Safe interface where the transaction can be signed and executed.

To do a "verification" run simply add the argument --verify and observe the difference in the last two lines of the logs emitted.

Note that, the gas costs for such transactions can vary based on the tokens you are transfering (since each token could potentially implement their transfer's differently).