anyhedge


Nameanyhedge JSON
Version 0.8.2 PyPI version JSON
download
home_pageNone
SummaryBasic components of AnyHedge contracts
upload_time2024-03-24 06:27:12
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseCopyright (c) 2022 emergent_reasons Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords bitcoincash bch anyhedge utxo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # anyhedge

Basic components for AnyHedge contracts.

Currently, this only deals with contract execution and focuses on sats-accurate values in relation
to the reference typescript [AnyHedge Library](http://gitlab.com/generalProtocols/anyhedge/library).


## Install

`pip install anyhedge` (use venv, miniconda, etc. - don't install things on your system python)


## Requirements

- `python >= 3.10` (use venv, miniconda, etc. - don't install things on your system python)
- `requirements.txt` (`pip install -r requirements.txt` using your virtual python)


## Demo

`python demo.py`

You should see something like this:

```
ContractProposal(start_timestamp=1668818394 (2022-11-19T00:39:54+00:00),
                 maturity_timestamp=1668829194 (2022-11-19T03:39:54+00:00),
                 nominal_oracleUnits_x_satsPerBch=10000000000000,
                 start_price_oracleUnits_per_bch=10000,
                 low_liquidation_price_oracleUnits_per_bch=7143,
                 oracle_public_key='02d3c1de9d4bc77d6c3608cbe44d10138c7488e592dc2b1e10a6cf0e92c2ecb047',
                 maker_side=Hedge)
That is a $1000.0 Long Taker contract.

ContractFunding(base_proposal=...,
                fee_agreements=(FeeAgreement (maker fee): Taker --> 1000 Sats (1e-05 BCH) --> Maker,
                                FeeAgreement (settlement service fee): Taker --> 2000 Sats (2e-05 BCH) --> Settlement Service))
That is a contract funding with a total of 1e-05 BCH in fees to Maker.

ContractRedemption(base_funding=...,
                   end_price_timestamp=1668829194 (2022-11-19T03:39:54+00:00),
                   naive_end_price_oracleUnits_per_bch=11000,
                   redemption_type=Maturation)
That is a redemption paying 4.90881092 BCH to Taker versus their original 3.99972001 BCH for a gain of 22.728113661135996%.
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "anyhedge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "bitcoincash, bch, anyhedge, utxo",
    "author": null,
    "author_email": "emergent_reasons <emergent_reasons@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/84/bf/7efdcf223e7377f2a401608cf76424d0edbad276a71d050745f48da36d53/anyhedge-0.8.2.tar.gz",
    "platform": null,
    "description": "# anyhedge\n\nBasic components for AnyHedge contracts.\n\nCurrently, this only deals with contract execution and focuses on sats-accurate values in relation\nto the reference typescript [AnyHedge Library](http://gitlab.com/generalProtocols/anyhedge/library).\n\n\n## Install\n\n`pip install anyhedge` (use venv, miniconda, etc. - don't install things on your system python)\n\n\n## Requirements\n\n- `python >= 3.10` (use venv, miniconda, etc. - don't install things on your system python)\n- `requirements.txt` (`pip install -r requirements.txt` using your virtual python)\n\n\n## Demo\n\n`python demo.py`\n\nYou should see something like this:\n\n```\nContractProposal(start_timestamp=1668818394 (2022-11-19T00:39:54+00:00),\n                 maturity_timestamp=1668829194 (2022-11-19T03:39:54+00:00),\n                 nominal_oracleUnits_x_satsPerBch=10000000000000,\n                 start_price_oracleUnits_per_bch=10000,\n                 low_liquidation_price_oracleUnits_per_bch=7143,\n                 oracle_public_key='02d3c1de9d4bc77d6c3608cbe44d10138c7488e592dc2b1e10a6cf0e92c2ecb047',\n                 maker_side=Hedge)\nThat is a $1000.0 Long Taker contract.\n\nContractFunding(base_proposal=...,\n                fee_agreements=(FeeAgreement (maker fee): Taker --> 1000 Sats (1e-05 BCH) --> Maker,\n                                FeeAgreement (settlement service fee): Taker --> 2000 Sats (2e-05 BCH) --> Settlement Service))\nThat is a contract funding with a total of 1e-05 BCH in fees to Maker.\n\nContractRedemption(base_funding=...,\n                   end_price_timestamp=1668829194 (2022-11-19T03:39:54+00:00),\n                   naive_end_price_oracleUnits_per_bch=11000,\n                   redemption_type=Maturation)\nThat is a redemption paying 4.90881092 BCH to Taker versus their original 3.99972001 BCH for a gain of 22.728113661135996%.\n```\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2022 emergent_reasons  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Basic components of AnyHedge contracts",
    "version": "0.8.2",
    "project_urls": {
        "Bug Tracker": "https://gitlab.com/unauth/py-anyhedge/issues",
        "Homepage": "https://gitlab.com/unauth/py-anyhedge"
    },
    "split_keywords": [
        "bitcoincash",
        " bch",
        " anyhedge",
        " utxo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "82b4bab36e7131878d8d57a4e45851d693d5f80d4dbb997f5ef3af408ddba893",
                "md5": "1b97b47ae889743a1c6d08dd040ab432",
                "sha256": "8fdb09882d99c61fe8a6f5dea72487e1adcf96656064100a2b922dbc7f76ad2d"
            },
            "downloads": -1,
            "filename": "anyhedge-0.8.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1b97b47ae889743a1c6d08dd040ab432",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 29514,
            "upload_time": "2024-03-24T06:27:10",
            "upload_time_iso_8601": "2024-03-24T06:27:10.743528Z",
            "url": "https://files.pythonhosted.org/packages/82/b4/bab36e7131878d8d57a4e45851d693d5f80d4dbb997f5ef3af408ddba893/anyhedge-0.8.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84bf7efdcf223e7377f2a401608cf76424d0edbad276a71d050745f48da36d53",
                "md5": "bb2af82a390039fe437f1a15b70ef8b0",
                "sha256": "4ee47d24b4e8dae5379eb8d237b8d4d17f88ab94823ee0fcca96ff5d1cb5961a"
            },
            "downloads": -1,
            "filename": "anyhedge-0.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "bb2af82a390039fe437f1a15b70ef8b0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 27777,
            "upload_time": "2024-03-24T06:27:12",
            "upload_time_iso_8601": "2024-03-24T06:27:12.993214Z",
            "url": "https://files.pythonhosted.org/packages/84/bf/7efdcf223e7377f2a401608cf76424d0edbad276a71d050745f48da36d53/anyhedge-0.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-24 06:27:12",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "unauth",
    "gitlab_project": "py-anyhedge",
    "lcname": "anyhedge"
}
        
Elapsed time: 0.22356s