Skip to content

Commit

Permalink
chore: Update Lyra V2 client installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
8ball030 committed Dec 26, 2023
1 parent 1992f1f commit 1fa17c3
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lyra/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "lyra-client"
name = "lyra-v2-client"
version = "0.1.2"
description = ""
authors = ["8baller <[email protected]>"]
Expand Down
71 changes: 71 additions & 0 deletions scripts/demo.sh
Original file line number Diff line number Diff line change
@@ -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


0 comments on commit 1fa17c3

Please sign in to comment.