Skip to content

Commit

Permalink
Merge pull request #214 from convergence-rfq/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
pindaroso authored Apr 2, 2024
2 parents 9dbc1a4 + f0b46c2 commit 928e3d9
Show file tree
Hide file tree
Showing 42 changed files with 311 additions and 5,451 deletions.
3,103 changes: 231 additions & 2,872 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 0 additions & 28 deletions hxro-print-trade-provider/agnostic-orderbook/src/critbit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use borsh::{BorshDeserialize, BorshSerialize};
use bytemuck::{Pod, Zeroable};
use num_derive::FromPrimitive;
use solana_program::pubkey::Pubkey;
use std::cell::Ref;
use std::{cell::RefCell, rc::Rc};
// A Slab contains the data for a slab header and an array of nodes of a critbit tree
// whose leafs contain the data referencing an order of the orderbook.
Expand All @@ -16,14 +15,6 @@ pub type NodeHandle = u32;

#[doc(hidden)]
pub type IoError = std::io::Error;
#[doc(hidden)]
#[derive(BorshDeserialize, BorshSerialize, Debug, PartialEq, Clone, Copy, Pod, Zeroable)]
#[repr(C)]
pub struct InnerNode {
prefix_len: u64,
key: u128,
pub children: [u32; 2],
}

/// A critibit leaf node
#[derive(Debug, PartialEq, PartialOrd, Clone, Copy, Pod, Zeroable)]
Expand Down Expand Up @@ -72,25 +63,6 @@ pub(crate) enum NodeTag {
LastFree,
}

#[doc(hidden)]
#[derive(Clone, Debug, PartialEq)]
pub enum Node {
Uninitialized,
Inner(InnerNode),
Leaf(LeafNode),
Free(FreeNode),
LastFree(FreeNode),
}

#[doc(hidden)]
pub enum NodeRef<'a> {
Uninitialized,
Inner(Ref<'a, InnerNode>),
Leaf(Ref<'a, LeafNode>),
Free(Ref<'a, FreeNode>),
LastFree(Ref<'a, FreeNode>),
}

////////////////////////////////////
// Slabs

Expand Down
2 changes: 1 addition & 1 deletion hxro-print-trade-provider/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@convergence-rfq/hxro-print-trade-provider",
"version": "3.9.0",
"version": "3.10.0",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion psyoptions-american-instrument/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@convergence-rfq/psyoptions-american-instrument",
"version": "3.9.0",
"version": "3.10.0",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion psyoptions-european-instrument/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@convergence-rfq/psyoptions-european-instrument",
"version": "3.9.0",
"version": "3.10.0",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion rfq/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@convergence-rfq/rfq",
"version": "3.9.0",
"version": "3.10.0",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion rfq/program/src/instructions/rfq/add_legs_to_rfq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct AddLegsToRfqAccounts<'info> {

fn validate<'info>(
ctx: &Context<'_, '_, '_, 'info, AddLegsToRfqAccounts<'info>>,
legs: &Vec<ApiLeg>,
legs: &[ApiLeg],
) -> Result<()> {
let AddLegsToRfqAccounts { protocol, rfq, .. } = &ctx.accounts;
let mut remaining_accounts = ctx.remaining_accounts.iter();
Expand Down
2 changes: 1 addition & 1 deletion rfq/program/src/instructions/rfq/respond_to_rfq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn validate(
bid: Option<Quote>,
ask: Option<Quote>,
expiration_timestamp: i64,
additional_data: &Vec<u8>,
additional_data: &[u8],
) -> Result<()> {
let RespondToRfqAccounts {
maker,
Expand Down
3 changes: 1 addition & 2 deletions rfq/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//!
//! Provides an abstraction and implements the RFQ mechanism.
#![allow(clippy::result_large_err)]
#![allow(clippy::too_many_arguments)]

use anchor_lang::prelude::*;
use solana_security_txt::security_txt;
Expand Down Expand Up @@ -113,7 +114,6 @@ pub mod rfq {
)
}

#[allow(clippy::too_many_arguments)]
pub fn add_base_asset(
ctx: Context<AddBaseAssetAccounts>,
index: BaseAssetIndex,
Expand Down Expand Up @@ -191,7 +191,6 @@ pub mod rfq {
withdraw_collateral_instruction(ctx, amount)
}

#[allow(clippy::too_many_arguments)]
pub fn create_rfq<'info>(
ctx: Context<'_, '_, '_, 'info, CreateRfqAccounts<'info>>,
expected_legs_size: u16,
Expand Down
2 changes: 1 addition & 1 deletion rfq/program/src/state/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl Response {
.escrow_leg_preparations_initialized_by
.get(leg_index as usize)
.cloned(),
AssetIdentifier::Quote => self.escrow_leg_preparations_initialized_by.get(0).cloned(),
AssetIdentifier::Quote => self.escrow_leg_preparations_initialized_by.first().cloned(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion risk-engine/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@convergence-rfq/risk-engine",
"version": "3.9.0",
"version": "3.10.0",
"license": "MIT",
"publishConfig": {
"access": "public",
Expand Down
7 changes: 0 additions & 7 deletions risk-engine/program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,3 @@ no-entrypoint = []
anchor-lang = { version = "0.28.0", features = ["init-if-needed"] }
anchor-spl = "0.28.0"
rfq = { path = "../../rfq/program", features = ["no-entrypoint"] }
switchboard-solana = "0.27.0"
pyth-sdk-solana = "0.7.2"
borsh = { version = "0.9.1", features = ["const-generics"] }
bytemuck = { version = "1.4.0", features = ["derive", "min_const_generics"] }

[dev-dependencies]
float-cmp = "0.9.0"
35 changes: 0 additions & 35 deletions risk-engine/program/src/base_asset_extractor.rs

This file was deleted.

Loading

0 comments on commit 928e3d9

Please sign in to comment.