Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

P2P Offer Book

Who it's for: Verified liquidity providers — businesses, remittance operators, or individuals — who want to earn a spread by offering to exchange cGHS at their own price. Why it matters: P2P offers let real market participants set prices based on local GHS demand, keeping the on-chain rate anchored to what the currency is actually worth in the market.

LPs create offers by depositing both sides of a token pair. During swaps, RouterHook automatically matches against open offers. SSI KYC is required to create an offer.

POST /offers/create — Create Offer

SSI required: Yes — SSI.isVerified(identity) must be true.

Request
{
  "lpAddressId": "wallet-uuid",
  "lpAddress": "0xabc...",
  "token0": "0x3126627A607E730E3eCF9BbfFD67fa18Deaab846",
  "token1": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "amount0": "1000000000",
  "amount1": "65000000",
  "priceType": "FLOATING",
  "spreadBps": 30,
  "minSwapAmountUsd": "10000000",
  "maxSwapAmountUsd": "1000000000",
  "expiry": 1800000000
}
FieldNotes
priceType"FIXED" or "FLOATING"
fixedPrice8-decimal fixed price (FIXED only) e.g. "6500000" = 0.065 USD/GHS
spreadBps±5000 bps (FLOATING only). 30 = +0.30% above oracle
minSwapAmountUsd / maxSwapAmountUsdUSD-denominated swap size limits (base units)
expiryUnix timestamp
Response
{ "id": "uuid", "status": "pending" }

POST /offers/:offerId/cancel

{ "lpAddressId": "uuid", "lpAddress": "0xabc..." }

POST /offers/:offerId/claim-expired

Reclaim tokens from an offer that has passed its expiry.

{ "lpAddressId": "uuid", "lpAddress": "0xabc..." }

GET /offers — List Active Offers

GET /offers?token0=0x312...&token1=0x833...
Response
{
  "offers": [
    {
      "offerId": "5",
      "lp": "0xabc...",
      "priceType": "FLOATING",
      "spreadBps": 30,
      "remainingAmount0": "950000000",
      "remainingAmount1": "61750000",
      "status": "OPEN"
    }
  ]
}

GET /offers/lp/:address — LP's Offers

Returns all offers created by a given LP address, with live on-chain status.


Offer Lifecycle

created (pending)
    ↓ OfferCreateWorkflow confirms
open
    ↓ RouterHook.beforeSwap fills
open (partially filled) → filled (fully filled)
    or
cancelled / expired → LP claims back tokens