GAM FINANCE
GAM FINANCE, a cross chain prediction backed credit market that turns binary outcome shares into liquid collateral. Orchestrated by Chainlink, governed by an Autonomous AI Swarm.
What it is
WHAT IS IT?
GAM FINANCE is a cross chain prediction backed liquidity market (prediction box) that uses Chainlink CCIP and Chainlink CRE to orchestrate agentic off chain and on chain workflows. It is a protocol that allows easy deposit & withdrawal of collateral and stable tokens to the pool. For the first time in DeFi, you can borrow stable coins (USDC) against your open binary outcome shares before the prediction market resolves.HOW IT WORKS:
Giving an example of using the protocol on Arbitrium, we have this step by step process of how it works.
On a Spoke chain (like Arbitrum), the protocol uses a "Parallel Meeting" logic. The data message and the AI valuation travel separately and meet at the Hub to unlock the loan.
Here is the step-by-step lifecycle:
The Trigger (On the Spoke)
User: Calls depositCollateral on the Arbitrum BorrowerSpoke.
Contract:
Locks your prediction tokens in escrow.
Emits CollateralDeposited: This is a signal for the AI.
Sends CCIP Message: It sends a data packet (Vault ID, LTV, etc.) across the bridge to the Hub (Base).The Parallel "Race"
Now, two things happen at the same time:
- The CCIP Path: The message travels through the Chainlink CCIP infrastructure. After a few minutes, it arrives at the
HubReceiver on Base. The Hub sees the request but puts it in a PENDING state because it doesn't know the price yet. - The AI Path: The AI Agent Swarm (CRE) is watching the Arbitrum RPC. It "sees" the CollateralDeposited event instantly.
It calculates the fair market value of your specific order on Polymarket and sends a Valuation Report directly to the HubReceiver on Base.
- The Meeting Point (On the Hub)
The HubReceiver on Base acts as a "Matching Engine." It waits for two pieces of the puzzle for every vaultId:
The CCIP Request (Proof that you actually locked tokens on Arbitrum).
The AI Valuation (Proof of what those tokens are currently worth).
- Disbursement
As soon as the second piece arrives (no matter which one gets there first), the HubReceiver validates the loan against the AI price. If everything looks good:
It calls disburseLoan on the Omnichain Liquidity Pool.
The Pool sends the USDC back to your wallet on Arbitrum via CCIP.
Why this is secure:
By separating the User's Request (CCIP) from the Valuation (AI), we prevent "Price Manipulation" attacks. The AI calculation happens independently of the user's transaction, ensuring the protocol always lends against the true market value.
- PROBLEM IT SOLVES
The decentralized finance (DeFi) ecosystem currently faces a severe capital inefficiency paradox because despite the explosive growth in the prediction markets, the capital locked within these markets in the form of binary outcome shares, remains trapped and untouchable. While traditional token lending protocols achieve high utilization rates, and even non-fungible token (NFT) lending captures a fractional market share, prediction market lending sits precisely at 0%. GAM FINANCE solves this problem of not being able to borrow, leverage or deploy elsewhere
against your capital while positions remain open.
How it Works
GAM FINANCE is built using a Hop and Spoke architecture to maximize capital efficiency while allowing borrowers to keep their assets on their native coins. The hub is like the brain of the entire protocol that houses the Liquidity pool, governance contract, Dutch Auction contracts.
BORROWER
When a borrower, say Alex, tries to borrow using Polymarket's Yes/No token, the token is deposited and after being deposited to the borrower's contract, the protocol's valuation CRE workflow is triggered using the collateral deposit event. This workflow spins up the AI swarm which is a combination of multiple agents working together to run a valuation workflow to get the actual value of the collateral being deposited.
The swarm of agents consists of:
- The News Agent
- The Buyer's Analyst
- The Sentiment Analyst
- The Quant Analyst; and
- Risk Supervisor
Each with special tasks to make sure the valuation of the collateral is correct. The final valuation is sent back to the Hub Contract by the CRE workflow which updates the borrower's Vault as "valid" and the loan value is transferred to the user.
LENDER
For the Lender, to improve the user experience and avoid bridging of stable coins for lending across chains, we implemented a Lending Spoke deployed on all supporting chains. This allows for cross chain deposit of USDC without bridging using Chainlink CCIP. The Lender deposits the stable coin to the Lending Spoke Contract and the CCIP messages is sent through the DON (Decentralized Oracle Network) and is resolved on the Hub Contract which is the receiver.
This removes the friction of cross chain bridging as only one transaction is being sent and fees are paid in native coins or in LINK by the protocol.
LIQUIDATION
When the collateral health factor is lower than the maintenance margin of the protocol, a liquidation event occurs. The CRE Workflow triggers the Hub to perform an instant order book sell of the position.
CRE WORKFLOWS
1.Valuation Workflow: gets triggered when collateral has been deposited on any Spoke or Hub contracts.
When the AI agent detects a deposit, market data is fetched and "safe valuation" calculated based on the outcome index. The final valuation is sent to the HubReceiver on the Hub. This event moves the vault from "PENDING" to "ACTIVE", and loan disbursed.
- Event Resolution Workflow: On interval, the AI Agent checks available resolving markets (eg. PolyMarket, Kalshi results). For each resolved market, it fetches the win/loss status and then triggers resolveMarket on the Hub/Spokes. The Vaults are marked as "RESOLVED", enabling collateral recovery or closing the loan.
3.Health Monitor Workflow: the AI Agent iterates through ACTIVE vaults, and fetches current market prices for the collateral. Any vaults with a Health Factor below maintenance margin, is identified and liquidated on the Hub.
- Hybrid Liquidation Workflow:
The protocol implements a two-tiered liquidation sttrategy to minimize slippage and maximize recovery:
a. Tier 1: Direct Order Book Dump (Primary)
- The AI liquidator identifies a bid on PolyMarket sufficient to cover thee debt
- It triggers the PolymarketAdapter to execute a swap.
Result: Immediate debt settlement, minimized "Bad Debt" risk.
b. Tier 2: Dutch Auction Fallback (Decentralized) - Triggered if direct sale fails or is unprofitable
- The price decays over 24 hours until a bidder repays the debt
Result: Robustness against low liquidity periods or AI service interruptions
Chainlink CCIP: we used CCIP in the borrowing, lending and resolving Lender's Spoke contract, Borrower's Spoke Contract:, Omni Liquidity Pool, Dutch Auction Contract and for finalizing and repayment of excess.
Chainlink CRE: to orchestrate workflow, trigger AI agents
Chainlink Confidential Compute: to store the keys for the Agent swarm and the API keys for the smart contracts
Links
Created by
- Esse
- Joshua