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

# Services around the chain

Nothing off-chain in Ethosis holds power over the protocol. Each service is either open source and runnable by anyone, or has no authority at all; in most cases both. The contracts remain the only source of truth, and the services simply make that truth convenient to use.

## The relayer

The relayer publishes the open book: every signed lend offer and borrow request that has not yet been originated.

| Aspect    | Detail                                                                                                                                         |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| Shape     | A stateless service exposing REST and WebSocket                                                                                                |
| Holds     | Signed offers and borrow requests                                                                                                              |
| Checks    | Signature, expiry, nonce state, the maker's balance and allowance (or vault balance), eligibility, and that term and tokens are compatible     |
| Offers    | Views filtered by token, tier, term, APR and LTV; a suggested syndicate for any request                                                        |
| Power     | None whatsoever. Each offer is verified again on-chain at origination.                                                                         |
| Operators | Ethosis Labs runs an instance; anyone else may run their own. Because the book is nothing more than signed messages, it can always be rebuilt. |

### Endpoints

```
POST /v1/offers                 submit a signed offer
DELETE /v1/offers/:hash         soft-delete (the on-chain nonce cancel is authoritative)
GET  /v1/offers?token=&tier=&term=&maxApr=&minLtv=
POST /v1/requests               submit a borrow request
GET  /v1/requests/:id/matches   proposed syndicate for a request
GET  /v1/book/export            full dump of live offers and requests
WS   /v1/stream                 live offer and request updates
```

`export` exists as a standing transparency guarantee: anyone may pull the entire book at any moment and mirror it.

## The indexer

The indexer rebuilds protocol state from events. It runs on Ponder (TypeScript, self-hosted) or on Envio HyperIndex, reading chain 4663, and it:

* supplies the loan explorer, the risk page and the borrower and lender dashboards;
* acts as the source of truth for the keeper bots;
* keeps a mirror of the relayer's book, so the order book outlives any one relayer going down;
* publishes a GraphQL endpoint anyone can query.

## Keepers

The keepers are open-source bots. Anyone can run them, and where liquidation fees apply they are paid for doing so.

| Bot                     | Fires when                                                                   | Does                                                          |
| ----------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------- |
| Margin alert            | A loan's HF drops below 1.10                                                 | Notifies the borrower on their configured channels            |
| Auction kick-off        | HF drops below 1.00 or the loan is Defaulted, and no sequencer grace applies | Calls `startAuction` and collects the keeper share            |
| Refinance acceptor      | A refinance auction's rate reaches a lender's limit                          | Submits that lender's pre-signed acceptance                   |
| Idle-capital rebalancer | Vault liquidity or a lender's preference changes                             | Deposits or withdraws through the adapter                     |
| Oracle watch            | A move cap is hit, a pause flag is set, or a price goes stale                | Surfaces the market pause to the front-end and alert channels |

## KYC

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

1. runs identity, sanctions and residency checks;
2. issues an EAS attestation for the appropriate role to the user's wallet;
3. renews or revokes that attestation whenever the user is re-screened.

No personal data reaches the chain. An attestation carries the role, the jurisdiction class and an expiry, and nothing more. The [Eligibility](/architecture/eligibility.md) page describes how it is consumed.

## The front-end

* Built on Next.js and viem; served from `/platform` on ethosis.org.
* Privy provides sign-in and embedded wallets on Robinhood Chain, and lets users sign offers and requests (EIP-712) without paying gas.
* Supabase holds the shared order book and loan registry, with row-level security tied to the Privy user.
* Screens: overview, borrow, lend (the order book plus offer management), positions, explorer, settings.

The front-end keeps no keys and carries no authority. Everything it displays can be checked against the indexer or against the chain itself. Implementation details are on the [Platform](/architecture/platform.md) page.

## Alerts

Through the keeper service a borrower can register channels for alerts: email, push via the wallet, or a webhook. Alerts go out for an HF warning, an approaching maturity, progress in a refinance auction, a market pause, and any parameter change that touches 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.ethosis.org/architecture/off-chain-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.
