obentoDocs Open Obento

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 }
  ]
}
FieldMeaning
priceUSDC per obUSD, with 6 decimals
priceFreshWhether the price is less than an hour old
tvlSavings in the vault, in USDC
readyReady cash for instant withdrawals, in USDC
apyThe vault's rate after the fee. While the vault is empty, the rate its first deposit would earn
placesEach 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