[Oracle](https://oracle.tickerz.com/)

Signed and recountable today. The Solana feeds go live at deploy.

# $GIGS

Paid gigs over x402

Latest signed **None yet** Not signed yet

Updates **Daily** Not signed yet

Settleable **No** Display grade: sampled or cheap to move

Sources **None yet** Not signed yet

## On Solana

- **Feed account**: 94N6zW5gq142n6eoxzbX6xNDhTtAGn2LM2sVZ8sSf89FLive at deploy
- **Program**: 838cdWMpb2WeAT4stt7rgaBcwEcJh5ziS9P9RKLeTw7oSolana mainnet
- **Rule**: Version 1 [Rule JSON](https://oracle.tickerz.com/api/indices/gigs/rule)
- **Rule hash**: `9066d2731d99986d412a6df2db267b05aa3741530fb2e3f16020e56ccb5c70f7`

## Last 10 signed

[The index](https://oracle.tickerz.com/x/gigs)

This index is not signed yet.

## Read this feed

The feed account holds prints once the program is deployed. Until then, read the signed report: [/api/indices/gigs/report](https://oracle.tickerz.com/api/indices/gigs/report).

TypeScript

```
// $GIGS on Solana: the newest print in its feed account.
const FEED = "94N6zW5gq142n6eoxzbX6xNDhTtAGn2LM2sVZ8sSf89F";
const PROGRAM = "838cdWMpb2WeAT4stt7rgaBcwEcJh5ziS9P9RKLeTw7o";

const res = await fetch("https://api.mainnet-beta.solana.com", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "getAccountInfo",
    params: [FEED, { encoding: "base64", commitment: "finalized" }] }),
});
const { result } = await res.json();
if (result.value?.owner !== PROGRAM) throw new Error("not a Tickerz feed");

const d = Buffer.from(result.value.data[0], "base64").subarray(8); // after the 8 byte discriminator
const decimals = d[52], grade = d[54], head = d[55], count = d[56];
if (count === 0) throw new Error("no print yet");
const o = 72 + 72 * head; // prints[head], the newest
const print = {
  period_start: Number(d.readBigInt64LE(o)),       // UTC seconds
  value: d.readBigInt64LE(o + 8),                  // value / 10 ** decimals
  published_at: Number(d.readBigInt64LE(o + 16)),
  report_hash: d.subarray(o + 32, o + 64).toString("hex"),
  status: ["provisional", "final", "corrected"][d[o + 64]],
};
const settleable = grade === 1 && print.status !== "provisional";
```

Rust (Anchor)

```
use anchor_lang::prelude::*;

// $GIGS on Solana.
pub const TICKERZ_ORACLE: Pubkey = Pubkey::from_str_const("838cdWMpb2WeAT4stt7rgaBcwEcJh5ziS9P9RKLeTw7o");
pub const FEED: Pubkey = Pubkey::from_str_const("94N6zW5gq142n6eoxzbX6xNDhTtAGn2LM2sVZ8sSf89F");

#[derive(Accounts)]
pub struct ReadTickerz<'info> {
    /// CHECK: address and owner checked; layout at tickerz.com/methodology#the-solana-feed
    #[account(address = FEED, owner = TICKERZ_ORACLE)]
    pub feed: UncheckedAccount<'info>,
}

/// The newest print, refused unless a market may settle on it (grade 1, status 1 final or 2 corrected).
/// Returns (period_start, value, status); value / 10^decimals in the index's unit.
pub fn latest_settled(feed: &AccountInfo) -> Result<(i64, i64, u8)> {
    let data = feed.try_borrow_data()?;
    let d = &data[8..]; // after the 8 byte discriminator
    let (grade, head, count) = (d[54], d[55] as usize, d[56]);
    require!(count > 0, ErrorCode::AccountNotInitialized);
    let o = 72 + 72 * head; // prints[head]
    let at = |i: usize| i64::from_le_bytes(d[i..i + 8].try_into().unwrap());
    let (period_start, value, status) = (at(o), at(o + 8), d[o + 64]);
    require!(grade == 1 && status != 0, ErrorCode::ConstraintRaw);
    Ok((period_start, value, status))
}
```

Layout: [methodology](https://oracle.tickerz.com/methodology#the-solana-feed). Checking a report's signature: [the signer file](https://oracle.tickerz.com/.well-known/tickerz-signer.json).
