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.
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.txtusing 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%.
Metadata
Release files for anyhedge 4.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anyhedge-4.1.3.tar.gz | 30.1 kB | Without provenance | Details for anyhedge-4.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anyhedge-4.1.3-py3-none-any.whl | Python 3 | none | any | Details for anyhedge-4.1.3-py3-none-any.whl |
Total release size: 62.7 kB
Release files / anyhedge-4.1.3.tar.gz
| Download URL | anyhedge-4.1.3.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e01a7f6fd8ecf8c7457e699cbcdbe91241cd99e635fc315a4796bdb923c822d
|
|
BLAKE2b-256 checksum How to use checksums |
063edca3d6ccd6041a5854f60a819923c1e9c584a33e490c5c9984a2a7d92592
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.8
|
Release files / anyhedge-4.1.3-py3-none-any.whl
| Download URL | anyhedge-4.1.3-py3-none-any.whl |
|---|---|
| Size | 32.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f44bfef398ebc8251b3d51ca417b204636969684f7b6bd25d92330baff594ba3
|
|
BLAKE2b-256 checksum How to use checksums |
cf29d452a88379c998cd4458f71e315101a1bff2b465de40d4e0940b035b6296
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.8
|
Security for anyhedge 4.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.