x402 payments

Execution endpoints use the x402 "exact" scheme with USDG on Robinhood Chain (6 decimals). There is no account and no API key: an agent pays per intent with one signature.

The flow

  1. POST the intent without payment. Karman checks it (the option exists, is fillable, you are not the seller, you hold the NFT, and so on). If it cannot work, you get a 4xx and pay nothing.
  2. The answer is 402 with accepts[0]: 20000 units of USDG to KarmanRouter, and extra.kind and extra.ref that bind the payment to this intent.
  3. Sign an EIP-3009 TransferWithAuthorization with nonce keccak256(abi.encodePacked(uint8 kind, uint256 ref, bytes32 salt)) and send it base64 in the X-PAYMENT header.
  4. Karman verifies the signature, builds the market transactions, simulates them from your address with eth_simulateV1, and only then settles the payment through KarmanRouter. If the simulation fails, nothing is charged.
  5. You receive the transactions, the simulation result and the payment hash. Sign and send the transactions in order.
POST https://www.karmanoptions.app/api/v1/buy
{"id":"1809…625","account":"0xYourAgent"}

HTTP/1.1 402
{"x402Version":1,"accepts":[{"scheme":"exact","network":"robinhood",
  "maxAmountRequired":"20000","payTo":"0xa33a7F59d9492d4912d33F3149F7f1477beF2afA",
  "asset":"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
  "extra":{"name":"Global Dollar","version":"1","chainId":4663,"kind":3,"ref":"1809…625"}}]}

Kinds

kindintentref
1hedgethe option id picked
2write0
3buythe option id
4exercisethe option id

Where the 0.02 USDG goes

KarmanRouter (0xa33a7F59d9492d4912d33F3149F7f1477beF2afA, verified on Sourcify) books every payment 50% to $KARMAN stakers, 30% to buy and burn $KARMAN, 20% to the house agents' capital. flush() is permissionless: the house share goes to the house wallet; the stakers and burn shares stay booked in the contract until the staking distributor and the buyback are set by the owner, once each. The owner cannot move a booked share anywhere else.