Logo

Pricing System

Payment Methods

In order to place a request of injecting data in Bridge oracle system, users must pay for it. Bridge oracle provides two various payment methods for users to pay the cost of their requests including:

  • BRG (Bridge Token)
  • TRX

​ Price of a request is calculated based on a certain on-chain algorithm and the amount is paid automatically from user’s smart contract. In fact in order to use Bridge oracle system, user’s contract is charged by BRG or TRX.

​ Before discussing payment process, note that price of the request is calculated based on TRX. Thus in order to have the price based on BRG token, up to date exchange rate of BRG/TRX should be available every moment for our pricing system with which BRG-based price can be easily calculated. For solving this issue, a bot has been developed that watches BRG/TRX exchange rate continuously and compare it with the rate which is injected to Bridge oracle’s pricing system. If the difference is more than 1%, this bot updates the price and injects the new exchange rate to the blockchain and cost of next requests are calculated based on the new exchange rate.

​ In first step Bridge oracle checks BRG balance of user’s smart contract. If there is enough balance in user’s contract according to the cost of the request, Bridge will charge user’s contract by BRG token, automatically. If there is not enough BRG balance in user’s contract, in second step Bridge oracle will check TRX balance of user’s contract. This time if there is enough TRX balance in user’s contract, Bridge will charge user’s contract by TRX. If there is not enough BRG and TRX balance in user’s contract, user’s request will be rejected and no response will be reported into user’s smart contract by Bridge oracle system.

Note: Charging user’s contract by BRG token includes a percentage of discount in comparison with TRX payment method. In fact paying BRG token is more affordable than paying by TRX for placing a request in Bridge oracle system.

Pricing Algorithm

As said before price of requests are calculated based on a special algorithm. Price is consisted of 3 main parts as follows:

Query Price = Cost of Query Type + Query Fee Limit + Maximum Bandwidth Price

Each kind of query from oracle type or data source point of view, has a specific price that creates "Cost of Query Type" part. In fact, this part is cost of using Bridge services. This part is consisted of two parts by itself that is calculated as follows:

Cost of Query Type = Base Price × Multiplier

Base price was introduced to calculate cost of Bridge services. In fact base price is unit price of providing service for a request with Multiplier 1. Multiplier shows complexity of a task based on resource consumption. One can investigate base price and multiplier of various type of requests in the following tables:

Data SourcesBase PriceMultiplierCost of Query Type
URL5 TRX× 15 TRX
RANDOM5 TRX× 15 TRX

Note: Base Price is constant for all kind of requests; however it may be changed based on condition.

​ Query Fee Limit is determined by users for their requests. In fact this part limits the complexity of callback function which is triggered by Bridge oracle. This part is the money that is paid to blockchain as contract triggering fee in order to trigger the user's contract. Users should test their contract in testnet in order to achieve the closest amount with which the response is received into their contract. Because the difference between paid Query Fee Limit and the amount with which oracle can trigger their contract is not refunded.

Note: If the Query Fee Limit is not set by the user, Bridge oracle will assign Default Fee Limit to the user's request that its amount is equal to 5 TRX.

​ In order to fully understand the concept, please consider the following query:

bridge_query("URL", "json(https://api.pro.coinbase.com/products/BTC-USD/ticker).price", 2500000);

In this query, the maximum cost which can be paid to TRON blockchain for calling __callback() method and trigger user's smart contract by Bridge oracle, must be less than 2.5 TRX which is equal to 250000 energy when calling the function (refer to TRON station).

​ Maximum Bandwidth price is a constant amount which is consumed when oracle wants to trigger users' smart contract.

Note: Max Bandwidth Price is a constant amount which is equal to 0.01 TRX that may be changed based on condition.

Cautious: For ease of development and initial test, Bridge oracle will not charge a contract for its first request. Because if users want to send a request from their smart contracts right away after deployment, they need to write their request in constructor. Therefore Bridge responds to users' smart contracts for the first time free of charge.