From 1fa17c3a6d6be0894cf89de7ef9610bb9780f2c7 Mon Sep 17 00:00:00 2001 From: 8baller Date: Tue, 26 Dec 2023 12:57:09 +0000 Subject: [PATCH] chore: Update Lyra V2 client installation instructions --- README.md | 4 ++- lyra/cli.py | 4 ++- pyproject.toml | 2 +- scripts/demo.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 scripts/demo.sh diff --git a/README.md b/README.md index ff13ac6..5ca5bbb 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,13 @@ This repo provides a unified interface for the Lyra V2 Exchange. +Please checkout the [examples](./examples) directory for usage. + ## Install ```bash -pip install lyra-client +pip install lyra-v2-client ``` ## Dev diff --git a/lyra/cli.py b/lyra/cli.py index 884b5e2..713776d 100644 --- a/lyra/cli.py +++ b/lyra/cli.py @@ -40,7 +40,9 @@ def set_client(ctx): else: env = Environment.TEST ctx.client = LyraClient(**auth, env=env) - print(f"Client created for environment `{ctx.client.env.value}`") + + if ctx.logger.level == "DEBUG": + print(f"Client created for environment `{ctx.client.env.value}`") return ctx.client diff --git a/pyproject.toml b/pyproject.toml index 948a839..078845f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "lyra-client" +name = "lyra-v2-client" version = "0.1.2" description = "" authors = ["8baller <8ball030@gmail.com>"] diff --git a/scripts/demo.sh b/scripts/demo.sh new file mode 100644 index 0000000..ee50a6d --- /dev/null +++ b/scripts/demo.sh @@ -0,0 +1,71 @@ +#! /bin/bash + +set -e + +SLEEP_TIME=1 + +cowsay The lyra V2 client offers both a library and a cli tool to manage positions on LyraV2. + +sleep $SLEEP_TIME + +clear + +cowsay "The client can be installed from pip as so;" + +echo "pip install lyra-v2-client" + +sleep $SLEEP_TIME + +clear + +cowsay "Once the lyra client is installed, we can programatically interact with lyra" + +lyra + +sleep $SLEEP_TIME +clear + +cowsay we can fetch markets by instrument type and currency + +lyra instruments fetch --help + +sleep $SLEEP_TIME +clear + +echo \`lyra instruments fetch -i perp\` +lyra instruments fetch -i perp + +sleep $SLEEP_TIME +clear + +echo \`lyra instruments fetch -i perp -c btc +lyra instruments fetch -i perp -c btc +sleep $SLEEP_TIME +clear + + + +cowsay we can manage orders +echo \`lyra orders\` +lyra orders +sleep $SLEEP_TIME +clear + +cowsay we can create orders +echo \`lyra orders create -s sell -i ETH-PERP -a 1 -p 3000\` +lyra orders create -s sell -i ETH-PERP -a 1 -p 3000 +sleep $SLEEP_TIME +clear + +cowsay "we can then retrieve them" +echo \`lyra orders fetch -i ETH-PERP --status open\` +lyra orders fetch -i ETH-PERP --status open +sleep $SLEEP_TIME +clear + + +cowsay "we can then cancel them" +echo \`lyra orders fetch -i ETH-PERP --status open\` +lyra orders cancel_all + +