Mercury just got a new look and features, V1 is out! Check out the announcement.

THE MERCURY ECOSYSEM V1 IS NOW LIVE

The Ultimate Gateway To The Stellar Network.

Cloud Infrastructure tailored for and hardwired to Stellar, with a focus on powering Soroban applications.
Header image

Choose Your Mode, and Build!

< or just use them all >

1// slightly stripped down or modified version of the impl for simplicity. Also, pardon the formatting.
2#[derive(DatabaseDerive, Clone)]
3#[with_name("curr_seq")]
4struct Sequence {
5    pub current: u32,
6}
7
8#[no_mangle]
9pub extern "C" fn on_close() {
10    let env = EnvClient::new();
11    let sequence = Sequence {
12        current: env.reader().ledger_sequence()
13    };
14    if let Some(last) = Sequence::read_to_rows(&env).iter().find(|x| {
15        x.current == sequence.current - 1
16    }) {
17        env.update().column_equal_to_xdr("current", &last.current).execute(&sequence);
18    } else {
19        sequence.put(&env)
20    }
21}
22
23

Define your custom ingestion logic as well as your data structures on the database and let us take care of the rest. No need to run any infrastructure!

1// slightly stripped down or modified version of the impl for simplicity. Also, pardon the formatting.
2#[derive(Serialize, Deserialize)]
3pub struct ColorMintRequest {
4    source: String,
5    colors: Vec<ColorClient>,
6}
7#[no_mangle]
8pub extern "C" fn simulate_color_mint() {
9    let env = EnvClient::empty();
10    let request: ColorMintRequest = env.read_request_body();
11    let (source, source_addr) = /*source from request*/ ;
12    let function_name = Symbol::new(&env.soroban(), "colors_mine");
13    let mut colors = Map::new(&env.soroban());
14    for color in request.colors {
15        colors.set(color.color, color.amount);
16    }
17    let resp = env.simulate(
18        source, zephyr_sdk::soroban_sdk::xdr::HostFunction::InvokeContract(InvokeContractArgs {
19        contract_address: zephyr_sdk::soroban_sdk::xdr::ScAddress::Contract(Hash(CONTRACT_ADDRESS)),
20        function_name,
21        args: vec![env.to_scval(source_addr), env.to_scval(colors)].try_into().unwrap()})).unwrap();
22    env.conclude(resp)
23}

Write custom RPC functionalities using rust and the native soroban sdk as typesystem.

1// slightly stripped down or modified version of the impl for simplicity. Also, pardon the formatting.
2fn send_message(env: &EnvClient, source: ScVal, amount: ScVal) {
3    // get key from env + build body.
4    env.send_web_request(AgnosticRequest {
5        body: Some(body),
6        url: "https://discordapp.com/api/channels/1234475897092968459/messages".into(),
7        method: zephyr_sdk::Method::Post,
8        headers: vec![("Content-Type".into(), "application/json".into()),
9            ("Authorization".into(), format!("Bot {}", key))]})
10}
11#[no_mangle]
12pub extern "C" fn on_close() {
13    let env = EnvClient::new();
14    let contract_events: Vec<ContractEvent> = env.reader().soroban_events().into_iter()
15        .filter(|event| event.contract_id == Some(Hash(CONTRACT_ADDRESS))).collect();
16    for event in contract_events {
17        if Symbol::new(&env.soroban(), "deposit") == env.from_scval(&event.topics[0])
18          && 10_000_000_000 <= env.from_scval::<i128>(&event.data) {
19            env.log().debug("got deposit larger than 1000 XLM", None);
20            send_message(&env, event.topics[1].clone(), event.data)
21        }
22    }
23}

Build alerts and monitoring systems with access to latest ledger data, and perform web requests directly from the program's logic.

1// slightly stripped down or modified version of the impl for simplicity. Also, pardon the formatting.
2
3// make a subscription to a contract event with a certain first topic:
4
5curl -X POST \
6     -H "Content-Type: application/json" \
7     -H "Authorization: Bearer $JWT_TOKEN" \
8     -d '{
9          "contract_id": "CONTRACT_ID",
10          "topic1": "SOME_SCVAL_XDR",
11         }' \
12     https://api.mercurydata.app/event
13
14
15// make the request to the graphql API:
16
17curl -X POST https://api.mercurydata.app/graphql ...
18
19
20
21
22
23

For simpler use cases subscribe to the specific data you need and make them available for querying afterwards.

Discover
Leading teams building on Soroban are using Mercury, learn why.

Why Mercury

Real-Time, Fast, Reliable, and Cost-Efficient.

Mercury's cloud execution environment and subscriptions enable for fast, reliable and cost-efficient data access.

All In One.

Mercury is the final stop for developers working on Soroban: RPC (custom simulation, entry retrieval), and indexing solutions. All in a single, user-deployed program.

On The Cloud.

Everything runs on the cloud with a behavior similar to serverless functions, just type mercury-cli deploy. Furthermore, we have hardwired our VM to Soroban, allowing you to work within the same native environment you're writing contracts in.

Best Developer Experience.

With our expertise with Soroban, we've hardwired (literally) our VM to Soroban, allowing you to work within the same native environment and types you're writing contracts in. This is one of the most accessible way of working with data off-chain across the whole industry.
< Only on Mercury >

Introducing the ZephyrVM

A powerful WebAssembly virtual machine written in Rust and built purposefully to work with network data, databases, and to tackle all the challenges in working with raw network data.

Shape your Web3 API, just how you like it.

The ZephyrVM executes any WASM binary that gets deployed to our network. You can choose how you read your data, how to process it, and how to index it.

Top-notch developer experience.

Building an indexer is not easy, especially when dealing with lower level raw network data. Zephyr and associated tooling will make these tasks as easy as writing a contract.
Dashboard mockup

New Feature!   You can now manage your Zephyr program and its logs directly from the Mercury webapp.

Use Cases

On-Chain Applications

If you're building applications on Soroban, Mercury is the perfect place to interface with the network. It's simple, fast, fully-customizable and allows you to deal with every aspect of network interactions (indexing, entry retrieval, simulation) from a single place.

Automation and Strategy

Build real-time bots with low-level, real-time access to every ledger transition. This is the best place to get started building on-chain  strategies, with no latency.

Wallets and Explorers

If you're panning on operating on a subset of the network's users and aiming, Mercury can grant you on-chain information of all accounts and contracts + operations history for provided accounts.

For Soroban Pros, By Soroban Pros.

Mercury is being developed and maintained by XyclooLabs. We have extensive experience in working in the Stellar Network and are reputable members of its awesome community. It's our experience and knowledge of Stellar, more specifically Soroban and its VM that enable us to build a soroban-centered product with features and utility that greatly improve both performance and developer experience.