GET v0/rate
Get the current exchange rate of TIA to t.tia
Fetches the real-time exchange rate for micro TIA on the celestia block chain to our LST t.tia. It represents the total utia staked / total issued t.tia tokens. It is used in our LST issuance and redemption. (eg. amount of tia staked / exchange_rate = t.tia issued)
Request
Copied!
curl \
-H 'Authorization: Bearer <YOUR API KEY>' \
'https://t.tech/v0/rate'package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "https://t.tech/v0/rate"
apiKey := "Your API Key" // Replace with your actual token
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println("Status:", resp.Status)
fmt.Println("Response:", string(body))
}// Cargo.toml dependencies:
// [dependencies]
// reqwest = { version = "0.12" }
// tokio = { version = "1.46", features = ["macros", "rt-multi-thread"] }
use reqwest::{Client, header};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let url = "https://t.tech/v0/rate";
let api_key = "Your API Key"; // Replace with your actual token
let res = client
.get(url)
.bearer_auth(api_key)
.send()
.await?;
let status = res.status();
let body = res.text().await?;
println!("Status: {}", status);
println!("Response: {}", body);
Ok(())
}Query Parameters
networkstringoptional
The LST network from which you want the rate. Can be either mainnet or testnet. Defaults to
mainnet if no value is specified.
Response
JSON object
exchangeRate — stringThe current exchange rate of micro TIA to t.tia.
Example Response
Copied!
{
"exchangeRate": "0.9"
}