Swap Pool
Credit Send

Credit Send

What is Credit Send?

Credit Send allows you to send payment to someone using their preferred token, even when you hold a different token. The protocol automatically swaps your tokens through swap pools, making cross-community payments as easy as a regular send.

Flow

  • SAT = Sender's Active Token (your default token)
  • RAT = Recipient's Active Token (their preferred token)

Summary Flow

  1. If SAT = RAT → Normal direct send
  2. If SAT ≠ RAT → Look for a swap route through pools
  • Route found → Enable Credit Send mode
  • No route → Fall back to normal send

In Credit Send mode:

  1. You enter amount in RAT (recipient's token)
  2. System calculates maximum amount of SAT you can swap to RAT (using MaxSwap logic) + any fees
  3. System swaps SAT → RAT through pool(s)

Real-World Example

Scenario: Hailing a ride from a tuktuk driver in MNYUMBUNI community

You hold USDT tokens. The vendor prefers TUKTUK vouchers.

Your Setup

  • Your Token (SAT): USDT
  • Balance: 1000 USDT
  • Vendor's Token (RAT): TUKTUK

The MNYUMBUNI Pool setup

The MNYUMBUNI pool contains both TUKTUK and USDT:

  • TUKTUK in pool (Holding Debt): 20861 TUKTUK
  • TUKTUK limit: 42000 TUKTUK
  • Exchange rate: 1 USDT = 128 TUKTUK
  • Routing depth: 0 (both tokens in same pool)

What Happens

  1. You select the vendor as recipient

  2. System detects: TUKTUK ≠ USD

  3. System checks pools: Found route through MNYUMBUNI pool.

  4. System displays:

     Credit Available: 20861 TUKTUK
    (You can swap up to 162.97 USDT -> 20861 TUKTUK)
  5. You enter: "300 TUKTUK" (to pay for a single ride)

  6. Behind the scenes:

    • System calculates required USDT to get 300 TUKTUK:
      • 300 TUKTUK / 128 (rate) = 2.34375 USDT
    • System checks your USDT balance (1000 USDT) → Sufficient
    • System checks max swap capacity: 162.97 USDT → the Max
    • System swaps: 2.34375 USDT → 300 TUKTUK (through MNYUMBUNI pool)
    • Sends: 300 TUKTUK to vendor

USSD API Example

  1. Check credit limits and display maxRAT available

Request:

GET
/credit-send/MNYUMBANI_POOL_ADDRESS/USDT_TOKEN_ADDRESS/TUKTUK_TOKEN_ADDRESS/SENDER_WALLET_ADDRESS

Response:

{
  "ok": true,
  "description": "Credit send limits",
  "result": {
    "maxSAT": "162970000",
    "maxRAT": "20861000000"
  }
}
  1. Get reverse quote for sending RAT amount, use inputAmount in Swap

Request:

GET
/pool/reverse-quote/MNYUMBANI_POOL_ADDRESS/USDT_TOKEN_ADDRESS/TUKTUK_TOKEN_ADDRESS/RAT_AMOUNT

Response:

{
  "ok": true,
  "description": "Required input amount for desired output",
  "result": {
    "inputAmount": "2343750",
    "outputAmount": "300000000"
  }
}
  • Credit available is determined by MaxSwap logic as per Integration page.