> For the complete documentation index, see [llms.txt](https://docs.usegimbal.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usegimbal.app/architecture/services.md).

# Services off the chain

The relayer, indexer, keepers, KYC provider and platform that sit around the Gimbal contracts, each open to any operator and none holding authority over a loan.

Everything on this page can be switched off without a single loan changing state. That is the design. The contracts hold the truth and the funds; the services make the truth quick to read and quick to act on. Each is open source, runnable by anyone, or powerless, and in most cases all three. Instruments on the ground, not controls in the cockpit.

## The platform

* Next.js with viem, served under `/platform` at usegimbal.app.
* Privy handles login and provides each user an embedded wallet on Robinhood Chain; it also signs EIP-712 offers and requests, with no gas spent.
* Supabase keeps the shared order book and the loan registry. Row-level security is tied to the Privy user.
* Six screens: overview, borrow, lend, positions, explorer and settings. The lend screen shows the order book alongside the user's own offers.

No key lives in the platform and it can authorise nothing. Every figure it shows can be checked against the indexer, or directly against the chain. Implementation detail is on the [platform page](/architecture/platform.md).

## Relayer

The relayer's job is to publish the open book: each signed lend offer and each borrow request still waiting to become a loan.

|             |                                                                                                                                                        |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Shape       | Stateless, with REST and WebSocket interfaces                                                                                                          |
| Holds       | Signed lend offers and borrow requests                                                                                                                 |
| Checks      | Signature, expiry, nonce state, maker balance and allowance (or the parked balance in the vault), eligibility, and whether term and tokens fit         |
| Answers     | Views cut by tier, token, term, LTV and APR, and a proposed syndicate for any request                                                                  |
| Power       | None. The desk re-verifies every offer on-chain when the loan originates.                                                                              |
| Who runs it | Gimbal Labs operates one; anyone may operate another. Because the book is nothing but signed messages, it can be rebuilt from scratch whenever needed. |

The REST and WebSocket routes:

```
POST   /v1/offers                  submit a signed lend offer
DELETE /v1/offers/:hash            soft delete; the nonce cancel on-chain is what counts
GET    /v1/offers?token=&tier=&term=&maxApr=&minLtv=
POST   /v1/requests                submit a borrow request
GET    /v1/requests/:id/matches    suggested syndicate for one request
GET    /v1/book/export             every live offer and request in one dump
WS     /v1/stream                  push feed of offer and request changes
```

Export is a standing transparency commitment: anyone, at any moment, may pull the whole book and host a mirror.

## Indexer

State is rebuilt from events by the indexer, which runs on Ponder (self-hosted, TypeScript) or on Envio HyperIndex over chain 4663. Four jobs:

* it supplies the Explorer, Telemetry and both dashboards, borrower and lender;
* it is what the keeper bots treat as ground truth;
* it mirrors the relayer's book, so no single relayer going dark loses the order book;
* it exposes a GraphQL endpoint that accepts any query.

## Keepers

A keeper is an open-source bot. Anyone may run one, and where liquidation fees are paid, running one earns them.

| Bot                       | Watches for                                                                     | Then                                                       |
| ------------------------- | ------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| Margin alert              | A loan's health factor dropping under 1.10                                      | Notifies the borrower on the channels they configured      |
| Auction opener            | Health factor under 1.00, or a Defaulted loan, with no sequencer grace in force | Calls `startAuction` and collects the keeper share         |
| Rollover acceptor         | The rate in a rollover auction reaching a lender's limit                        | Submits that lender's pre-signed acceptance                |
| Parked-capital rebalancer | A change in vault liquidity, or a lender changing preference                    | Deposits to or withdraws from the vault via the adapter    |
| Oracle watch              | A tripped move cap, a raised pause flag, or a price going stale                 | Relays the pause to the platform and to the alert channels |

## KYC provider

Screening is done by a third party, in the Sumsub or Persona class, with a zero-knowledge option on offer. The provider:

1. checks identity, sanctions and residency;
2. writes an EAS attestation to the wallet, scoped to the role the user qualifies for;
3. renews or revokes it whenever the user is screened again.

The attestation carries a role, a jurisdiction class and an expiry, and nothing beyond those three. No personal data reaches the chain. The contract side of this is on the [Eligibility page](/architecture/eligibility.md).

## Alerts

A borrower registers channels with the keeper service, choosing email, wallet push, a webhook, or several. Alerts go out for a health factor warning, an approaching maturity, movement in a rollover auction, any market pause, and every parameter change that touches one of the borrower's loans.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.usegimbal.app/architecture/services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
