π₯Overtime V2 integration
Step-by-step Overtime V2 integration guide.
Overtime V2 API
In order to ensure easy integration with external partners Overtime V2 API is created. API returns all main data available on Overtime V2. Using Overtime V2 API endpoints someone can get data about:
More details about each API endpoint with request/response examples also can be found under Postman documentation.
Contract integration
Once all data are fetched from V2 API, the next step is integration with Overtime V2 contracts. Integration for both, a single or a parlay should be done with the Sports AMM V2 contract. Integration for live markets should be done with the Live Trading Processor contract.
The next sections describe integration with Overtime V2 API and Overtime V2 contracts together with JS code examples.
Buy a ticket
Users placing trades with $OVER will get 1% extra payouts for each game they have on their ticket.
Let's say someone wants to buy a 2-game ticket with a buy-in amount of 20 $OVER:

Integration with Overtime V2 API and Sports AMM V2 contract should include the following steps:
Get markets from Overtime V2 API
Select ticket markets and positions and get a quote for a ticket from Overtime V2 API. NOTE: This step is not mandatory. The trading method on contract requires a total quote as a parameter, but that can be calculated by simply multiplying market odds. However, the API method returns some additional data, like ticket liquidity or validation errors, if any.
Get a Sports AMM V2 contract address for a specific network from Thales V2 contracts
Get a Sports AMM V2 contract ABI from the Overtime V2 contract repository
Create a Sports AMM V2 contract instance
Call
trademethod on Sports AMM V2 contract with input parameters fetched from Overtime V2 API in steps #1 and #2
The JS code snippet below implements these steps:
Buy a position on live markets
Users placing trades with OVER will get 1% extra payouts for each game they have on their ticket.
Let's say someone wants to buy a live draw position on the game Tokyo Verdy 1969 - Consadole Sapporowith with a buy-in amount of 10 USDC:

Integration with Overtime V2 API and Live Trading Processor contract should include the following steps:
Get live markets from Overtime V2 API
Select live market and position
Get a Live Trading Processor contract address for a specific network from Thales V2 contracts
Get a Live Trading Processor contract ABI from the Overtime V2 contract repository
Create a Live Trading Processor contract instance
Call
requestLiveTrademethod on Live Trading Processor contract with input parameters fetched from Overtime V2 API in steps #1 and #2Wait for the request to finish - fulfilled successfully or failed with some error (e.g. odds changed)
The JS code snippet below implements these steps:
Last updated