Collateral & Credit
CollateralVault
Who it's for: Asset holders — property owners, investors, or businesses holding tokenised real-world assets — who want to unlock liquidity without selling what they own. Why it matters: Tokenised assets act as collateral directly on-chain, so holders can borrow cGHS against the value of a property or bond without going through a bank or selling the asset.
Borrow cGHS by locking RWA tokens as collateral. The diamond freezes the RWA tokens in-place (no transfer needed) and pays out from reserves.
POST /collateral/open
Request
{
"userAddressId": "wallet-uuid",
"userAddress": "0xabc...",
"rwaToken": "0xrwa...",
"collateralAmount": "1000000000000000000",
"borrowToken": "0x3126627A607E730E3eCF9BbfFD67fa18Deaab846",
"borrowAmount": "200000000"
}Pre-flight checks by the service:
CreditScoring.maxLtvBps(user) > 0— user must not be UNRATEDCollateralVault.reserveOf(borrowToken) >= borrowAmount— reserve must cover
No token approval needed — the diamond freezes the RWA tokens as agent.
POST /collateral/:positionId/repay
Partial repayment on an open position.
{ "userAddressId": "...", "userAddress": "0x...", "amount": "50000000" }Transaction batch: [approve(lendingDiamond, amount), repay(positionId, amount)]
POST /collateral/:positionId/close
Repay full outstanding debt and unfreeze RWA collateral.
{ "userAddressId": "...", "userAddress": "0x..." }POST /collateral/:positionId/liquidate
Liquidate a position where healthFactor < 1.0. Callable by anyone (keeper or any liquidator).
{ "liquidatorAddressId": "...", "liquidatorAddress": "0x..." }Read Endpoints
GET /collateral/:positionId — position + healthFactor + totalDue
GET /collateral/:positionId/health — { healthFactor, liquidatable }
GET /collateral/borrower/:address — all positionsCredit Scoring
Who it's for: Any user who has borrowed, repaid, or saved on Shika — their on-chain history is automatically converted into a score that improves their borrowing terms over time. Why it matters: Creditworthiness is built from real financial behaviour rather than a bank statement, giving people with no formal credit history a fair path to better rates.
Credit scores are FICO-style composites (350–850) computed from on-chain behaviour. They're read-only from the service — scores are updated by the valuation-service TEE or the keeper wallet.
GET /credit/:address
{
"subScores": {
"repaymentHistory": 82,
"utilizationRate": 74,
"accountAge": 60,
"incomeVerification": 90
},
"compositeScore": 765,
"tier": "PLATINUM",
"lastUpdated": 1710854400,
"zkTlsVerified": true,
"provablyVerified": true
}GET /credit/:address/score
{ "compositeScore": 765, "tier": "PLATINUM" }GET /credit/:address/ltv
{ "maxLtvBps": 7500, "maxLtvPercent": "75.0%" }GET /credit/:address/verified
{ "verified": true }