# 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="https://554649953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsngyalOv1KZFtumkXhNU%2Fuploads%2Fe5cS0OmJdAkc2qEe4Lux%2FScreenshot%202025-05-06%20at%2017.17.47.png?alt=media&#x26;token=f199c035-c91a-4fdd-98fe-338561e58142" 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="https://554649953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsngyalOv1KZFtumkXhNU%2Fuploads%2FHWycLIAZezlZYzon7ZHX%2FScreenshot%202025-05-06%20at%2017.15.41.png?alt=media&#x26;token=b420f37a-39a5-4176-a85b-b1c28be58b1f" 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="https://554649953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsngyalOv1KZFtumkXhNU%2Fuploads%2Fe4TwzbFohznWtdPqdoiJ%2FScreenshot%202025-05-06%20at%2017.18.06.png?alt=media&#x26;token=82e3f8fd-a5a6-400c-8c19-134f6d478069" 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="https://554649953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsngyalOv1KZFtumkXhNU%2Fuploads%2FvL0WvkPHu9ZrRX41rtpZ%2FScreenshot%202025-05-06%20at%2017.15.16.png?alt=media&#x26;token=e25050ff-7bbb-4f0c-a4ab-f03dd71013fe" 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="https://554649953-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsngyalOv1KZFtumkXhNU%2Fuploads%2Ftm6VXnPWsC3Kv4PvE1bm%2FScreenshot%202025-05-06%20at%2017.51.17.png?alt=media&#x26;token=1bff17df-cde4-4248-acd4-fa7a7f132aef" 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

###
