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

# Developers

Endpoints, contracts and tools for building on Libre — including an MCP server that exposes the whole protocol to AI agents.

Libre is an [Antelope](https://antelope.io) (formerly EOSIO) chain. Any Antelope tooling works: WharfKit, eosjs, cleos, pyntelope. Accounts use standard Antelope key pairs, and state is read with `POST /v1/chain/get_table_rows`.

## Endpoints

|                              | Mainnet                                      | Testnet                                                  |
| ---------------------------- | -------------------------------------------- | -------------------------------------------------------- |
| Chain API + Hyperion history | `https://api.libre.cryptobloks.io`           | `https://api.testnet.libre.cryptobloks.io`               |
| Alternate API                | `https://lb.libre.org`                       | `https://testnet.libre.org`                              |
| Explorer                     | [libreblocks.io](https://www.libreblocks.io) | [testnet.libreblocks.io](https://testnet.libreblocks.io) |

Mainnet chain id: `38b1d7815474d0c60683ecbea321d723e83f5da6ae5f1c1f9fecc69d9ba96465`\
Testnet chain id: `b64646740308df2ee06c6b72f34c0f7fa066d940e831f752db2006fcc2b78dee`

## Contracts

| Contract                          | What it does                                        |
| --------------------------------- | --------------------------------------------------- |
| `loan`                            | Lending pools, vaults, borrowing, liquidation       |
| `oracle`                          | BTC/USD price — averaged across independent feeders |
| `dex.libre`                       | On-chain orderbook DEX                              |
| `usdt.libre`                      | USDT token (8 dp)                                   |
| `btc.libre`                       | BTC token (8 dp)                                    |
| `tp.libre`                        | TPF lending-pool shares (8 dp)                      |
| `cbtc.libre`                      | Vault collateral (8 dp)                             |
| `eosio.token`                     | LIBRE (4 dp)                                        |
| `v.libre` / `x.libre` / `t.libre` | Bitcoin vault, wrapped BTC, and USDT bridges        |

Useful tables: `poolstats`, `poolratecfg`, `globalparams` and `loanqueue` on `loan`; `aggfeeds` and `feeders` on `oracle`; `pairs2`, `orderbook2` and `history2` on `dex.libre`.

## The quickest path: the MCP server

[`mcp.libre.org`](https://mcp.libre.org) exposes every read and transaction-composing operation as a typed tool, over MCP or plain HTTP. It saves you hand-building table queries and transfer memos, and it holds no keys.

→ [MCP server](/libre-docs/for-developers/overview/mcp-server.md)

## The BTC price

Take it from the `oracle` contract's `aggfeeds` table — the average of a round of at least three independent feeders agreeing within 10%, and the exact price the `loan` contract uses for LTV and liquidation. It is invalid past five minutes, and the contract refuses to act on a stale one.

Do not substitute an exchange price for collateral math. External feeds that appear elsewhere in Libre's infrastructure are reference prices, not the chain's price.

→ [How the oracle works](/libre-docs/understanding-the-platform/mechanics/price-oracle.md)

## Acting on the chain

Most protocol actions are triggered by **sending a token transfer with a structured memo**, rather than by calling a named action:

* Lend: `usdt.libre::transfer` to `loan`, memo `pool:6`
* Redeem: `tp.libre::transfer` to `loan`, memo `pool:6`
* Repay: `usdt.libre::transfer` to `loan`, memo `payback:<account>`
* Place a DEX order: transfer to `dex.libre` with memo `buy:<baseAsset>:<priceAsset>`

Vault and loan operations are ordinary actions: `loan::createvault`, `loan::genaddr`, `loan::borrowvar`, `loan::withdraw`.

The MCP server composes all of these for you, unsigned, if you'd rather not build memos by hand.

## Writing contracts

Libre runs standard Antelope C++ contracts built with the Antelope CDT — nothing Libre-specific about the toolchain.

* [Building smart contracts](/libre-docs/legacy-documentation/legacy-docs/the-libre-platform/building-on-libre/building-smart-contracts-on-libre.md)
* [Developer tools](/libre-docs/legacy-documentation/legacy-docs/the-libre-platform/building-on-libre/libre-developer-tools.md)
* [Testnet setup and test tokens](/libre-docs/legacy-documentation/legacy-docs/the-libre-platform/building-on-libre/libre-testnet.md)
* [Running a node](/libre-docs/legacy-documentation/legacy-docs/the-libre-platform/run-a-libre-node.md)

## Reference

* [Core constants](/libre-docs/advanced-features/technical-details/libre-core-constants.md)
* [Deployed contract versions](/libre-docs/advanced-features/technical-details/deployed-smart-contract-versions.md)
* [Verifying code updates](/libre-docs/advanced-features/technical-details/verifying-code-updates.md)
* Agent-readable summary: [defi.libre.org/llms.txt](https://defi.libre.org/llms.txt)
