> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iris.credit/llms.txt
> Use this file to discover all available pages before exploring further.

# Solver Signing

> Produce the signatures an RFQ quote response carries — one helper for the per-quote hot path, one for the one-time approvals.

A winning [RFQ](/rfq/overview) response carries the solver's EIP-712 signature over the onchain `Quote` — and, depending on how the bond is funded, a Permit2 payload authorising the bond pull. The solver helpers are standalone functions taking a viem `WalletClient` directly: a solver bot signs quotes and manages allowances but never builds taker transactions, so it does not need the `client.iris` extension.

## Bond funding modes

`Iris.take` pulls the bond from the solver directly, funded in one of two modes:

| Mode                             | One-time setup                                                | Per quote                                                          |
| -------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------ |
| **Standing allowance** (default) | An ERC-20 approval to the Iris core, consumed take after take | Nothing — only the quote signature                                 |
| **Permit2** (`usePermit2: true`) | An ERC-20 approval to the Permit2 contract                    | A signed `solverPermit2` payload, submitted in-bundle by the taker |

<Warning>
  Permit2 nonces for `(solver, debtToken, Iris)` are sequential, so concurrent outstanding quotes race — only the first take can consume its permit. Solvers quoting at volume should prefer the standing-allowance mode and skip the payload entirely.
</Warning>

## One-time setup

`getSolverRequirements` resolves the approvals the chosen funding mode needs — returned as ready-to-send transactions, skipped when already in place:

```typescript theme={null}
import { getSolverRequirements } from "@iris-credit/iris-sdk";

const requirements = await getSolverRequirements(client, {
  chainId: 1,
  solver,
  debtToken,
  bond: maxQuoteSize,
  usePermit2: true,
});

for (const tx of requirements) await client.sendTransaction(tx);
```

Requirements cover allowances only: gate quoting on the solver's debt-token balance separately, and re-check as takes consume it.

## The per-quote hot path

`signResponse` signs the quote and — in the Permit2 mode — the bond funding payload in one call: everything an RFQ webhook response carries.

```typescript theme={null}
import { QUOTE_TTL, randomNonce } from "@iris-credit/core-sdk";
import { Time } from "@iris-credit/iris-ts";
import { signResponse } from "@iris-credit/iris-sdk";

const quote = { ...terms, deadline: Time.timestamp() + QUOTE_TTL, nonce: randomNonce() };

const { quoteSignature, solverPermit2 } = await signResponse(client, {
  chainId: 1,
  quote,
  usePermit2: true,
});

// Respond to the RFQ webhook with { ...quote fields, signature: quoteSignature, solverPermit2 }.
```

`signResponse` derives the Permit2 payload from the quote itself (`solver`, `debtToken`, `bond`), so it can never mismatch the quote it accompanies — and scopes the payload's signature deadline to `quote.deadline`, so an unfilled quote's permit becomes unsubmittable once the quote dies.

## Granular control

`signQuote` signs a quote verbatim as the solver; `signSolverPermit2` signs just the per-quote Permit2 payload. To hand-roll the payloads instead, build the typed data with `getQuoteTypedData` and `getPermit2PermitTypedData` from `@iris-credit/core-sdk` — the [RFQ guide](/rfq/running-a-solver/get-started) documents the exact field mapping either way.

## Next

<Columns cols={2}>
  <Card title="Running a Solver" icon="plug" href="/rfq/running-a-solver/get-started">
    Register an endpoint, answer a quote request, and respond within budget.
  </Card>

  <Card title="Validation" icon="shield" href="/rfq/running-a-solver/validation">
    Every check your signed quote must pass, in order.
  </Card>
</Columns>
