INTRODUCTION TO ZAP ORACLES

Introduction to Zap platform, contracts, bonding curve and tools

A decentralized platform to provide and consume tokenized data and services

Whether you are data providers (Oracles) looking for a simple way to provide your data, joining other data providers to provide a decentralized data feeds service or you are data consumers, developers, or users looking for a way to get data or engage with tokenized services in a simple, secured and decentralized way. Zap platform provides the tools you need.

Zap platform utilizes bonding curve mechanics*, as the pricing mechanism for providers (Oracles/Services). Oracles use bonding curve to set price structure for each of your data feed, this bonding curve will not only serve as pricing model to encourage early users; ensure price stability( in the case of flat bonding curve); but also as a way users can speculate your data feeds. More information about curation market can be found here

Zap Contracts

To achieve this goal, Zap contracts are created on Ethereum blockchain ( Mainnet and Kovan Testnet available) to facilitate Oracles/Service creation, token management , data queries and response, as well as subscription management. To learn more , check out our Zap Contracts section

Create your first Oracle

1. Registering Zap Oracle

When you create a Zap Oracle, its involved registering your custom information on Registry contract , information such as public key, title, and unlimited parameters you can set under params , your Ethereum address that you use to register will be your Oracle's owner address and your identity within data providers ecosystem.

After you successfully register your information with Zap Registry, time to create your first data Endpoint , to tell users you have particular data to provide. You can create as many Endpoints as you want

2. Create your first data Endpoint

A data Endpoint is one particular data service under a Zap Oracle, Oracles can provide unlimited number of Endpoints for different data they want to provide.

Endpoint consist of :

  • Name : description or title of data service you want to provide

  • Curve : an equation of the endpoint's data price, or Bonding Curve

  • Params : extra meta data about this endpoint

To create an Endpoint, you register that endpoint with Zap Registry contract with method initiateProviderEndpoint with all the information required, using your Oracle's address. Once initiated, the endpoint is visible to all users and you can start listening to Query or Subscription to provide data.

But wait, how does Queries or Subscription work ?, Lets break that down

3. Different way to provide data

Zap Oracles don't have to be limitted to one way of providing data, there are couple options provided by Zap Contracts for flexibility and better users experience:

For each use case, we have created template to help speeding up the process

  • On-chain Oracle:

    • Oracle that is an Ethereum contract that receive query from user and respond by ether emitting response event or calling user's contract callback method

  • Off-chain Oracle:

    • Endpoint that is NOT an Ethereum contract, this Oracle can listen to user's query using their own method, such as a server listening to query event from user and response automatically. Oracle can even choose to use Zap-term to watch and respond to query in real time manually. Responding can involve emitting events or calling user's callback method

  • Subscription Oracle:

    • Oracle that doesnt watch for queries but provide a subscription to a certain data for a period user wish to enact through bonding and subscribe to the endpoint.

Getting Data Feeds

Users dont have to be limited to one way to receive data either. Data consumers can be contracts that implement callback method to receive data from Oracles; applications that listen to response events emited from Oracles; or applications that use bond dots to receive data from encrypted communication with Oracles.

  • On-chain Users:

    • Zap Oracle users can be an Ethereum contract that request data from Zap Oracle, implement callback method to react to result received from Oracle.

  • Off-chain Users:

    • Zap Oracle Users can also be any off-chain users/applications that receive data from Oracle, example can be anything from trading bots to execute trades based on price response from Oracle, to an app that alert weather information receiving from Oracle. You can use Zap-term to query and receive response from Oracle manually

DOTS

Dots are currencies within Zap Oracles Ecosystem, Oracles define Endpoint bonding curve, to determine price in Zap Tokens of each dot on that curve. User can spend Zap tokens to bond to and Endpoint to receive dots. Dots are only existed within Zap contracts platform to facilitate Users-Oracles transactions. Dots cant be moved outside of the platform.

Users holding dots are not only incentivized to bring others to participate in the same data feed, but also to bring competing oracles into the marketplace as well, since the necessary bonding of ZAP will reduce liquidity, driving up the underlying value of all oracles on the network. Data providers are even incentivized to bring similar data providers onto the network, since oracles are more secure (and thus more profitable for the providers) when constructed from bundled data feeds from multiple providers.

Summary :

  • Dots can be used to query Oracle's Endpoint for data feed, 1 DOT = 1 QUERY

  • Dots can be used to start subscription service with an Endpoint 1 DOT = 1 BLOCK TIME

  • Dots can be used for speculating and profiting on accurate prediction of an Endpoint's bonding curve

Bond/Unbond Explained

Zap Contract Bondage helps Users and Oracles establish their data feeds service transactions , users bond ZAP tokens for dots at price set by Oracle on specific data feeds Endpoint; or unbond dots that are already bound to specific Endpoint for ZAP tokens.

Bond Zap tokens -> Receive dots -> Spend dots on queries/subscriptions

The ZAP tokens amount that will be required at bond or be refunded at unbond can be determined by 2 factors :

  • Bonding curve price

  • Current bound dots on that Endpoint

Example:

  • Alice is an Oracle that has Endpoint pricePrediction with bonding curve 5 + x^2

  • This Endpoint has 1 dots bound to it by some users

  • Bob decide to purchase 1 query (1 dot) to trigger his on-chain contract

  • The current dot price is 5+2^2 = 9 ZAP

  • Bob bond 55 ZAP, to Alice pricePrediction Endpoint, receiving 1 dot in escrow

  • Bob then query the Endpoint using his contract , 1 dot is transferred from his ownership to Alice ownership, Bob's contract receive the response and trigger a function.

  • Alice now has 2 dots bound, with 1 dot under her ownership that she can unbond and receive 9 Zap tokens (assuming no other dots are used or being unbond)

  • Next dot's price will be 5+3^2 = 14 ZAP

Dots can be used not only to pay for queries, subscription service, but also for speculation Endpoints, Users can make more Zap tokens simply by predict if the Endpoint will have more dots bound to it in the future

Example:

Lets consider Alice's Endpoint and its bonding curve, here is how Bob will be able to speculate, and in the case that he is correct, receive more Zap than he used to bond

  • Bob is predicting that this endpoint will be popular, he bond 1 dots for the price of 14 ZAP

  • Alice's Endpoint now has 3 dots bond to it

  • Other user bond 1 dot to Alice at the price of 5+4^2 = 21 ZAP

  • If Bob unbond his dot now instead of using it to query or subscribe, he can receive 21 ZAP instead of 14 ZAP he has paid

  • Other user will have 14 ZAP if they unbond after Bob, or they can speculate and wait for new user comes in and bond to increase the price

Above are some introduction to Zap Oracle components. Explore all available Oracles and interact with them at https://admin.zap.org/ .