INTRODUCTION TO ZAP ORACLES

Introduction to Zap platform, contracts, bonding curve and tools

What is Zap platform ?

Zap.org utilizes blockchain to provide a decentralized platform for three main purposes

  • Data providers marketplace

  • Subscription services

  • Token Providers create bonding curves which mint ERC20 and other token standards, can be used for crowdfunding and other dapp variations

Who is Zap platform for ?

  • Data providers (Oracles) : provide your data or joining other data providers in providing a decentralized data feeds service. You then can use bonding curve pricing model built into zap contracts to determine the price for your data and receive Zap Token as payment when response to users. Oracle can provide data or services through:

    • Queries/Response method : Oracle will listen to queries in form of an event occur on the blockchain, and respond to that queries with the data and receive Zap Token as payment

    • Subscription methodd: Oracle can receive Zap Token payment for a subscription that last certain blocks period depends on their price and provide data continuously to consumers that have subcsriptions in that period

  • Data consumers : Users looking for a way to purchase data, Developers looking for a way to integrate decentralized data into their apps or dapps.

  • Individuals and Companies : can engage in tokenized services built into Zap contracts in a simple, secured and decentralized way to release their own tokens with a bonding curve pricing mechanism to provide good incentive for early adopters.

Zap and bonding curve pricing model

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.

What are "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.

Dots usage

  • 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

More information about curation market :

Using bonding curve with dots in Zap contracts

  • 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 and Unbond processes allow users to purchase dots with zap token and redeem dots to have the zap token sent to their address. The processes can be simplified as :

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

    • Unbond unused dots -> Received Zap tokens back at price of the dots on the bonding curve

  • 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

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

Example

  • Alice is an Oracle that offers 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

Bob can earn more Zap tokens with bonding and unbonding dots without using dots for any data services in this example :

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

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

  • The next user bonds 1 dot to Alice at the price of 5+4^2 = 21 ZAP

  • If Bob unbonds 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

Introducing Zap Contracts

To achieve this goal, Zap contracts are created on Ethereum blockchain ( Mainnet and Kovan Testnet available). Zap contracts is the back bone for the platform and include keys features:

  • Facilitate Oracles/Service creation with bonding curve pricing model

  • Zap Token management

  • Facilitate data queries and response

  • Manage Subscriptions

  • Faciliate Token creation with bonding curve pricing model

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

Explore and interact with all available Oracles at https://admin.zap.org/