Public
Edited
Feb 9, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
params = {
return {
varCap: 1000
}
}
Insert cell
Insert cell
Insert cell
days = (dateLimit[1] - dateLimit[0] )/ (1000 * 60 * 60 * 24)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
(new Date(parsedPerf[0].date)).toDateString()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof fixCap = {
const d = Inputs.number({ width: 100, value: 100E3, label: "Total fixed side capacity (USDC)"})
return d
}
Insert cell
viewof varCap = {
const d = Inputs.number({ width: 100, value: 1000, label: "Single user capital for variable side (USDC)"})
return d
}
Insert cell
viewof fixedRateAPR = {
const d = Inputs.number({step: 0.01, width: 100, value: 15, label: "Fixed Rate (%APR)"})
return d
}
Insert cell
viewof daysRange = {
const d = Inputs.number({step: 1, width: 100, value: 30, label: "Length of contract (days)"})
return d
}
Insert cell
viewof dateLimit = interval([earliest.getTime(), latest.getTime()],{
title: "Date range selector",
width: "400px",
step: 1000 * 60 * 60 * 24,
// value: [earliest.getTime(), latest.getTime()],
format: ([s, e]) => `${(new Date(s)).toDateString()} → ${(new Date(e)).toDateString()}`,
label: 'Select date interval',
})// Inputs.range([daysToLatest, daysToEarliest], {value: daysToEarliest, step: 1, label: "Past data limit (days)"})
Insert cell
Insert cell
Insert cell
Insert cell
dashi = require('@saffron-finance/dashi@latest')
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more