Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automated CB based on timestamps, Cron and DB part #246

Merged
merged 17 commits into from
Jan 12, 2024

Conversation

ConjunctiveNormalForm
Copy link
Member

@ConjunctiveNormalForm ConjunctiveNormalForm commented Jan 3, 2024

creates a Timestamp Dynamo table that tracks filler hash, lastCheckedPostTimestamp (last time the row is updated), and the timestamp that each filler should be blocked until.

The fade-rate cron job now calculates related timestamps based on recent order data from Redshift and Timestamp table

cb

@ConjunctiveNormalForm ConjunctiveNormalForm changed the title feat: Automated CB based on timestamps feat: Automated CB based on timestamps, Cron and DB part Jan 3, 2024
Copy link
Collaborator

@zhongeric zhongeric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

lib/constants.ts Outdated Show resolved Hide resolved
newFades = getFillersNewFades(FADES_ROWS, ADDRESS_TO_FILLER, FILLER_TIMESTAMPS, logger);
});

describe('getFillersNewFades', () => {
it('takes into account multiple filler addresses of the same filler', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test name seems outdated?

lib/cron/fade-rate.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@rileydcampbell rileydcampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice nice, this lgtm! just for a thought experiment, if we wanted to create a reset button it could just write to the filler row and set the blockUntilTimestamp to nothing right?

@ConjunctiveNormalForm
Copy link
Member Author

nice nice, this lgtm! just for a thought experiment, if we wanted to create a reset button it could just write to the filler row and set the blockUntilTimestamp to nothing right?

that's right, although I think the main goal of the design is to fully automate things

@ConjunctiveNormalForm ConjunctiveNormalForm merged commit 70f132b into prototype Jan 12, 2024
3 checks passed
@ConjunctiveNormalForm ConjunctiveNormalForm deleted the cb-timestamp branch January 12, 2024 15:28
@ConjunctiveNormalForm ConjunctiveNormalForm restored the cb-timestamp branch February 2, 2024 20:43
@@ -56,14 +58,15 @@ export class FadesRepository extends BaseRedshiftRepository {
}

const CREATE_VIEW_SQL = `
CREATE OR REPLACE VIEW rfqOrdersTimestamp
CREATE OR REPLACE VIEW latestRfqs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets the latest 20 RFQs for each filler right? The limit of 1k would prevent us from going over 50 fillers. Is this 50 filler limit expected for the foreseeable future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants