Metadata-Version: 2.5
Name: hypercall-rfq-example
Version: 0.1.0
Summary: Demo helpers for the Hypercall RFQ v2 maker tutorial: EIP-712 signing, read grants, quoting, executions.
Project-URL: Homepage, https://github.com/hypercall-public/hypercall-rfq-example
Project-URL: Tutorial, https://blog.hypercall.xyz/build-an-rfq-v2-maker/
Project-URL: Documentation, https://docs.hypercall.xyz/docs/trading/over-api/rfq-v2
Author: Hypercall
License: MIT
License-File: LICENSE
Keywords: eip712,hypercall,hyperliquid,market-making,options,rfq
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: eth-account>=0.13
Requires-Dist: httpx>=0.27
Requires-Dist: websockets>=13
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.24; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# hypercall-rfq-example

Demo helpers and the demo maker (`maker.py`) for the Hypercall tutorial
[Build an RFQ V2 Maker](https://blog.hypercall.xyz/build-an-rfq-v2-maker/). They cover
read grants, the `rfq_v2` stream with change-feed replay, signed firm quotes,
declines, withdrawals, the cancel-schedule heartbeat, the executions stream,
the provider read, and perp hedge orders through Hypercall.

This is teaching code, kept short enough to read in one sitting. It is not a
supported SDK. For production integrations use the Rust client
(`hypercall-client`) or sign the documented EIP-712 messages yourself.

Needs Python 3.11 or newer (the maker uses `asyncio.TaskGroup`).

```bash
pip install hypercall-rfq-example
curl -O https://raw.githubusercontent.com/hypercall-public/hypercall-rfq-example/main/maker.py
export HC_ACCOUNT=0xYourAccount HC_SIGNER_KEY=0xApiWalletKey
python maker.py --dry-run
```

`--dry-run` prices and logs RFQs without posting quotes, declines, withdrawals
or hedges. Without it the maker posts firm, executable quotes.

On SIGINT or SIGTERM the maker withdraws every open quote and clears its
cancel schedule before it exits. A `kill -9` skips that; the 30-second
dead-man switch then withdraws the quotes instead.

The perp hedge only works for a portfolio margin Account contract with an
on-chain API wallet as the signer. See step 7 of the tutorial for the full
list; with a plain wallet as `HC_ACCOUNT`, hedge orders fail with
`400 unknown_account`.

## Tests

```bash
pip install -e '.[test]' && pytest
```

`tests/test_signing_parity.py` signs golden vectors generated by the Rust
signer and must match them byte for byte.

## License

MIT
