Product Documentation
  • 👋Welcome to K3 Labs
  • Getting Started
    • Quick Start Guide
  • Automate
    • How to create a Workflow
    • Design Page: Key Sections
    • Trigger Set Up
      • Scheduled / Manual Trigger
      • Smart Contract-based Trigger
        • Token Smart Contracts Trigger Examples
        • Swap/Staking Smart Contracts Examples
        • NFT Collection Smart Contracts Examples
      • Wallet event-based
    • Functions Overview
      • Details on Read functions datapoints
      • Transform Function Details
        • Transform Custom Formula
      • JSON Data Preview
      • Custom Inputs
    • What are Actions?
  • Deploy
    • Deploy Page
    • Project Creation
  • Integrations
    • Coinbase
    • Slack
    • Telegram
    • Cubist Wallet
    • Safe Wallet
    • Hyperliquid
  • Stellar Blockchain
    • Deploying & Writing to a Stellar Smart Contract (Oracle Example)
  • Tech Documentation
    • K3 Framework
      • Abstract
      • K3 Consensus
    • Networks & Usage
    • K3 Wasm
      • K3 Wasm Rust SDK
      • K3 Wasm Internal Specifications
    • Operator onboarding
Powered by GitBook
On this page
  1. Stellar Blockchain

Deploying & Writing to a Stellar Smart Contract (Oracle Example)

PreviousStellar BlockchainNextK3 Framework

Last updated 13 days ago

With K3 Labs, you can deploy a Stellar smart contract from GitHub and create workflows to write data to it, like updating price feeds for oracles. This guide walks you through the entire process.


1. Deploy a Stellar Smart Contract

Step 1: Open Deploy Page

  • Go to Deploy > Deploy Stellar Contract.

Step 2: Fill in Deployment Details

  • GitHub Repository URL: Paste your smart contract repo. Example: https://github.com/k3-labs/stellar-data-contract (This example creates a contract to store and update data like prices.)

  • Wallet: Select your Stellar wallet to pay for gas.

  • Network: By defaul Mainnet is selected. You can opt-in for Testnet using a checkmark below.

Step 3: Deploy

  • Click Deploy.

  • After a few seconds, you’ll receive a confirmation message with your Smart Contract Address.


2. Create a Workflow to Update Oracle Data

Now, let’s create an automation to periodically update this contract with BTC prices.

Example Workflow:

Step
Function
Setup

1. Trigger

Schedule

Run every 1 Hour

2. Market Data

Read BTC Price

Source: Market Data API or eOracle contract

3. Write to Smart Contract

- Blockchain: Stellar - Contract Address: (Your Deployed Contract Address) - Method: Write - Value: Use BTC price from Step 2

4. Alerts

Email

Send yourself a confirmation with price and transaction hash

See an example of the Write to Smart Contract set up below.


3. Visual Example:


4. Notes:

  • Your Stellar wallet must have enough XLM to cover transaction fees.

  • This example uses a simple Write method. You can adapt it for other data types or use cases.

  • Works with both Mainnet and Testnet.


Benefits:

✅ Deploy & manage custom Stellar contracts in minutes ✅ Automate data updates like prices, indexes, and metrics ✅ Secure wallet integration & gas management via Cubist ✅ Scalable for DeFi, Oracles, and Data Publishing

You can create a Stellar wallet using our Cubist integration if needed. See for more details.

Cubist integration page