# Stellar Blockchain

### Stellar Blockchain Integration

K3 Labs now fully supports the **Stellar blockchain**, including **Soroban smart contracts**, across both **mainnet and testnet**, enabling users to build advanced no-code automations using real-time events, smart contracts, and wallet interactions.

***

### Supported Functions

K3 supports Stellar across four major function types: **Triggers**, **Read**, **Write**, and **Wallet Integration**.

***

## ⚡ Triggers

### **1. Smart Contract Events**

Monitor **on-chain events** emitted by Soroban smart contracts.

* Blockchain: Stellar Mainnet or Testnet
* Contract to try:\
  `CAS3FL6TLZKDGGISSDBWGGPTX3NRR4DYTZD7Y0D3HMY06LTJUVGVREAM`
* Example event types supported:\
  `mint`, `transfer`, `burn`, `approve`, `set_admin`
* Steps:
  1. Select "Trigger: Smart Contract"
  2. Choose Stellar Mainnet
  3. Paste the contract address above
  4. Choose the event type you wish to monitor

**Example Use Case:**\
Monitor a token for `mint` events and send an alert whenever new tokens are issued.

<div align="left"><figure><img src="/files/N4MQ8wpnSA2VMZrMVkwb" alt="" width="355"><figcaption></figcaption></figure></div>

***

### **2. Wallet Events**

Track **all on-chain activity** related to a Stellar wallet.

* Blockchain: Stellar Mainnet or Testnet
* Example Wallet:\
  `GBKUE3CEBSN5TJWQIJIJDUSRYEJGICSTE62KQIB24KLIU42GWGB32VNT`
* Steps:
  1. Select "Trigger: Wallet Events"
  2. Choose Stellar Mainnet
  3. Enter the wallet address above
  4. Choose either:
     * All activity
     * Sent
     * Received

You can retrieve:

* `from` / `to` wallet address
* `token` transferred
* `amount`
* `transaction hash`

**Example Use Case:**\
Detect incoming airdrops or payments, and trigger Telegram/email notifications.

<div align="left"><figure><img src="/files/kkMughAXJ0F90ZnNINYM" alt="" width="356"><figcaption></figcaption></figure></div>

***

## 🔎 Read Functions

### **3. Read Smart Contract**

Fetch method outputs directly from Soroban contracts.

* Blockchain: Stellar Mainnet
* Contract to try:\
  `CAS3FL6TLZKDGGISSDBWGGPTX3NRR4DYTZD7Y0D3HMY06LTJUVGVREAM`
* Supported methods: `balance`, `allowance`
* Steps:
  1. Select "Read: Smart Contract"
  2. Choose Stellar
  3. Add the contract address above
  4. Select method and input required params

**Use Case:**\
Pull on-chain balances from a lending or token contract.

<div align="left"><figure><img src="/files/n4TJe4UyJTbkq17ThF0k" alt="" width="358"><figcaption></figcaption></figure></div>

***

### **4. Read Wallet Balance**

Check a wallet’s portfolio and value.

* Wallet:\
  `GBKUE3CEBSN5TJWQIJIJDUSRYEJGICSTE62KQIB24KLIU42GWGB32VNT`
* Steps:
  1. Select "Read: Wallet Balance"
  2. Choose Stellar Mainnet
  3. Paste wallet address

Returns:

* Total USD value of wallet
* List of token holdings and balances

**Use Case:**\
Track real-time portfolio distribution and trigger alerts if rebalancing is needed.

<figure><img src="/files/rRrb8HAhcvpiahYVgmq2" alt=""><figcaption></figcaption></figure>

***

## 📝 Write Functions

### **5. Write to Smart Contract**

Interact with Stellar smart contracts (Soroban) via workflow.

* Blockchain: Stellar Mainnet
* Contract: **Fixed XLM-USDC**\
  `CDVQVKOY2YSXS2IC7KN6MNASSHPAO7UN2UR2ON4OI2SKMFJNVAMDX6DP`
* Supported methods:
  * `set_reserve`
  * `get_positions`
  * `submit`
  * `claim`
  * `new_liquidation_auction`
  * `new_interest_auction`
  * and more

Steps:

1. Choose “Write to Smart Contract”
2. Select Stellar Mainnet
3. Add contract address
4. Pick method (e.g. `submit` or `claim`)
5. Add parameters if required

**Use Case:**\
Automate interactions with Blend Capital contracts to submit, claim, or participate in auctions.

<div align="left"><figure><img src="/files/T7EdpQOqXWKM4fUOclt3" alt="" width="353"><figcaption></figcaption></figure></div>

***

### **6. Stellar Wallet via Cubist**

Use **Cubist** to create secure wallets for Stellar. These wallets are used to **sign and pay for gas** for any on-chain interactions (writes).

* Create wallet in the **Cubist integration panel**
* Once created, it’s available for use in Write to Smart Contract

Cubist benefits:

* Hardware-backed key security
* Seamless gas management
* No external signing or extensions needed

***

### 7. Token Transfers

Users can dend tokens from a Stellar wallet to another address as part of your workflow.

* **Blockchain:** Stellar Mainnet
* **Wallet:** Use a Stellar wallet created via the **Cubist** integration
* **Function:** Token Transfer

**Steps:**

1. Add the **Token Transfer** function to your workflow
2. Choose Stellar as the blockchain
3. Select your Stellar wallet (Cubist-based)
4. Input:
   * Recipient wallet address
   * Token address or ticker (e.g. `XLM`)
   * Amount to transfer

**Use Cases:**

* Recurring payments (e.g. team salary disbursements)
* Conditional transfers based on workflow logic (e.g. only if balance > X)
* Treasury management or payment batching

You can easily combine this with:

* **Time-based triggers** (e.g. monthly)
* **Smart contract reads** (e.g. check positions before payout)
* **Conditional logic** (e.g. ensure wallet has minimum balance)

***

### Stellar Sample Workflows

#### 🔔 Airdrop Detection

Trigger on wallet → If token is `XYZ` → Notify user via Telegram.

#### 📊 Portfolio Check

Run every hour → Read wallet → Transform into % shares → Alert on deviation.

#### 🧠 Lending Protocol Automation

Trigger on Blend contract → Write: `claim` or `submit` → Notify if complete.

***

### Why Use Stellar on K3?

* Real-time automations using Soroban smart contracts
* Support for event-based or time-based triggers
* Simplified UI for complex contract reads/writes
* No need to manage your own keys — Cubist handles it
* Monitor wallets, trigger actions, and publish data — all no-code
* Secure wallet management with Cubist

###


---

# Agent Instructions: 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:

```
GET https://docs.k3-labs.com/introduction/stellar-blockchain.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
