Name | aevopy JSON |
Version |
0.1.1
JSON |
| download |
home_page | |
Summary | Simple client for aevo.xyz API |
upload_time | 2024-02-06 13:21:39 |
maintainer | |
docs_url | None |
author | crjameson |
requires_python | >=3.11,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Aevopy
Aevopy is a python client for the perp and options trading platform aevo.xyz. It is still in a very early stage, but maybe
useful if you consider automated crypto currency trading.
For signup with Aevo you can use this link to save on fees:
https://app.aevo.xyz/r/Tulip-Sturdy-Laffont
You can find complete tutorials on how to use this code to build your own trading strategies on my substack or medium account:
https://substack.com/@crjameson
https://medium.com/@crjameson
## Table of Contents
- [Introduction](#introduction)
- [Usage](#usage)
- [Installation](#installation)
- [Usage](#usage)
## Introduction
Aevopy is a simple to use python library to execute cryptocurrency perp and options trades via Aevo. It should work with all Python versions > 3.11. Older versions are untested but might work as well.
## Usage
Here is some example code to give you a basic idea how to use it:
```python
import aevopy
client = aevopy.AevoClient()
portfolio = client.get_portfolio()
print(f"available portfolio margin balance: {portfolio.user_margin.balance}")
# # get the market details about the asset we want to trade - TIA in this example
instrument = aevopy.get_markets(asset="TIA")
print(f"instrument: {instrument}")
# create a market buy order
order = client.buy_market(instrument.instrument_id, amount=1)
print(f"order: {order} order_id: {order.order_id} avg_price: {order.avg_price}")
# set stop loss and take profit
stop_loss_price = order.avg_price * 0.99
take_profit_price = order.avg_price * 1.02
order = client.sell_stop_loss(instrument.instrument_id, trigger=stop_loss_price)
order = client.sell_take_profit(instrument.instrument_id, trigger=take_profit_price)
```
If you need to work with multiple Accounts, you can create an account object and pass that as parameter to the client:
```python
account = aevopy.AevoAccount(key, wallet_address, api_key, api_secret, env)
...
client = aevopy.AevoClient(account)
```
## Installation
Recommended:
```
pip install aevopy
```
Or if you are using poetry:
```
poetry add aevopy
```
Alternative:
```
From github: pip install pip@git+https://github.com/crjameson/aevopy
```
Create a .env file with your credentials in the same directory as your script is running. Take a look at .env.example in the examples folder.
This file should at least configure the following values:
```
AEVO_SIGNING_KEY =
AEVO_WALLET_ADDRESS =
AEVO_API_KEY =
AEVO_API_SECRET =
AEVO_ENV = mainnet
```
Hint: You can create the signing key and API credentials in your userprofile settings on aevo.xyz.
To run the example:
```
poetry run python examples/basic_trade_and_risk_management.py
```
To run the tests:
```
poetry run pytest
```
## Contact
For questions or ideas you can find my contact information on crjameson.xyz
Raw data
{
"_id": null,
"home_page": "",
"name": "aevopy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "crjameson",
"author_email": "crjamesonxyz@proton.me",
"download_url": "https://files.pythonhosted.org/packages/09/ea/77104c65c5301e938fbad8822169657b234897c78daaf5260f122375c3e5/aevopy-0.1.1.tar.gz",
"platform": null,
"description": "# Aevopy\n\nAevopy is a python client for the perp and options trading platform aevo.xyz. It is still in a very early stage, but maybe\nuseful if you consider automated crypto currency trading. \n\nFor signup with Aevo you can use this link to save on fees:\n\nhttps://app.aevo.xyz/r/Tulip-Sturdy-Laffont\n\nYou can find complete tutorials on how to use this code to build your own trading strategies on my substack or medium account: \n\nhttps://substack.com/@crjameson\n\nhttps://medium.com/@crjameson\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Usage](#usage)\n- [Installation](#installation)\n- [Usage](#usage)\n\n## Introduction\n\nAevopy is a simple to use python library to execute cryptocurrency perp and options trades via Aevo. It should work with all Python versions > 3.11. Older versions are untested but might work as well.\n\n## Usage\n\nHere is some example code to give you a basic idea how to use it:\n\n```python\nimport aevopy\nclient = aevopy.AevoClient()\n\nportfolio = client.get_portfolio()\nprint(f\"available portfolio margin balance: {portfolio.user_margin.balance}\")\n\n# # get the market details about the asset we want to trade - TIA in this example\ninstrument = aevopy.get_markets(asset=\"TIA\")\nprint(f\"instrument: {instrument}\")\n\n# create a market buy order\norder = client.buy_market(instrument.instrument_id, amount=1)\nprint(f\"order: {order} order_id: {order.order_id} avg_price: {order.avg_price}\")\n\n# set stop loss and take profit\nstop_loss_price = order.avg_price * 0.99\ntake_profit_price = order.avg_price * 1.02\norder = client.sell_stop_loss(instrument.instrument_id, trigger=stop_loss_price)\norder = client.sell_take_profit(instrument.instrument_id, trigger=take_profit_price)\n```\nIf you need to work with multiple Accounts, you can create an account object and pass that as parameter to the client:\n\n```python\naccount = aevopy.AevoAccount(key, wallet_address, api_key, api_secret, env)\n...\nclient = aevopy.AevoClient(account)\n\n```\n\n## Installation\n\nRecommended:\n```\npip install aevopy\n```\nOr if you are using poetry:\n```\npoetry add aevopy\n```\nAlternative:\n```\nFrom github: pip install pip@git+https://github.com/crjameson/aevopy\n```\nCreate a .env file with your credentials in the same directory as your script is running. Take a look at .env.example in the examples folder.\nThis file should at least configure the following values:\n\n```\nAEVO_SIGNING_KEY = \nAEVO_WALLET_ADDRESS = \nAEVO_API_KEY =\nAEVO_API_SECRET =\nAEVO_ENV = mainnet\n```\nHint: You can create the signing key and API credentials in your userprofile settings on aevo.xyz.\n\n\nTo run the example:\n```\npoetry run python examples/basic_trade_and_risk_management.py\n```\n\nTo run the tests:\n\n```\npoetry run pytest\n```\n\n## Contact\n\nFor questions or ideas you can find my contact information on crjameson.xyz\n",
"bugtrack_url": null,
"license": "",
"summary": "Simple client for aevo.xyz API",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d28f2c98ea631a1a7dc96ef80a793fd3fd92f47bda076098d2697d5164181e6b",
"md5": "ac09bc088f5a13218a27de2804a21854",
"sha256": "64bc3e501a659fcaec079d99c388e96d99ebca2986f13f2744a1db2ce6415867"
},
"downloads": -1,
"filename": "aevopy-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ac09bc088f5a13218a27de2804a21854",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 8342,
"upload_time": "2024-02-06T13:21:37",
"upload_time_iso_8601": "2024-02-06T13:21:37.414495Z",
"url": "https://files.pythonhosted.org/packages/d2/8f/2c98ea631a1a7dc96ef80a793fd3fd92f47bda076098d2697d5164181e6b/aevopy-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "09ea77104c65c5301e938fbad8822169657b234897c78daaf5260f122375c3e5",
"md5": "ec9a2961dd3b50916b85ebe0f0660fbd",
"sha256": "b6aa9ee013e8441f3ff1960c947c8b3d224378d9177fe43f7d195ec7f209e679"
},
"downloads": -1,
"filename": "aevopy-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "ec9a2961dd3b50916b85ebe0f0660fbd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 6970,
"upload_time": "2024-02-06T13:21:39",
"upload_time_iso_8601": "2024-02-06T13:21:39.199948Z",
"url": "https://files.pythonhosted.org/packages/09/ea/77104c65c5301e938fbad8822169657b234897c78daaf5260f122375c3e5/aevopy-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-06 13:21:39",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "aevopy"
}