Kohin Documentation
website·Indexed 30 days ago
https://docs.kohin.xyzDocumentation for Kohin, a decentralized insurance solution for prediction markets. It provides an SDK with API and contract methods for managing insurance covers, calculating premiums, adding/removing liquidity, and retrieving bet and transaction history.
What's inside Kohin
- Kohin is a decentralized insurance layer for prediction markets that allows bettors to insure their stakes. In Kohin V1, the platform specifically supports sports combo bets on the Azuro Protocol. The goal is to reduce risk for bettors, increase participation in prediction markets, and support ecosystem growth.
Overview of Kohin V1 Insurance Features
Kohin V1 provides an insurance layer for users of decentralized betting platforms (such as Azuro), allowing bettors to insure their bets to mitigate risk across various bet types. The core functionality includes:
- Policy Issuance & Premium Calculation: Users can purchase insurance with premiums that are dynamically calculated based on risk metrics.
- Insurance Settlement: Claims are processed through an automated and transparent system in the event of a loss.
- Liquidity Provision: Users can act as liquidity providers by adding funds to the insurance pool to earn fees from generated profits.
Introduction to the Kohin JS SDK
The Kohin JS SDK is a developer toolkit used to integrate Kohin's decentralized insurance system into applications. It provides the necessary interface to interact with Kohin smart contracts and backend APIs, specifically for managing user bets, insurance coverage, and liquidity pools.Overview of Kohin's decentralized insurance for prediction markets
Kohin provides decentralized insurance building blocks and modular tools designed specifically for prediction markets. The goal is to improve risk management for both bettors (who seek security when placing bets) and platforms (who aim to retain users by offering added value and safer betting environments).Overview of Kohin decentralized insurance layer
Kohin is a decentralized insurance layer specifically built for prediction markets. It provides innovative insurance policies designed to reduce risks for bettors, allowing users to engage with prediction markets with greater confidence and security.Retrieve insurance cover details using getCover
ThegetCovermethod retrieves detailed information about a specific insurance cover using itscoverId. This is primarily used to monitor the cover's state, coverage amount, premium, and associated bet details.import kohin from "./kohinInstance"; const coverDetails = await kohin.getCover({ coverId: 97 }); if (coverDetails.success) { console.log("Cover Details:", coverDetails.cover); } else { console.error("Error fetching cover details:", coverDetails.error); }Understand Kohin's insurance value proposition for prediction markets
Kohin provides insurance solutions for prediction markets to mitigate the full risk typically borne by bettors. By offering a risk net for a broad set of events, Kohin increases bettor confidence and improves platform loyalty through higher user retention.Fetch bet details using getBetDetails
ThegetBetDetailsmethod retrieves comprehensive information about a specific bet using its unique identifier. This includes the bettor's address, amount staked, odds, payout information, status, and associated game conditions.import kohin from "./kohinInstance"; const betDetailsParams = { betId: "0x471dac1052248602fdf05377ef99b5b7b3a769a", // Unique identifier of the bet }; const betDetails = await kohin.getBetDetails(betDetailsParams); console.log("Bet Details:", betDetails);Understand Kohin's premium calculation and risk factors
Kohin uses a dynamic, risk-based premium model to manage risk for bettors and liquidity providers. Premiums are adjusted in real-time based on the following factors to ensure the sustainability of the insurance pool:
- Bet Type: Risk profiles differ between Single and Combo bets.
- Odds: Higher odds increase the risk of loss, resulting in higher premiums; lower odds result in more affordable premiums.
- Bettor's History: Past performance can influence rates, potentially rewarding consistent players with lower premiums.
- Bet Amount: Premiums scale with bet size; larger bets carry more risk and higher premiums.
- Outcome Ratio: This compares the number of bettors choosing a specific outcome against those betting on the opposite outcome to prevent the insurance pool from becoming overly exposed to one-sided bets.
Understand the Kohin V1 System Architecture
Kohin V1 uses a modular architecture designed to provide decentralized insurance for prediction market platforms (such as Azuro, Polymarket, and Drift). The system is composed of five primary components:
- Kohin Factory Contract: The central deployment and management hub for all core system components.
- Modular Insurance Pool Contracts: Manages funds from liquidity providers using a structure inspired by Azuro’s liquidity tree to ensure balanced liquidity.
- Policy Issuance and Management Contract: Handles the creation of insurance policies and defines the specific conditions required for claims.
- Insurance Settlement Engine: The core processing unit that manages claims and executes payouts to bettors when insured bets are lost.
- Prediction Market Connector: A standardization bridge that integrates with external prediction platforms to gather and process bet data.
Retrieve wallet transaction history using getTransactionHistory
ThegetTransactionHistorymethod retrieves all transactions (deposits, withdrawals, etc.) associated with a specific wallet address. It supports pagination via thepageCountparameter to manage large datasets. This is typically used for financial activity displays, audits, or reporting.import kohin from "./kohinInstance"; const transactionHistoryParams = { address: "0x670EEBd1eFdf8D576e1FE554F3D8e905f28cc5b9", // Wallet address to fetch pageCount: 1, // Pagination page number }; const transactionHistory = await kohin.getTransactionHistory( transactionHistoryParams ); console.log("Transaction History:", transactionHistory);Connect a wallet to Kohin
Kohin does not require traditional accounts or KYC. Users must use a crypto wallet compatible with the Polygon network. Supported wallets include MetaMask, TrustWallet, and WalletConnect. Users are responsible for their own private keys and recovery phrases, as Kohin cannot recover lost funds.