CRXGuardian

Quick Start

Run the guardian flow in Test the same day. The portal and the SDK read the same proposals.

  1. Connect a wallet in Test mode

    Switch to Test and connect the wallet. Join Test with the invite code CRX sent your firm.

  2. Install the SDK

    pip install "git+https://github.com/crxfoundation/crx-python@v0.5.2"
  3. 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, pass account= in place of key=.

    import os
    from crx import Guardian
    
    g = Guardian(key=os.environ["GUARDIAN_KEY"], test=True)
  4. 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)
  5. 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)
  6. 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.

Quick Start · CRX Guardian