Build on Obento
Read the vault
GET https://obentoapp.com/api/vault returns the vault's live state as JSON. An abridged example:
{
"price": "1000000",
"priceFresh": true,
"paused": false,
"tvl": 0,
"ready": 0,
"apy": 0.0436,
"grossApy": 0.0484,
"performanceFeeBps": 1000,
"places": [
{ "key": "0xf42f5795D9ac7e9D757dB633D693cD548Cfd9169", "value": 0, "share": 0, "apy": 0.0539 }
]
}| Field | Meaning |
|---|---|
price | USDC per obUSD, with 6 decimals |
priceFresh | Whether the price is less than an hour old |
tvl | Savings in the vault, in USDC |
ready | Ready cash for instant withdrawals, in USDC |
apy | The vault's rate after the fee. While the vault is empty, the rate its first deposit would earn |
places | Each place's value in USDC, its share of the vault and its rate before the fee |
Read a saver's earnings
GET https://obentoapp.com/api/earnings?address=0x… returns what an address has put in, taken out and holds now, in USDC with 6 decimals, and what it has earned in dollars. It reads the vault's own deposit and withdrawal events for that address, so obUSD sent between wallets and any bonus are not counted.
{ "deposited": "1000000000", "withdrawn": "0", "value": "1002500000", "earned": 2.5 }Deposit and withdraw
The vault is an ERC-4626 vault for USDC with 6-decimal shares (obUSD). Deposits and withdrawals go through the gateway:
deposit(vault, assets, minSharesOut, receiver, partnerId)redeem(vault, shares, minAssetsOut, receiver, partnerId)
Approve the gateway first: USDC for a deposit, obUSD for a withdrawal. A withdrawal larger than the ready cash joins the queue and is paid on Autopilot's next pass. Addresses are on the contracts page.
For agents
- /llms.txt lists every page.
- /docs/llms-full.txt holds all the docs in one file.
- Every page is also Markdown: add
.mdto its address, for example /docs/fees.md.