@morpho-dev/router 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -71
- package/dist/cli.js +3209 -1252
- package/dist/drizzle/migrations/0017_dusty_the_hunter.sql +1 -0
- package/dist/drizzle/migrations/0018_add_chain_collector_constraints.sql +3 -0
- package/dist/drizzle/migrations/0019_add-obligation-units-shares.sql +2 -0
- package/dist/drizzle/migrations/0020_add-session.sql +1 -0
- package/dist/drizzle/migrations/0021_drop_chain_collector_epoch_indexes.sql +2 -0
- package/dist/drizzle/migrations/0021_migrate-rate-to-price.sql +15 -0
- package/dist/drizzle/migrations/0022_consolidate-price.sql +15 -0
- package/dist/drizzle/migrations/meta/0017_snapshot.json +1525 -0
- package/dist/drizzle/migrations/meta/0018_snapshot.json +1572 -0
- package/dist/drizzle/migrations/meta/0019_snapshot.json +1586 -0
- package/dist/drizzle/migrations/meta/_journal.json +42 -0
- package/dist/evm/bytecode/erc20.txt +1 -0
- package/dist/evm/bytecode/factory.txt +1 -0
- package/dist/evm/bytecode/mempool.txt +1 -0
- package/dist/evm/bytecode/morpho.txt +1 -0
- package/dist/evm/bytecode/multicall3.txt +1 -0
- package/dist/evm/bytecode/oracle.txt +1 -0
- package/dist/evm/bytecode/terms.txt +1 -0
- package/dist/evm/bytecode/vault.txt +1 -0
- package/dist/evm/bytecode/vaultV1.txt +1 -0
- package/dist/index.browser.d.mts +1327 -816
- package/dist/index.browser.d.mts.map +1 -1
- package/dist/index.browser.d.ts +1358 -847
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +2209 -1668
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +2173 -1632
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +1885 -1222
- package/dist/index.node.d.mts.map +1 -1
- package/dist/index.node.d.ts +1885 -1222
- package/dist/index.node.d.ts.map +1 -1
- package/dist/index.node.js +1984 -1016
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +1963 -1014
- package/dist/index.node.mjs.map +1 -1
- package/docs/integrator.md +78 -0
- package/package.json +11 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "router_v1.6"."offers" DROP COLUMN "nonce";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
CREATE UNIQUE INDEX "chains_chain_id_idx" ON "router_v1.6"."chains" USING btree ("chain_id");--> statement-breakpoint
|
|
2
|
+
CREATE UNIQUE INDEX "collectors_chain_name_idx" ON "router_v1.6"."collectors" USING btree ("chain_id","name");--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "router_v1.6"."collectors" ADD CONSTRAINT "collectors_chain_id_chains_chain_id_fk" FOREIGN KEY ("chain_id") REFERENCES "router_v1.6"."chains"("chain_id") ON DELETE no action ON UPDATE no action;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "router_v1.6"."offers" ADD COLUMN "session" varchar(66) NOT NULL DEFAULT '0x0000000000000000000000000000000000000000000000000000000000000000';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- Add new columns start_price and expiry_price
|
|
2
|
+
ALTER TABLE "router_v1.6"."offers"
|
|
3
|
+
ADD COLUMN "start_price" numeric(78, 0),
|
|
4
|
+
ADD COLUMN "expiry_price" numeric(78, 0);--> statement-breakpoint
|
|
5
|
+
-- Migrate data from rate to start_price and expiry_price
|
|
6
|
+
UPDATE "router_v1.6"."offers" SET start_price = rate, expiry_price = rate;--> statement-breakpoint
|
|
7
|
+
-- Make columns NOT NULL after migration
|
|
8
|
+
ALTER TABLE "router_v1.6"."offers"
|
|
9
|
+
ALTER COLUMN "start_price" SET NOT NULL,
|
|
10
|
+
ALTER COLUMN "expiry_price" SET NOT NULL;--> statement-breakpoint
|
|
11
|
+
-- Drop the old rate column
|
|
12
|
+
ALTER TABLE "router_v1.6"."offers" DROP COLUMN "rate";--> statement-breakpoint
|
|
13
|
+
-- Drop rate-based indexes (can't index computed values)
|
|
14
|
+
DROP INDEX IF EXISTS "router_v1.6"."offers_group_winner_sell_side_idx";--> statement-breakpoint
|
|
15
|
+
DROP INDEX IF EXISTS "router_v1.6"."offers_group_winner_buy_side_idx";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- Consolidate start_price and expiry_price into single price column
|
|
2
|
+
-- Since offers now have a constant price (no linear interpolation), we only need one column
|
|
3
|
+
|
|
4
|
+
-- Add new price column
|
|
5
|
+
ALTER TABLE "router_v1.6"."offers" ADD COLUMN "price" numeric(78, 0);--> statement-breakpoint
|
|
6
|
+
|
|
7
|
+
-- Migrate data: copy start_price to price (they should be equal, use start_price as canonical)
|
|
8
|
+
UPDATE "router_v1.6"."offers" SET price = start_price;--> statement-breakpoint
|
|
9
|
+
|
|
10
|
+
-- Make price NOT NULL after migration
|
|
11
|
+
ALTER TABLE "router_v1.6"."offers" ALTER COLUMN "price" SET NOT NULL;--> statement-breakpoint
|
|
12
|
+
|
|
13
|
+
-- Drop the old columns
|
|
14
|
+
ALTER TABLE "router_v1.6"."offers" DROP COLUMN "start_price";--> statement-breakpoint
|
|
15
|
+
ALTER TABLE "router_v1.6"."offers" DROP COLUMN "expiry_price";
|