Non-Custodial Cross-Chain Liquidation Defense on NEAR
Intercept is non-custodial cross-chain risk infrastructure built natively on NEAR AI Cloud (TEE), NEAR Smart Contracts (near-sdk-rs), NEAR Chain Signatures (v1.signer), and NEAR Intents 1-Click. It protects Solana Kamino Lend borrowers from 5%–10% liquidation penalties using standby USDC held on Base—without ever taking custody of the borrower’s Solana private key or permitting an off-chain agent to sign unverified transaction bytes.
100%
73.9%
11 / 11
How Real Users Onboard & Use Intercept
Unlike traditional DeFi bots that require exporting private keys or approving unlimited token allowances, Intercept onboarding takes three non-custodial steps via the Configure Protection Policy modal on the dashboard:
Click Configure Protection Policy on the dashboard and either click Connect Phantom / Solflare (read-only public key detection) or paste your Kamino Obligation Base58 address. Because Kamino Lend natively allows third-party debt repayment (repay_obligation_liquidity_v2), your Solana wallet never signs a delegation or shares a private key.
Choose your Trigger Health Factor (e.g. 1.15x / 11500 bps), Max Per-Rescue USDC, Max Daily Limit USDC, and Max Bridge Slippage. Click Save Protection Policy to immediately evaluate your rules against live telemetry and the deployed NEAR Testnet WASM contract, or run the near-cli-rs command below to commit them on-chain.
Transfer idle USDC on Base to your deterministic v1.signer-prod.testnet Base MPC Vault (0xfa1d66b9f3ae95f9d21b8db2315720c2fcde5320). Even $2.00–$3.50 USDC is sufficient to test a complete live cross-chain rescue.
End-to-End Security & Telemetry Verification
Borrowers, risk teams, and security auditors can independently verify all four layers of Intercept (Live Mainnet Telemetry, NEAR AI Cloud TEE Reasoning, Deterministic Rust Byte Guardrails, and Quantitative Backtests) either in the browser or via the CLI verification suite:
| Verification Action | Where to Test | What to Observe |
|---|---|---|
| 1. Live vs. Flash-Crash Simulation | Dashboard → Market Stress Simulator | Toggle between Live Market (0% Shock), the Micro Buffer Dip (1.20x), and -25% Crash (1.45x) across the trajectory chart and 5-stage pipeline. |
| 2. Prompt-Injection Red-Team (11/11) | Dashboard → Security Tests (11/11) | Click any of the 11 attack vectors (e.g. rogue ERC-20 destination, Kamino borrow injection, 500 gwei gas drain) to inspect the exact Rust contract panic. |
| 3. Raw EIP-1559 & Solana V0 Bytes | Dashboard → Transaction Payloads | Inspect the decoded RLP fields for domain_id: 0 and 539-byte Solana V0 instructions for domain_id: 1. |
| 4. Full CLI & Rust Test Suite | Terminal (npm run verify) | Runs live v1.signer MPC derivation, 29 Rust unit & adversarial tests, 11 Red-Team proofs, and 3-regime backtests. |
3-Domain Non-Custodial Isolation Model
The foundational security invariant of Intercept is that the AI agent never holds keys and never has a code path to user collateral:
[Domain A: User Solana EOA] ├── Owns Kamino Obligation (SOL Collateral + USDC Debt) └── Private key NEVER shared with NEAR, MPC, or AI Agent [Domain B: NEAR AI Cloud TEE + intercept-guardrail-373299.testnet] ├── TEE Enclave signs Ed25519 Rescue Receipt (32B CSPRNG nonce + TDX/Hopper quote) ├── Scoped NEAR FunctionCall Access Key (1.00 NEAR gas allowance, 0 NEAR attached deposit) │ ├── v3 Key Spec: request_rescue_origin_leg, request_rescue_destination_leg, cancel_refunded_rescue │ ├── Contract sponsors 0.05 NEAR v1.signer fee internally (reclaimed via refund) │ └── Forbidden: update_policy (Owner-only, locked while in flight), TransferNEAR, DeployContract, AddKey └── Rust Guardrail parses every byte of Leg 1 & Leg 2 before calling v1.signer [Domain C: v1.signer-prod.testnet Chain Signatures + NEAR Intents 1-Click] ├── domain_id: 0 (Secp256k1) -> MPC_Base_Vault (0xfa1d66b9f3ae95f9d21b8db2315720c2fcde5320) └── domain_id: 1 (Ed25519) -> MPC_Solana_Payer (7AqKFEDJ13ZxpnQnBEEM6XmGq2LNa65jXBE4q96emvCo)
Volatility-Aware TEE Risk Engine (NEAR AI Cloud)
Executing inside NEAR AI Cloud (deepseek-ai/DeepSeek-V4.1-Flash-1017 on Intel TDX + NVIDIA Hopper), the risk engine computes expected liquidation penalty versus cross-chain execution cost and selects one of three deterministic regimes:
| Regime | Trigger Condition | Target Post-Rescue HF | Economic Rationale |
|---|---|---|---|
| HOLD | Observed HF >= 1.1500 | No Action | Preserves 100% of idle USDC yield on Base with 0 false triggers. |
| MICRO_BUFFER_RESCUE | HF < 1.1500 · Calm Spread | 1.2000x | Deploys minimal USDC during orderly dips, saving 73.9% capital vs. static 1.45x bots. |
| CASCADE_DEEP_RESCUE | HF < 1.1500 · High Vol / Spread | 1.4500x | Builds a 31% liquidation buffer to survive violent multi-candle flash crashes (-34%). |
Deterministic Rust Byte-Level Guardrail Specification
The NEAR smart contract (contracts/policy-guardrail/src/lib.rs) never trusts a pre-computed hash from the AI agent. It requires the full raw unsigned transaction payload and enforces byte-offset invariants:
Leg 1 — Base EIP-1559 RLP Verifier
request_rescue_origin_leg
observed_hf_bps < min_trigger_hf_bps0x02 & chain_id == 8453max_priority_fee_per_gas <= 10 gwei, max_fee <= 50 gweito == 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913value == 0 (Zero native ETH drain)[0..4] == 0xa9059cbb (68 bytes, blocks approve)[16..36] == 1-Click Deposit Address[52..68] == Receipt Amount <= Per-Action & 24h CapLeg 2 — Solana V0 Kamino Verifier
request_rescue_destination_leg
64..=1232B; live 5-ix V0 = 539B)0x80, num_required_signatures == 1, ALTs == 0<= 5,000,000 micro-lamportsKLend2g3... refresh + 1 repay ix0x74aed54cb435d290 (Repay v2)[0] MPC Payer · [1] Obligation · [2] Main Market[3] == Pinned Mainnet USDC Reserve (D6q6wu...)[5] == Non-Aliasing MPC Solana USDC ATA[6] == SPL_TOKEN_PROGRAM (Tokenkeg... · blocks Token-2022 hooks)Multi-Domain v1.signer MPC, Async State & Solver Refund Safety
Because NEAR cross-contract calls to v1.signer execute asynchronously across blocks, Intercept enforces a strict 4-state per-receipt lifecycle (InFlightLeg1 → ReadyForLeg2 → InFlightLeg2 → Completed) with non-panicking #[private] callbacks (on_origin_leg_signed, on_destination_leg_signed) that atomically roll back rolling_24h_spent_usdc if Leg 1 MPC signing fails, or revert to ReadyForLeg2 for safe retry if Leg 2 signing fails. Furthermore, every NEAR Intents 1-Click quote pins refundTo = MPC_Base_Vault: if a solver returns REFUNDED or FAILED after Leg 1, the orchestrator halts before Leg 2 and invokes cancel_refunded_rescue to restore the 24-hour cap while keeping the receipt hash permanently replay-locked.
11-Vector Adversarial Red-Team Verification Matrix
| # | Exploit Vector | Target Layer | Guardrail Enforcement |
|---|---|---|---|
| 01 | Unauthorized Kamino Collateral Withdrawal | Leg 2 · Solana V0 | Discriminator != Repay v2/v1 -> Revert |
| 02 | Base USDC Recipient Redirection | Leg 1 · Base EVM | Calldata [16..36] != 1-Click Deposit -> Revert |
| 03 | ERC-20 Unlimited Approval Injection | Leg 1 · Base EVM | Selector != 0xa9059cbb -> Revert |
| 04 | Unauthorized Kamino Debt Drawdown | Leg 2 · Solana V0 | Borrow Discriminator Blocked -> Revert |
| 05 | Kamino Obligation Account Substitution | Leg 2 · Solana V0 | Account [1] != User Obligation -> Revert |
| 06 | Forged Enclave Attestation Signature | TEE Attestation | Ed25519 Verify / Nonce Replay -> Revert |
| 07 | Solana V0 Address Lookup Table Obfuscation | Leg 2 · Solana V0 | address_table_lookups_len != 0 -> Revert |
| 08 | Blind 32-Byte Digest Signing Attempt | Leg 2 · Solana V0 | Length < 64 bytes -> Revert |
| 09 | Asynchronous Cross-Contract State Race | Async TOCTOU State | State != ReadyForLeg2 -> Revert |
| 10 | Base EIP-1559 Gas-Fee Siphoning | Leg 1 · Base EVM | max_fee_per_gas > 50 gwei -> Revert |
| 11 | Solana Compute-Budget Fee Siphoning | Leg 2 · Solana V0 | SetComputeUnitPrice > 5M -> Revert |
CLI Verification & On-Chain Deployment Reference
npm run verify
cargo test --manifest-path contracts/policy-guardrail/Cargo.toml
near contract call-function as-transaction intercept-guardrail-373299.testnet update_policy json-args '{"new_policy":{"owner_id":"intercept-guardrail-373299.testnet","authorized_agent_id":"runner.intercept-guardrail-373299.testnet","mpc_signer_contract":"v1.signer-prod.testnet","tee_enclave_pubkey_hex":"7885b100077bd5400dd8d3ea0ae6d3ef863e827adbdb5ba09ff4963c6e6e32c5","mpc_base_vault_address_hex":"0xfa1d66b9f3ae95f9d21b8db2315720c2fcde5320","mpc_solana_payer_pubkey":"7AqKFEDJ13ZxpnQnBEEM6XmGq2LNa65jXBE4q96emvCo","user_kamino_obligation_pubkey":"C5dZVpvpA39SNLDkojsi98nRePRRy8ELhtxak8m2vMq","kamino_lending_market_pubkey":"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF","sol_collateral_reserve_pubkey":"d4A2prbA2whesmvHaL88BH6Ewn5N4bTSU2Ze8P6Bc4Q","usdc_repay_reserve_pubkey":"D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59","base_derivation_path":"intercept-base-vault-1","solana_derivation_path":"intercept-solana-payer-1","max_per_action_usdc":"2500000000","max_daily_usdc":"5000000000","max_slippage_bps":100,"min_trigger_hf_bps":11500,"max_receipt_age_sec":300}}' prepaid-gas '80.0 Tgas' attached-deposit '0 NEAR' sign-as intercept-guardrail-373299.testnet network-config testnet sign-with-keychain send| On-Chain Step | Contract / Method | Transaction Hash (NearBlocks) |
|---|---|---|
| Contract Deploy & Init | intercept-guardrail-373299.testnet::new | FHbKGEa9q2h3Pu4adQpyVhSHVAfiPZSFQTk9DNCb6ns9 |
| WASM Upgrade & Owner Policy Update | DeployContract + update_policy | AtGgegrK4nGFX7Lksu66zSBvgGoqP8Wr7jAQepfaW3Bf |
| Scoped FunctionCall Key Provisioning | runner.intercept-guardrail-373299.testnet (AddKey) | 3TFzFZ6vF1uEYBEPtvf8X5PDiWo3VKZojJSMzuiKriVF |
| Leg 1 Zero-Deposit FunctionCall Rescue (Secp256k1) | request_rescue_origin_leg → v1.signer-prod.testnet | 5GZMVE9fokSqLqNNxZTLZEzeHrBbkQSAfLro5NMeZFJt |
| Leg 2 Zero-Deposit FunctionCall Repay (Ed25519) | request_rescue_destination_leg → v1.signer-prod.testnet | 9mHD6Qp7tCeaMieWyLTYb7wE3YyHRR3BmtqcdzG2xeFr |
| On-Chain Healthy-Position Block (HF >= Trigger) | PositionHealthyAboveTrigger Revert | i1YgQ5EMZ78FWUoD8kZFKyqpADY6RNo6kKNYTCKrudJ |
| Async TOCTOU Failure Rollback | on_origin_leg_signed (rescue_origin_leg_rolled_back) | GnXXpAsFo6w9c77SjkK8VNYvY3uAwY49rPdFPbnzhvkk |
| Hardened v3 WASM & Solver-Refund Upgrade | DeployContract (FfC8pRQss8...) + update_policy | AxUeZPcQUQWNjFfhdB84JMN8JRghu21bs9mykXEAZiwD |