Developers
Integration guide
Contracts, units and the common flows in one place.
Contracts at a glance
| Contract | Use it to |
|---|---|
| BarrierCore | Deposit, strike, observe, settle, redeem |
| BarrierLegs | Read and transfer legs |
| SeriesRegistry | List series and templates |
| OracleAdapter | Read the close used for a timestamp |
| TradingCalendar | Check trading days |
Units and decimals
| Value | Unit |
|---|---|
| USDG | 6 decimals |
| Stock Token, BERRIER | 18 decimals |
| Chainlink price | 8 decimals |
| Coupon, levels | Basis points |
Common flows
Read a series
const s = await core.read.getSeries([seriesId]);Subscribe CARRY
await usdg.write.approve([core.address, amount]);
await core.write.depositCarry([seriesId, amount]);Subscribe GUARD
const prefund = await core.read.requiredPrefund([seriesId, stockAmount]);
await stock.write.approve([core.address, stockAmount]);
await usdg.write.approve([core.address, prefund]);
await core.write.depositGuard([seriesId, stockAmount]);After strike
Call refund(seriesId) for unmatched amounts, claimCoupons(seriesId) as coupons accrue and redeem(seriesId, units) after settlement.
Hold legs in a contract
Implement onERC1155Received and onERC1155BatchReceived.
ABI source
Verified source on the explorer at launch.