Integrations for developers
Contracts at a glance
Section titled “Contracts at a glance”| Contract | Role | Standard |
|---|---|---|
NoteCore | Series registry, escrow, matching, observation, settlement | INoteCore + INoteCoreViews |
NoteLegs | COUPON and SHIELD units | ERC-1155 with transfer hook into NoteCore |
OracleAdapter | Official-close price reads | IOracleAdapter |
MarketCalendar | Official close validation | IMarketCalendar |
RevenueRouter | Fee sink, buyback auction | IFeeSink |
NOTE | Governance token | ERC-20 + Permit + Votes |
sNOTE | Staking vault | ERC-4626 + IRewardSink |
Treasury | Reserves and floor redemption | — |
BondDepository | Bond markets | — |
Desk | COUPON buyer vault | ERC-4626 + ERC-1155 holder |
Deployed addresses: Addresses (TBD).
Units and decimals
Section titled “Units and decimals”fact
| Quantity | Unit |
|---|---|
Prices (s0, lastPrice, feed answers) | 1e8 (Chainlink convention), uiMultiplier already applied by the feed |
| Quote (USDG) amounts | Token decimals (6 for USDG); read quote() and its decimals() |
| Stock Token amounts | 18 decimals, raw ERC-20 balances (not balanceOfUI) |
| Leg units | 1 unit = 1 quote unit of matched notional (so 6 decimals for USDG) |
couponIndex | WAD (1e18) net quote per unit |
| Basis points | 1e4 = 100% |
quote = stock × price / 1e8 / 10^(18 − quoteDecimals)
stock = quote × 10^(18 − quoteDecimals) × 1e8 / price (rounded up at strike)
Common flows
Section titled “Common flows”Read a series
Section titled “Read a series”INoteCoreViews.SeriesView memory v = core.getSeries(seriesId);// v.status, v.observations, v.s0, v.couponBps, v.matchedNotional, v.couponIndex, v.nextObs, v.breachedbool holding = core.barrierHolding(seriesId); // lastPrice * 1e4 >= s0 * barrierBpsuint256 owed = core.accruedCoupon(seriesId, account); // claimable now(uint256 q, uint256 s) = core.previewRedeem(seriesId, 0, units); // COUPON redemption previewSubscribe COUPON
Section titled “Subscribe COUPON”usdg.approve(address(core), amount);core.depositCoupon(seriesId, amount); // amount >= minTicket; before subscriptionEndSubscribe SHIELD
Section titled “Subscribe SHIELD”uint256 prefund = core.requiredPrefund(seriesId, stockAmount); // at provisional pricestock.approve(address(core), stockAmount);usdg.approve(address(core), prefund);core.depositShield(seriesId, stockAmount, prefund);After strike
Section titled “After strike”core.settle(seriesId, account); // permissionless: mints legs to account, books refundscore.claim(seriesId); // COUPON couponscore.redeem(seriesId, units); // COUPON principal (USDG or stock)core.redeemShield(seriesId, units);core.refund(seriesId); // unmatched depositsclaim, redeem, redeemShield and refund settle the caller first if needed.
Hold legs in a contract
Section titled “Hold legs in a contract”Your contract must implement IERC1155Receiver (or inherit ERC1155Holder). Coupons accrue to the holding contract; call claim from it. The transfer hook settles accrued coupons into claimableQuote on both sides of every transfer, so a vault can safely accept and hand out COUPON units without tracking coupon snapshots itself.
Guides
Section titled “Guides”- Interfaces: full Solidity interfaces.
- ERC-1155 ids: id scheme and helpers.
- Events: every event with indexed fields, for indexers.
- Automation and cranks: permissionless cranks, lazy execution,
RollPolicyand the Chainlink-compatibleNoteAutomationupkeep. - Addresses: deployments.
ABI source
Section titled “ABI source”ABIs are produced by forge build from contracts/ in the repository. Interfaces on these pages are copied from contracts/src/interfaces/ and the contract sources; the sources are authoritative.