Skip to main content

REST API

A hosted REST API that wraps every external function on every Doga contract. Reads return chain state. Writes return ready-to-sign transaction calldata — your wallet does the signing. The API never holds private keys.

Base URLhttps://core-contracts-production.up.railway.app
ChainBase mainnet (id 8453)
AuthenticationNone for reads. Signature on the resulting tx for writes.
Content typeapplication/json

Three things to know

  1. Base URL is https://core-contracts-production.up.railway.app. All paths in this section are relative. Reads (GET) are free; writes (POST) return calldata that your wallet signs and submits.

  2. Writes return unsigned transactions, not receipts. A POST to /lending/deposit doesn't deposit — it returns { to, data, value, chainId }. Pass that to eth_sendTransaction from any wallet, or sign locally and relay through POST /tx/broadcast. See Security Model.

  3. BigInts are decimal strings. Amounts, indexes, and IDs that exceed Number.MAX_SAFE_INTEGER are sent as decimal strings to preserve precision. Same on input. See Conventions.

Hello world

# liveness
curl -s https://core-contracts-production.up.railway.app/health
# {"ok":true,"time":"..."}

# what's deployed
curl -s https://core-contracts-production.up.railway.app/addresses | jq

# all collaterals registered on-chain
curl -s https://core-contracts-production.up.railway.app/collaterals | jq

# build an unsigned deposit tx
curl -sX POST https://core-contracts-production.up.railway.app/lending/deposit \
-H 'content-type: application/json' \
-d '{
"token":"0x4200000000000000000000000000000000000006",
"currency":"KES",
"amount":"1000000000000000000"
}'

The last call returns { to, data, value, chainId, function, args }. Sign with any wallet — your user's MetaMask, your operator's HSM, your liquidator's hot wallet — and submit.

Endpoint groups

PrefixWrapsPage
/health, /info, /addresses, /txInfrastructureSystem & Transactions
/rolesRoles registry/roles
/collateralsCollateral whitelist + risk params/collaterals
/currenciesFiat currency whitelist + interest accrual/currencies
/pricesChainlink crypto prices/prices
/fxSigned-push FX oracle/fx
/allowlistPer-currency KYC allowlist/allowlist
/treasuryTreasury inflows / outflows / bad debt/treasury
/lendingThe composer — positions, borrows, repays, liquidations, capital deployment/lending

Full reference index.

Read these before you build

  • Conventions — error format, status codes, BigInt encoding, currency codes.
  • Security Model — why no keys, how the build-tx pattern works.
  • Frontend Integration — wagmi hook, TanStack Query reads, end-to-end deposit + borrow + repay code.