Skip to content
PlutusShield
Live on Cardano Preview testnet

Embed a cover quote

A DEX, lender or vault can show its users what protecting their position would cost, right next to the deposit button. The widget prices cover with the same quote engine as /cover and hands the user to PlutusShield to buy it from their own wallet.

← Back to site
DocsEmbed a cover quote

Snippet builder#

Pick the cover your users would want, copy the iframe, and paste it into your page. The preview on the right is the real widget served from /embed/quote/.

Paste this where the widget should appear
<iframe src="https://kshot3000.github.io/PlutusShield/embed/quote/?p=exploit&amp;a=250" title="PlutusShield Smart-contract exploit cover quote" width="360" height="440" style="border:0;border-radius:16px;max-width:100%" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"></iframe>
Optional: auto-size the iframe
<script>addEventListener("message",function(e){if(!e.data||e.data.type!=="plutusshield:embed:resize")return;document.querySelectorAll('iframe[src*="/embed/quote/"]').forEach(function(f){if(f.contentWindow===e.source)f.style.height=Math.ceil(e.data.height)+"px"})});</script>
Live preview

URL params#

Every setting is a query param on https://kshot3000.github.io/PlutusShield/embed/quote/. Defaults are left out of the snippet. A bad value never breaks the widget: it falls back to the default (a term outside the product's range is clamped into it) and the widget lists what it ignored.

Embed query params
ParamValuesDefault
pdepeg or exploit (SLA cover has no live pool, so it is refused)depeg
cADA or USDC: the tranche that prices and would pay the policyADA
aCover amount, above 0 and at most 1,000,000; the pool's 10% single-policy and 90% utilization caps still apply100
dTerm in days: 14–365 for depeg, 30–365 for exploit90
tdark or lightdark
refYour partner tag (a-z, 0-9, dashes, up to 32), shown as “via ref” and carried into the plan labelnone

The widget's button opens /plan in a new tab with the same cover encoded as a plan share link, so the user lands on a priced plan with a Buy link for each policy.

Auto-size#

The widget posts its content height to the parent page as a plutusshield:embed:resize message whenever it changes. The optional script in the builder sets each PlutusShield iframe's height from that message and only trusts messages from the iframe they claim to size.

message
{ "type": "plutusshield:embed:resize", "height": 412 }

From the SDK#

Build the same snippet, or price the widget's cover yourself, from TypeScript:

@plutusshield/sdk
import { embedSnippet, embedQuote, decodeEmbedConfig } from "@plutusshield/sdk";

const cfg = { product: "exploit", currency: "USDC", amount: 250, days: 90, theme: "light", ref: "my-dex" } as const;
const html = embedSnippet(cfg, { siteRoot: "https://kshot3000.github.io/PlutusShield" });

// Same quote() as /cover; planQuery rebuilds the cover on /plan.
const { quote, planQuery } = embedQuote(cfg, { capital: 2_000, activeCover: 50 });

What it never does#

  • It never connects or asks for a wallet, and never builds or signs a transaction. Buying happens on PlutusShield, from the user's own CIP-30 wallet.
  • It reads no cookies or storage from your page, and the snippet sends only your origin as the referrer.
  • Prices come from the Preview pool snapshot baked into each site build, the same one /plan uses, so a live quote on /cover can differ slightly if the pool moved since.