1.1.2 • Published 2 days ago

@switchboard-xyz/on-demand v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 days ago

Switchboard Logo

Switchboard

Switchboard On-Demand

See the full documentation at Switchboard On-Demand Documentation

Switchboard On-Demand is designed to support high-fidelity financial systems. It allows users to specify how data from both on-chain and off-chain sources is ingested and transformed.

Unlike many pull-based blockchain oracles that manage data consensus on their own Layer 1 (L1) and then propagate it to users—giving oracle operators an advantage—Switchboard Oracles operate inside confidential runtimes. This setup ensures that oracles cannot observe the data they are collecting or the operations they perform, giving the end user a 'first-look' advantage when data is propagated.

Switchboard On-Demand is ideal for blockchain-based financial applications and services, offering a solution that is cost-effective, trustless, and user-friendly.

Key Features:

  • User-Created Oracles: In Switchboard, users have the flexibility to build their own oracles according to their specific needs.
  • Confidential Runtimes: Oracle operations are performed in a way that even the oracles themselves cannot observe, ensuring data integrity and user advantage.
  • High-Fidelity Financial Applications: Designed with financial applications in mind, Switchboard ensures high accuracy and reliability for transactions and data handling.

Getting Started

To start building your own on-demand oracle with Switchboard, you can refer to the oracle specification in our documentation.

Example Code Snippet:

function buildBinanceComJob(pair: String): OracleJob {
  const tasks = [
    OracleJob.Task.create({
      httpTask: OracleJob.HttpTask.create({
        url: `https://www.binance.com/api/v3/ticker/price?symbol=${pair}`,
      }),
    }),
    OracleJob.Task.create({
      jsonParseTask: OracleJob.JsonParseTask.create({ path: "$.price" }),
    }),
  ];
  return OracleJob.create({ tasks });
}

// ...
const [ix] = await pullFeed.fetchUpdateIx(program, {
  feed: feedKp.publicKey,
  queue,
  jobs: [buildBinanceComJob("BTCUSDT")],
  numSignatures: 1,
  maxVariance: 1, // don't respond if sources give > 1% variance
  minResponses: 1, // minimum job responses to resolve
  numSignatures: 3,
});
const tx = await InstructionUtils.asV0Tx(program, [ix]);
tx.sign([payer]);
await program.provider.connection.sendTransaction(tx, {
// preflightCommitment is REQUIRED to be processed or disabled
preflightCommitment: "processed",
});
1.1.2

2 days ago

1.1.1

4 days ago

1.1.0

4 days ago

1.0.57

5 days ago

1.0.56

6 days ago

1.0.54-alpha.3

7 days ago

1.0.55

7 days ago

1.0.54-alpha.2

8 days ago

1.0.54

12 days ago

1.0.53

12 days ago

1.0.53-beta.2

14 days ago

1.0.53-beta.3

14 days ago

1.0.53-beta.4

14 days ago

1.0.53-beta.5

14 days ago

1.0.53-beta.0

14 days ago

1.0.53-beta.1

14 days ago

1.0.51

20 days ago

1.0.52

20 days ago

1.0.50

22 days ago

1.0.48

23 days ago

1.0.49

23 days ago

1.0.44

24 days ago

1.0.43

24 days ago

1.0.42

24 days ago

1.0.47

24 days ago

1.0.46

24 days ago

1.0.45

24 days ago

1.0.37

26 days ago

1.0.36

26 days ago

1.0.39

26 days ago

1.0.38

26 days ago

1.0.40

26 days ago

1.0.41

25 days ago

1.0.29

29 days ago

1.0.28

29 days ago

1.0.27

29 days ago

1.0.33

29 days ago

1.0.32

29 days ago

1.0.31

29 days ago

1.0.30

29 days ago

1.0.35

28 days ago

1.0.34

29 days ago

1.0.26

1 month ago

1.0.25

1 month ago

1.0.24

1 month ago

1.0.23

1 month ago

1.0.22

1 month ago

1.0.21

1 month ago

1.0.19

1 month ago

1.0.18

1 month ago

1.0.17

1 month ago

1.0.20

1 month ago

1.0.16

1 month ago

1.0.15

2 months ago

1.0.14

2 months ago

1.0.11

2 months ago

1.0.10

2 months ago

1.0.13

2 months ago

1.0.12

2 months ago

1.0.9

2 months ago

1.0.8

2 months ago

1.0.7

2 months ago

1.0.5

2 months ago

1.0.4

2 months ago

1.0.2

2 months ago

1.0.3

2 months ago

1.0.2-alpha.0

2 months ago

1.0.1-alpha.9

2 months ago

1.0.1-alpha.8

2 months ago

1.0.1-alpha.7

2 months ago

1.0.1-alpha.10

2 months ago

1.0.1-alpha.2

2 months ago

1.0.1-alpha.6

2 months ago

1.0.1-alpha.5

2 months ago

1.0.1-alpha.4

2 months ago

1.0.1-alpha.3

2 months ago

1.0.1-alpha.1

2 months ago

1.0.1

2 months ago

1.0.1-alpha.0

2 months ago

1.0.0-alpha

2 months ago

1.0.0

2 months ago