Skip to content

Instantly share code, notes, and snippets.

View vivekascoder's full-sized avatar
💭
Learning

Vivek vivekascoder

💭
Learning
View GitHub Profile
version: '3.8'
# Common environment variables used by app services
x-common-env: &common-env
CLERK_JWKS_URL: ${CLERK_JWKS_URL}
CLERK_SECRET_KEY: ${CLERK_SECRET_KEY}
LIVEKIT_API_KEY: ${LIVEKIT_API_KEY}
LIVEKIT_API_SECRET: ${LIVEKIT_API_SECRET}
LIVEKIT_SANDBOX_ID: ${LIVEKIT_SANDBOX_ID}
LIVEKIT_URL: ${LIVEKIT_URL}
Average return: 30.11%
Total return: 270.96%
Total duration: 27 days
Start End Return [%] Peak Return [%] Win Rate [%] Equity Peak [$] Equity Final [$] Max. Drawdown [%] Buy & Hold Return [%]
6 Jul-01-25 Jul-04-25 22.451847 22.451847 50.000000 1224.518466 1224.518466 -18.776288 -2.465899
8 May-01-25 May-04-25 5.980060 28.021885 50.000000 1280.218851 1059.800601 -20.515246 -0.927623
3 Sep-01-25 Sep-04-25 23.810053 34.995735 46.666667 1349.957350 1238.100533 -48.303448 3.368899
4 Jun-01-25 Jun-04-25 22.736669 64.223819 43.750000 1642.238193 1227.366693 -43.733888 2.256369
0 Mar-01-25 Mar-04-25 304.614341 333.699821 42.857143 4336.998207 4046.143408 -40.423044 2.037495
1 Oct-22-25 Oct-25-25 -17.422481 65.668575 36.363636 1656.685754
Position History Summary (SOL-USD only):
Total positions: 11
Status: OK
Position Data:
================================================================================
market side size openPrice exitPrice pnl_percent closedTime
SOL-USD LONG 1.1000 180.2900 184.4600 23.1294 2025-10-23 11:19:40
SOL-USD LONG 2.5000 185.2300 182.4400 -15.0624 2025-10-22 19:58:04
SOL-USD SHORT 2.5000 184.2400 184.9100 -3.6366 2025-10-22 17:23:36
{
"address": "BhRc1GTpQPtuSVPJG2tzE74jF3afb7NRrLK7JTvBbree",
"metadata": {
"name": "fpmm",
"version": "0.1.0",
"spec": "0.1.0",
"description": "Created with Anchor"
},
"instructions": [
{
@vivekascoder
vivekascoder / try-catch.ts
Created April 22, 2025 17:38 — forked from t3dotgg/try-catch.ts
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
> [email protected] start /Users/statemachine/code/test_rag
> tsx ./src/index.ts
Response: YES
explanation The news confirms that the Trump administration is set to enforce a U.S. immigration law that requires Canadians who visit the U.S. for more than 30 days to register with immigration authorities. This new requirement is effective starting April 11. Since the event is confirmed to happen in the near future and the enforcement date has been officially stated, this fulfills the criteria of being deemed as having already happened, leading to the conclusion of YES.
======================================
Response: NO
explanation The requirement for Canadians visiting the U.S. to register will be effective starting April 11. As such, it has not yet happened, and the current status is that it is scheduled to occur in the future. Therefore, the answer is NO.
======================================
with
combined as (
select
"from" as addr,
"blockTimestamp",
pool
from
indexer_blue."AddLiquidity"
union
select
CREATE MATERIALIZED VIEW IF NOT EXISTS daily_volume AS
WITH parameters AS (
SELECT
'0x9cdAA94733a682013Ff8AfD72BA59FB63619C98d' AS pool_addr,
EXTRACT(EPOCH FROM NOW() - INTERVAL '24 hours') AS last_time
),
combined AS (
SELECT amount, "blockTimestamp", pool
FROM "AddLiquidity"
WHERE "blockTimestamp" >= (SELECT last_time FROM parameters)
"use client";
import {
ChartConfig,
ChartContainer,
ChartLegend,
ChartLegendContent,
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart";
--------------Init
>> payoff | long 5e-05, short 5e-05
LC: 1.0 SC: 1.0
LP value 3000, liquidity 0.0
K 3 Reserve: 0.0001 alpha:5e-05 beta:5e-05
LC 1.0 SC 1.0
x %s p %s 1.0 3000
--------------LP added
>> payoff | long 5e-05, short 5e-05
LC: 79.37010551174308 SC: 0.012599202099486268