Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions typescript/agentkit/src/action-providers/floe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Floe — The Financial OS for AI Agents

Wallet, fiat on/off-ramp, working capital, x402 payments, and portable credit — in one action provider.

**3,000+ secured working capital lines issued. Zero defaults. 13,000+ x402 APIs reachable.**

## The financial loop

```
1. Fund → Buy USDC with a bank account or card (dashboard)
2. Deposit → Agent deposits USDC as collateral
3. Borrow → Get up to 95% back as working capital (instant_borrow)
4. Spend → Call any x402 API — Floe pays automatically (x402_fetch)
5. Repay → Pay back principal + fixed fee, deposit returns
6. Trust → Every repayment builds the agent's credit record
```

No price-volatility risk. No crypto complexity. Gas-free for delegated agents.

## Actions

| Action | Type | What it does |
|--------|------|--------------|
| `getMarkets` | Read | Available lending markets and terms |
| `instantBorrow` | Write | Deposit USDC, borrow up to 95% — auto-selects best lender |
| `repay` | Write | Repay loan — deposit returns automatically |
| `checkStatus` | Read | Loan health, balance, accrued interest, time to expiry |
| `getBalance` | Read | Credit balance + utilization (for facilitator-delegated agents) |
| `checkHealth` | Read | Current LTV and liquidation risk |
| `grantDelegation` | Write | Delegate to Floe facilitator for gas-free x402 payments (one-time) |
| `x402Fetch` | Write | Call any x402 API — Floe handles payment automatically |

## Setup

```typescript
import { AgentKit } from "@coinbase/agentkit";
import { getVercelAITools } from "@coinbase/agentkit-vercel-ai-sdk";
import { FloeActionProvider } from "@coinbase/agentkit";

const agentkit = await AgentKit.from({
walletProvider,
actionProviders: [new FloeActionProvider()],
});

const tools = getVercelAITools(agentkit);
```

## Why

100M+ x402 machine payments since May 2025. 100,000+ agents with onchain identity. Zero credit outstanding to any of them.

Every economy runs on credit. Agents don't have FICO — but they have something better: deterministic cashflows and verifiable execution history. Floe is building the credit bureau and capital rail for all AI agents.

## Network

- **Base Mainnet** — Coinbase's L2, built for payments
- **Contract:** [`0x17946cD3e180f82e632805e5549EC913330Bb175`](https://basescan.org/address/0x17946cD3e180f82e632805e5549EC913330Bb175)

## Links

- [Quickstart](https://floe-labs.gitbook.io/docs/getting-started/quickstart) — from zero to first API call
- [Full npm package (45 actions)](https://www.npmjs.com/package/floe-agent)
- [Dashboard](https://dev-dashboard.floelabs.xyz) — fund with fiat, manage agents
- [Docs](https://floe-labs.gitbook.io/docs)
- [Website](https://floelabs.xyz)
86 changes: 86 additions & 0 deletions typescript/agentkit/src/action-providers/floe/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { type Address } from "viem";

export const SUPPORTED_NETWORKS = ["base-mainnet"];

export const LENDING_MATCHER_ADDRESSES: Record<string, Address> = {
"base-mainnet": "0x17946cD3e180f82e632805e5549EC913330Bb175",
};

export const FACILITATOR_ADDRESSES: Record<string, Address> = {
"base-mainnet": "0x58EDdE022FFDAD3Fb0Fb0E7D51eb05AaF66a31f1",
};

export const FACILITATOR_API = "https://credit-api.floelabs.xyz";

export const TOKEN_ADDRESSES: Record<string, Record<string, Address>> = {
"base-mainnet": {
usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
weth: "0x4200000000000000000000000000000000000006",
cbbtc: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
},
};

export const USDC_DECIMALS = 6;

export const LENDING_MATCHER_ABI = [
{
inputs: [
{ name: "operator", type: "address" },
{ name: "borrowLimit", type: "uint256" },
{ name: "maxRateBps", type: "uint256" },
{ name: "expiry", type: "uint256" },
{ name: "onBehalfOfRestriction", type: "address" },
],
name: "setOperator",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{ name: "agent", type: "address" },
{ name: "operator", type: "address" },
],
name: "getOperatorPermission",
outputs: [
{ name: "approved", type: "bool" },
{ name: "borrowLimit", type: "uint256" },
{ name: "borrowed", type: "uint256" },
{ name: "maxRateBps", type: "uint256" },
{ name: "expiry", type: "uint256" },
{ name: "onBehalfOfRestriction", type: "address" },
],
stateMutability: "view",
type: "function",
},
] as const;

export const ERC20_ABI = [
{
inputs: [
{ name: "spender", type: "address" },
{ name: "amount", type: "uint256" },
],
name: "approve",
outputs: [{ name: "", type: "bool" }],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [{ name: "account", type: "address" }],
name: "balanceOf",
outputs: [{ name: "", type: "uint256" }],
stateMutability: "view",
type: "function",
},
{
inputs: [
{ name: "owner", type: "address" },
{ name: "spender", type: "address" },
],
name: "allowance",
outputs: [{ name: "", type: "uint256" }],
stateMutability: "view",
type: "function",
},
] as const;
Loading
Loading