Workflows

Chainlink Runtime Environment workflows powering LienFi. Paste a request hash to watch live output.

credit-assessment

Credit Assessment

Evaluates borrower creditworthiness inside a CRE enclave. Fetches Plaid financial data, scores via LLM, and writes approval on-chain.

Steps

Trigger: LoanManager.RequestSubmitted event
Fetch borrower financial data via Plaid API
Score creditworthiness with Groq LLM (llama-3.3-70b)
Compute EMI, interest rate, approved limit
Write LoanManager.approveLoan() on-chain

Request Hash

CLI Command

>./run-cre.sh credit-assessment-workflow <request-hash>

Live Output

Run the CLI command above, then click Watch to see live output here.

create-auction

Create Auction

Cron-triggered workflow that scans for defaulted loans (3+ missed payments) and creates sealed-bid auctions on-chain.

Steps

Trigger: Cron schedule (every 5 minutes)
Read all active loans from LoanManager
Check for defaults (missedPayments >= 3)
Fetch property listing from API, compute hash
Call LienFiAuction.createAuction() on-chain

CLI Command

>./run-cre-cron.sh create-auction-workflow create-auction

Live Output

Run the CLI command above, then click Watch to see live output here.

bid

Sealed Bid Collection

HTTP-triggered CRE workflow that forwards signed bids to the API, validates eligibility, and registers the opaque bid hash on-chain via DON-signed report.

Steps

Trigger: HTTP payload (signed bid JSON)
Forward bid to API via Confidential HTTP
API validates: EIP-712 sig, pool balance, lock expiry, reserve price
Encode report: abi.encode(auctionId, bidHash)
DON-sign and write to LienFiAuction._registerBid()

CLI Command

>./run-cre-bid.sh /path/to/bid-payload.json bid

Live Output

Run the CLI command above, then click Watch to see live output here.

settlement

Auction Settlement

After deadline, the CRE workflow reveals all bids, determines the Vickrey winner (highest bidder pays second-highest price), and settles on-chain.

Steps

Trigger: Cron / manual after auction deadline
Fetch all sealed bids from enclave storage
Verify each EIP-712 signature
Determine winner (highest bid) and price (second-highest)
Call LienFiAuction.settleAuction() on-chain

CLI Command

>./run-cre-cron.sh settlement-workflow settlement

Live Output

Run the CLI command above, then click Watch to see live output here.