Deploying & Writing to a Stellar Smart Contract (Oracle Example)
Last updated
Last updated
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.
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.
Now, let’s create an automation to periodically update this contract with BTC prices.
Example Workflow:
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
Send yourself a confirmation with price and transaction hash
See an example of the Write to Smart Contract set up below.
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.
✅ 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.