Repository navigation
Conversation
Based Loans is a fixed-term lending protocol on Base with no liquidations. The provider lets an agent quote and open loans, buy collateral back, check a token's risk data, and lend USDC against tokens it chooses. It wraps @basedloans/sdk; write actions are signed by the agent's own wallet.
🟡 Heimdall Review Status
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a Based Loans action provider. Based Loans is a fixed-term lending protocol on Base with no liquidations:
The provider wraps
@basedloans/sdk(MIT, source). It reads every number live from Base mainnet, reads contract addresses from the protocol at runtime, and never holds keys. Write actions are signed by the agent's own wallet viaEvmWalletProvider.sendTransaction.14 actions
get_protocol_info,list_markets,get_risk_report,quote_borrow,get_my_loans,get_my_lending,request_token_listingborrow,buyback,lend,set_lending_limits,withdraw,claim_proceeds,claim_collateralDesign notes:
get_risk_reportgives the agent raw risk data for a token (price sources and whether they agree, pool history, trading needed to move the pool price 2x and 10x) with plain-language explanations, so it can judge a token before lending against it.borrowreplays the protocol's lender queue before sending anything. It refuses loans the contracts would reject (for example below the minimum size) with a readable reason, and warns when lenders can only part-fund the request.base-mainnetonly.Files: the provider folder (provider, schemas, tests, README), the export in
action-providers/index.ts, the actions table intypescript/agentkit/README.md, a patch changeset, and the dependency. The lockfile change is limited to the 16 lines for@basedloans/sdk, andpnpm install --frozen-lockfilepasses.The commit is signed.
Tests
Unit:
pnpm testintypescript/agentkitgives 15 new tests passing (SDK mocked). They cover network support, symbol and address resolution, multi-step sending in order, stopping at a failed step, and error handling.tsc, ESLint and Prettier are clean.End-to-end: this ran on an Anvil fork of Base mainnet at block 58283648. It used AgentKit's own CommonJS build (
dist/) with aViemWalletProviderand the published@basedloans/sdk@0.1.1, and invoked actions throughagentKit.getActions():Separately, on current
main, invoking actions still produced 7 unhandled rejections from failed analytics requests (HTTP error! status: ...). Without aprocess.on("unhandledRejection")handler that crashes Node. #1408 handled this fortrackInitialization; the per-action analytics call looks like it needs the same treatment. It is unrelated to this PR and noted in case it's useful.