Quick Start
Run the guardian flow in Test the same day. The portal and the SDK read the same proposals.
Connect a wallet in Test mode
Switch to Test and connect the wallet. Join Test with the invite code CRX sent your firm.
Install the SDK
pip install "git+https://github.com/crxfoundation/crx-python@v0.5.2"Open a guardian session
Set the key from a file your firm controls:
export GUARDIAN_KEY="$(cat guardian.key)". For a custody or hardware signer, passaccount=in place ofkey=.import os from crx import Guardian g = Guardian(key=os.environ["GUARDIAN_KEY"], test=True)Post a test proposal
Test only: a USD/BRL proposal 300 bp above the reference, with a 2-hour wait.
p = g.post_test_price("USD/BRL", off_bp=300)Read the waiting prices
for q in g.proposals(): print(q.pair, q.price, q.reference, q.diff_bp, q.seconds_left)A bot reads each new proposal once, every 30 seconds:
for q in g.watch(): print(q.pair, q.price, q.diff_bp)Cancel with a reason
The SDK prints the transaction. The proposal shows in History with the reason.
print(g.cancel(p, reason="300 bp above the reference"))
Live
Drop test=True and pass rpc_url= with an Ethereum RPC URL. Live cancel opens once CRX names your wallet. Adding a guardian takes 72 hours. Pause and desk holds stay with CRX.