← All Recipes
Bazantic // Recipe
Underwrite Counterparty
underwrite-counterparty
Decide whether to extend net terms to a counterparty agent without either side disclosing a balance. Prices the exposure at a Chainlink feed, derives the Line it implies from the subject's registered ladder, requests one confidential Survey at that Line, and returns the verdict with its derivation. Refuses on BELOW/INDETERMINATE and never probes a lower rung.
Recipe inputs
Complete fields before a run.
Chainlink pair the exposure is denominated in, e.g. ETH-USD (hyphen, not slash).
Free text, e.g. net-30. Reported, not evaluated.
The exposure denominated in the pair's base asset, e.g. 60 for 60 ETH.
The bytes32 subject identity of the agent being underwritten.
Also require k=3 Surveys spanning 24h at the derived threshold. Use for exposure you would be unhappy to lose.
Output example
Representative published output.
"Derivation: ETH/USD 4100.00 (round 18446744073709562345, 41s old, not stale). Exposure 60 ETH = $246,000. Lowest covering rung: lineId 1, observed_net_assets_usd >= $250,000. Survey 0x5d1c...e0a2 requested; Mark settled after 38s.\n\n```json\n{\"decision\":\"EXTEND\",\"verdict\":\"ABOVE\",\"exposureUsd\":246000,\"lineId\":1,\"thresholdUsd\":250000,\"surveyId\":\"0x5d1c...e0a2\",\"asOf\":1757000000,\"expiry\":1757000300,\"explorer\":\"https://sepolia.etherscan.io/tx/0x...\"}\n```\n\nIf the Mark is still pending after three polls:\n\n```json\n{\"decision\":\"PENDING\",\"surveyId\":\"0x5d1c...e0a2\",\"followUp\":\"call getMark with this surveyId in about a minute\"}\n```"