πŸ”₯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 documentationarrow-up-right.

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 contractarrow-up-right. Integration for live markets should be done with the Live Trading Processor contractarrow-up-right.

The next sections describe integration with Overtime V2 API and Overtime V2 contracts together with JS code examples.

Buy a ticket

circle-info

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:

Ticket on Overtime V2

Integration with Overtime V2 API and Sports AMM V2 contract should include the following steps:

  1. Get markets from Overtime V2 API

  2. 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.

  3. Get a Sports AMM V2 contract address for a specific network from Thales V2 contractsarrow-up-right

  4. Get a Sports AMM V2 contract ABI from the Overtime V2 contract repositoryarrow-up-right

  5. Create a Sports AMM V2 contract instance

  6. Call trade method 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

circle-info

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:

Live markets on Overtime V2

Integration with Overtime V2 API and Live Trading Processor contract should include the following steps:

  1. Get live markets from Overtime V2 API

  2. Select live market and position

  3. Get a Live Trading Processor contract address for a specific network from Thales V2 contractsarrow-up-right

  4. Get a Live Trading Processor contract ABI from the Overtime V2 contract repositoryarrow-up-right

  5. Create a Live Trading Processor contract instance

  6. Call requestLiveTrade method on Live Trading Processor contract with input parameters fetched from Overtime V2 API in steps #1 and #2

  7. Wait 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