Skip to content

Instantly share code, notes, and snippets.

View allquantor's full-sized avatar
:shipit:
.

Ivan Morozov allquantor

:shipit:
.
View GitHub Profile
-- Constants
GAME_TIME = 1000 * 60 * 15 -- 15 minutes game time in milliseconds
TOKEN_ADDR = "Sa0iBLPNyJQrwpTTG-tWLQU-1QeUAJA73DdxGGiKoJc" -- Testnet cred token contract
TOKEN_MINIMUM = 10000 -- 10 $CRED
-- Game state
GameState = {
Treasury = 0, -- The balance of testnet cred in the round
Timeout = 0, -- The time when the game ends
LastSender = nil, -- State of the last sender
-- Constants
GAME_TIME = 1000 * 60 * 15 -- 15 minutes game time in milliseconds
TOKEN_ADDR = "Sa0iBLPNyJQrwpTTG-tWLQU-1QeUAJA73DdxGGiKoJc" -- Testnet cred token contract
TOKEN_MINIMUM = 10000 -- 10 $CRED
-- Game state
GameState = {
Treasury = 0, -- The balance of testnet cred in the round
Timeout = 0, -- The time when the game ends
LastSender = nil, -- State of the last sender
-- Constants
local GAME_TIME = 1000 * 60 * 15 -- 15 minutes game time in milliseconds
local TOKEN_ADDR = "Sa0iBLPNyJQrwpTTG-tWLQU-1QeUAJA73DdxGGiKoJc" -- Testnet cred token contract
-- Game state
local GameState = {
Treasury = 0, -- The balance of testnet cred in the round
Timeout = 0, -- The time when the game ends
LastSender = nil, -- State of the last sender
}

Integration Engineering Exercise: Vela.Exchange Data Pipeline

Objective

The goal of this exercise is to demonstrate your ability to integrate a decentralized platform, specifically vela.exchange, into our existing data pipeline. Your task is to ensure that every trade and other relevant information from vela.exchange is captured and stored in our database.

Understanding Our Architecture

Before you begin, familiarize yourself with our current infrastructure, which is outlined below. Understanding the flow of data and the structure of our database tables is crucial for the successful completion of this exercise.

{-
MAMonad:
- A monadic structure, MAMonad, designed to abstract over various content types (e.g., Video, Audio, Text) and facilitate transformations between them using a Large Language Model (LLM).
- Type: MAMonad :: * -> *
Bifunctor-like Error Handling:
- MAMonadResult is a bifunctor-like structure encapsulating either a result (Success) or an error (Error).
- Type: MAMonadResult a b = Success a | Error b
-- Define the MAMonadContent type class
class MAMonadContent a where
extractKeys :: LLM -> a -> IO [Key]
-- Define the MAMonad type
newtype MAMonad a = MAMonad { runMAMonad :: IO a }
instance Functor MAMonad where
fmap f (MAMonad a) = MAMonad $ fmap f a
-- 1. Function Definition
CREATE OR REPLACE FUNCTION fetch_reverse_data(addr text)
RETURNS text LANGUAGE plpgsql AS $$
DECLARE
enc_addr_hex text;
body text;
response text;
name_off bigint;
name_len bigint;
-- 1. Function Definition
CREATE OR REPLACE FUNCTION fetch_reverse_data(addr text)
RETURNS text LANGUAGE plpgsql AS $$
DECLARE
enc_addr_hex text;
body text;
response text;
name_off bigint;
name_len bigint;
package co.upvest.martind
import co.upvest.terminology.adjectives.common._
import co.upvest.terminology.adjectives.implicits._
import co.upvest.dry.essentials._
import co.upvest.dry.essentials.syntax._
import co.upvest.dry.catz.syntax._
import co.upvest.dry.{gstorage => gs}
import co.upvest.dry.service.{UpvestMsgId, Flogging}
import json
import urllib
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect
from django.urls import reverse
from django.utils import timezone
from rest_framework.renderers import TemplateHTMLRenderer
from rest_framework.response import Response
from rest_framework.views import APIView